-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Better TypeScript support #1378
Comments
Duplicates :
The plugin is originally a spin-off of a PR implementing type-checking, but the feature wasn't well received by the community, so I guess it's better to leave the choice to the end user. The TypeScript plugin will probably be integrated as a core plugin once we settle on a plugin RFC though (aka |
This will probably automatically happen once the new plugin system lands and we split up every plugin in a seperate package. Using parcel-plugin-ts as the default in that case. This will be part of the Parcel v2.0 update |
@DeMoorJasper - When could this happen? |
Please use the +1 button instead of adding comments saying +1 |
1627 Support Rather than stretch That way all the resolution, errors, special modes will reside in TS compiler, and act in familiar TS manner. |
This best loaders use native typescript as much as possible. |
Remove compiled version of start-up-visualizer from source code in favour of externally hosted (for now - https://ij-perf.develar.org) In general, nothing stops us to continue providing because still it is small text only js file, but not clear does it worth it or not. Migrate from parcel to webpack because: 1. SRI support — https://github.com/waysact/webpack-subresource-integrity (parcel issue: parcel-bundler/parcel#2003) 2. Full typescript support (including type checking) — https://github.com/TypeStrong/ts-loader & https://github.com/Realytics/fork-ts-checker-webpack-plugin (parcel issue: parcel-bundler/parcel#1378) 3. Externals support — https://webpack.js.org/configuration/externals/ (parcel issue: parcel-bundler/parcel#144) There is workaround, but still because of lack type checking for typescript parcel is no-go. So, parcel is good for very small projects during experimenting but not suitable for any production usage. Yeach, a lot of things in webpack can be simplified without sacrificing user-friendly (so funny bug that documented flag `optimize-minimize` doesn't work if `mode` also specified - and so on), but as no webpack alternatives at the moment, it is ok to write monstrous webpack.config.js
Wow, this seems to have been completely abandoned. Despite TypeScript's increase in popularity. Still no type checks. |
We are working on this for Parcel 2. |
@mischnic Awesome, is there an issue we can follow for updates on parcel 2? |
@tgroutars comment above refers to Parcel 2/TypeScript transformer: Mind you, that PR is old and not handling type checks (yet?) |
The current PR is #3083 (but doesn't have type checking either) |
Some initial work on typechecking: see #3142 |
I posted a workaround for type errors in the console in a comment in #465 that others might find useful: #465 (comment)
|
I created an issue for Parcel 2 about the incomplete TypeScript support, and the official response by @DeMoorJasper is that Parcel 2 will effectively behave the same as Parcel 1 by stripping out TypeScript and treating it as JavaScript with babel. TypeScript code will not be compiled, so there will be no type checking or compiler errors. If you have a desire for real TypeScript support in Parcel 2, please comment in the new RFC: #4022 |
Going to close this. Parcel 2 now does support loading setting from tsconfig.json and respects baseUrl, paths, etc. Type checking is not supported, but could be implemented in a third party plugin. |
💬 RFC Better TypeScript support
TypeScript is working out of the box for the most part but there are a few pain points:
Pain points
baseUrl
inside tsconfig.json not supporting. #202 This covers these configs:baseUrl
paths
allowSyntheticDefaultImports
parcel-plugin-typescript
adds it but console is not cleared after issue is resolvedImprovements
tsconfig
ts
ortsx
file was imported buttsconfig
is not present, create one@types
packages Automatically install Typescript types #1161🔦 Context
TypeScript is pretty popular and having first class support for it in Parcel will attract a wider range of users.
💻 Examples
I tried cloning react-parcel-example and making repo states that demonstrate those pain points:
baseUrl
config is not workingThe text was updated successfully, but these errors were encountered: