Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds the configuration for PnP/Typescript #6856

Merged
merged 4 commits into from May 1, 2019

Conversation

@arcanis
Copy link
Contributor

commented Apr 20, 2019

The fork-ts-checker-webpack-plugin package just released an update that allows to specify custom resolution schemes. This makes it possible for Create-React-App to have native PnP support even when using TypeScript.

I've tested this diff locally and it seemed to work.

Maël Nison
@johnnyreilly

This comment has been minimized.

Copy link
Contributor

commented Apr 20, 2019

Fast work!

Question: I don't see usage of the https://github.com/arcanis/pnp-webpack-plugin in this PR. Is use of the pnp-webpack-plugin no longer required when working with webpack?

@arcanis

This comment has been minimized.

Copy link
Contributor Author

commented Apr 20, 2019

Until webpack/enhanced-resolve#168 gets merged the pnp-webpack-plugin package is needed for everything that uses enhanced-resolve (basically Webpack itself). Since it's already been configured in #5136 I don't need to add anything else.

In the case of TypeScript, since it uses its own resolution instead of enhanced-resolve, the only package that I need to add is ts-pnp, which connects the living PnP environment with the existing TypeScript resolution algorithms.

@ianschmitz ianschmitz added this to the 3.x milestone Apr 20, 2019

@ianschmitz

This comment has been minimized.

Copy link
Collaborator

commented Apr 21, 2019

Thanks @arcanis. Does Jest work as expected with this PR?

@arcanis

This comment has been minimized.

Copy link
Contributor Author

commented Apr 21, 2019

Yep - running yarn test then pressing a got the default test green.

As far as I can remember, Jest just uses Babel to strip the TS types, so no particular TS resolution involved - it simply uses the classic Jest resolution (which supports PnP out of the box since 24.5).

arcanis added some commits Apr 21, 2019

@crubier

This comment has been minimized.

Copy link

commented Apr 24, 2019

Can't wait for this aha

@iansu iansu modified the milestones: 3.x, 3.0.1 Apr 24, 2019

@iansu iansu self-assigned this Apr 24, 2019

@arcanis

This comment has been minimized.

Copy link
Contributor Author

commented May 1, 2019

Any blocker?

@iansu

This comment has been minimized.

Copy link
Collaborator

commented May 1, 2019

No, I think this looks good. Thanks for the reminder. 😀

@iansu iansu merged commit b36d1ea into facebook:master May 1, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
netlify/create-react-app/deploy-preview Docs deploy preview succeeded
Details
@iansu

This comment has been minimized.

Copy link
Collaborator

commented May 1, 2019

Thanks! ❤️

@lock lock bot locked and limited conversation to collaborators May 6, 2019

@arcanis arcanis deleted the arcanis:resolve-module-name-module branch May 21, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.