-
Notifications
You must be signed in to change notification settings - Fork 4.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
Types: Rename icons, primitives tsconfig to _tsconfig #21784
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
[#21613](#21613) "hid" TypeScript emitted type declarations for `@wordpress/element` when it was found to conflict with 3rd party type declarations on DefinitelyTyped. Disabling `@wordpress/element` cascaded to require disabling type checking for `@wordpress/icons` and `@wordpress/primitives`, two dependent packages. The lint-staged flow is slightly different from the full `build:package-types` script in that it attempts to do a minimal build in the interest of speed. This flow checks for the presence of a `tsconfig.json` file in the root of the package with changes and runs its package build. While removing the affected packages from the main tsconfig.json did remove them from the primary build, changes to primitives and icons packages will fail because they cannot find the `@wordpress/element` types as was intended in #21613. By renaming the package tsconfig.json files, they are excluded from the lint-staged typechecking as well.
1 task
Size Change: 0 B Total Size: 842 kB ℹ️ View Unchanged
|
gziolo
approved these changes
Apr 22, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I trust you and leave the rest to Travis :)
sirreal
added a commit
that referenced
this pull request
Apr 28, 2020
* Restore element, icons, primitives types * Partially reverts #21613 (c2684b2) * Reverts #21784 (74fcd4c) Some `@wordpress/*` emit TypeScript type declarations and include them with the published packages. Shortly after publishing, it was discovered the `@wordpress/element` conflicted with the DefinitelyTyped 3rd party type declarations of several packages and a patch release was published removing the published types from `@wordpress/element`, `@wordpress/primitives`, and `@wordpress/icons` (#21613, #21784). The DefinitelyTyped type declarations have been updated to remove conflicts with the included `@wordpress/element` types. The types can be published again. See #21767 for more details.
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.
This was an oversight that should have been part of #21613 to
prevent errors when typechecking via lint-staged.
Description
#21613 "hid" TypeScript emitted type declarations for
@wordpress/element
when it was found to conflict with 3rd party type declarations on DefinitelyTyped.Disabling
@wordpress/element
cascaded to require disabling type checking for@wordpress/icons
and@wordpress/primitives
, two dependent packages that have opted-in to typechecking.The lint-staged flow is slightly different from the full
build:package-types
script in that it attempts to do a minimal build in the interest of speed. This flow checks for the presence of atsconfig.json
file in the root of the package with changes and runs its package build.While removing the affected packages from the main tsconfig.json did remove them from the primary build, changes to primitives and icons packages will fail because they cannot find the
@wordpress/element
types as was intended in #21613.By renaming the package tsconfig.json files, they are excluded from the lint-staged typechecking as well.
Testing
Make any small change in
primitives
oricons
packages (JavaScript source files).When you commit, the lint-staged check will run, without an error.
element
does not need to be disabled because it does not need to read its own types. Changes to element should continue to typecheck on lint-staged.