-
-
Notifications
You must be signed in to change notification settings - Fork 600
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
feat(typescript): Move to BuilderProgram API #217
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NotWoods
force-pushed
the
ts-watcher-api
branch
from
February 20, 2020 21:04
beb6279
to
067fde4
Compare
NotWoods
force-pushed
the
ts-watcher-api
branch
from
February 20, 2020 21:10
067fde4
to
e7caab6
Compare
NotWoods
force-pushed
the
ts-watcher-api
branch
from
February 20, 2020 21:18
e7caab6
to
1fbd1f8
Compare
Is this ready for review ? |
Yes |
shellscape
approved these changes
Feb 28, 2020
simonihmig
added a commit
to simonihmig/ecsy-babylon
that referenced
this pull request
Mar 4, 2020
the errors itself are not present when working directly with TS (e.g. `yarn lint:ts`). Seems to be a bug in the rollup plugin, which is hopefully fixed with the next release (rollup/plugins#217)
Closed
LarsDenBakker
pushed a commit
to LarsDenBakker/plugins
that referenced
this pull request
Sep 12, 2020
* Move to BuilderProgram API * Update tests for new API * Use include/exclude for files * Clean up refactored code * Change tslib to be a path instead of source * Update overriding test * Work on supporting project references * Working declaration files * Stop watching after build is done * Add warnings for sourceMap flag * Add incremental build support * Add rebuild test * Separate module resolution * Work on project reference support * Fix incremental test * Fix path normalization * Cleanup * Update override options * Skip project reference test * Try skipping incremental build * Try no cache * Try serial * Posix paths
This was referenced Aug 4, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rollup Plugin Name:
typescript
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers: #216, #205, #204, #70, #61
Description
This is another refactor to move from
LanguageService
(meant for IDEs) toBuilderProgram
(meant for partial recomplation). This makes some big changes to the plugin to better align with what Typescript does: rather than Rollup giving us files to transform and the plugin transforming them on the fly, Typescript detects all source files and does a entire project transpilation at the very start. This is similar to Jake Archibald's simple-ts plugin, except the compilation is done in-memory rather than with a temp directory.BuilderProgram
is also used by Webpack's ts-loader. Since the behavior is better aligned with Typescript, this fixes some odd inconsistencies in the typechecking like #204 and #211.We now support the
declaration
anddeclarationMap
options with this change! When generating declaration files, theoutDir
must be set and be pointed to Rollup's outputdir
(or some subfolder). This allows us to use Rollup's asset emit API, and other plugins can then intercept these assets to potentially bundle the declaration files later. We currently emit each file separately, similar to rollup-plugin-typescript2.This also adds experimental support for incremental builds, and paves the way for project references/build mode too.
Breaking changes
All files discovered by Typescript will be compiled. The
include
/exclude
filter can be used to filter out the files that Typescript finds. By default, all files in a directory with the tsconfig.json will be included, so most projects should not need additional changes. Our tests have been updated to have tsconfig.json files in each fixture directory, since we don't want all fixtures to be compiled for each test.tslib
can no longer be overriden by passing in source code directly. Now, it must be a path to a file. This better aligns with other plugins and is probably the expected behavior. Users can migrate by placing their custom tslib source code inside a file in their project, then including a path to it inside the plugin options.The declaration, declarationMap, incremental, and tsBuildInfoFile options are no longer ignored. If these options are set, then a Rollput output
dir
must be used and Typescript'soutDir
/declarationDir
must be located inside of it.Compilationn will fail if these directories are not set to be withindir
.We also fail compilation if the deprecated
out
option is used, or if the incompatibleoutFile
is used.