Skip to content

fix(typescript): exclude typescript lib declarations in...#875

Merged
alexeagle merged 2 commits into
bazel-contrib:masterfrom
gregmagolan:exclude-typescript-lib-declarations
Jun 19, 2019
Merged

fix(typescript): exclude typescript lib declarations in...#875
alexeagle merged 2 commits into
bazel-contrib:masterfrom
gregmagolan:exclude-typescript-lib-declarations

Conversation

@gregmagolan
Copy link
Copy Markdown
Collaborator

@gregmagolan gregmagolan commented Jun 19, 2019

...node_module_library transitive_declarations as the including of these .d.ts is controlled by compilerOptions libs (except for typescript.d.ts and tsserverlibrary.d.ts which are imported standardly)
. Including all of the can cause typings conflicts.

Unblocks angular/angular#31019

@gregmagolan gregmagolan changed the title fix(typescript): exclude typescript lib declarations in fix(typescript): exclude typescript lib declarations in... Jun 19, 2019
...node_module_library transitive_declarations as the including /node_modules/typescript/lib/lib.*.d.ts is controlled by compilerOptions libs. Including all of the can cause typings conflicts.

Test coverage also added for this that verifies that typescript/lib/typescript.d.ts and typescript/lib/tsserverlibrary.d.ts are available since we must exclude other typescript/lib/ .d.ts files which are controlled by the compilerOptions.libs config. Also verify that libs not specified such as lib.webworkder.d.ts in compileOptions.libs config are not included in the compilation unit. See #875 for more details.
...in generated ts_library tsconfig. This fixes an issue where the @bazel/tsetse plugin values in a user's config would always be overridden by ts_library and not honoured. Also remove disable_tsetse_for_external test as we no longer doing this.
@gregmagolan
Copy link
Copy Markdown
Collaborator Author

Fix for

packages/service-worker/worker/src/service-worker.d.ts:30:15 - error TS2300: Duplicate identifier 'Client'.

30 declare class Client {
                 ~~~~~~

  external/npm/node_modules/typescript/lib/lib.webworker.d.ts:694:11
    694 interface Client {
                  ~~~~~~
    'Client' was also declared here.
  external/npm/node_modules/typescript/lib/lib.webworker.d.ts:701:13
    701 declare var Client: {
                    ~~~~~~
    and here.

included and test coverage as well

Copy link
Copy Markdown
Collaborator

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, I convinced myself that the disable_tsetse stuff is no longer needed.

@alexeagle alexeagle merged commit 2e128ce into bazel-contrib:master Jun 19, 2019
alexeagle pushed a commit that referenced this pull request Jun 19, 2019
...node_module_library transitive_declarations as the including /node_modules/typescript/lib/lib.*.d.ts is controlled by compilerOptions libs. Including all of the can cause typings conflicts.

Test coverage also added for this that verifies that typescript/lib/typescript.d.ts and typescript/lib/tsserverlibrary.d.ts are available since we must exclude other typescript/lib/ .d.ts files which are controlled by the compilerOptions.libs config. Also verify that libs not specified such as lib.webworkder.d.ts in compileOptions.libs config are not included in the compilation unit. See #875 for more details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants