Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Conversation

hwillson
Copy link
Member

Typescript's allowSyntheticDefaultImports compiler option is something we'd like to start using, but I jumped the gun a bit by introducing it in 9a96519. Including it means that anyone who wants to use Typescript with React Apollo would have to also include it in their own local tsconfig.json, to be able to handle default imports properly. This is because we're also using Typescript's es2015 module option, which means allowSyntheticDefaultImports has to be enabled explicitly.

This PR removes allowSyntheticDefaultImports use, switching back to using a combination of import * as X and require syntax, to work with default imports. We'll re-introduce allowSyntheticDefaultImports use in React Apollo 3.

Fixes #2433.

Typescript's `allowSyntheticDefaultImports` compiler option
is something we'd like to start using, but I jumped the gun a
bit by introducing it in 9a96519.
Including it means that anyone who wants to use Typescript with
React Apollo would have to also include it in their own local
`tsconfig.json`, to be able to handle default imports
properly. This is because we're also using Typescript's `es2015`
module option, which means `allowSyntheticDefaultImports` has
to be enabled explicitly.

This commit removes `allowSyntheticDefaultImports` use, switching
back to using a combination of `import * as X` and `require`
syntax, to work with default imports. We'll re-introduce
`allowSyntheticDefaultImports` use in React Apollo 3.

Fixes #2433.
@hwillson hwillson merged commit 62de207 into master Sep 29, 2018
@hwillson hwillson deleted the hwillson/issue-2433 branch September 29, 2018 09:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant