Skip to content

Commit

Permalink
Types: Hide element, primitives, icons declarations (#21613)
Browse files Browse the repository at this point in the history
Unpublish @wordpress/element, @wordpress/primitives, and @wordpress/icons types

Remove types from pacakge.json to hide the included types. This was
reported to cause conflicts with the current 3rd party typings published
on DefinitelyTyped (DT).

The cause has been identified as:
- DT exports all React typings, which other DT typings depend on.
- Included typings use type aliases (Element -> WPElement) which may
  cause additional conflicts.

See https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/wordpress__element/index.d.ts
See https://unpkg.com/browse/@wordpress/[email protected]/build-types/react.d.ts

Reported via core-js slack:

https://wordpress.slack.com/archives/C5UNMSU4R/p1586955177257000

* Add CHANGELOG

* Remove primitives, icons types
  • Loading branch information
sirreal committed Apr 15, 2020
1 parent e3818fb commit c2684b2
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 8 deletions.
9 changes: 9 additions & 0 deletions packages/element/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
## Master

### Bug Fix

- Hide TypeScript type declarations ([#21613](https://github.com/WordPress/gutenberg/pull/21613))
after they were found to conflict with DefinitelyTyped provided declarations.

## 2.13.0 (2020-04-15)

### New Features

- Include TypeScript type declarations ([#21248](https://github.com/WordPress/gutenberg/pull/21248))
- Graduated `__experimentalCreateInterpolateElement` function to stable api: `createInterpolateElement` (see [20699](https://github.com/WordPress/gutenberg/pull/20699))

Expand Down
1 change: 0 additions & 1 deletion packages/element/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"main": "build/index.js",
"module": "build-module/index.js",
"react-native": "src/index",
"types": "build-types",
"sideEffects": false,
"dependencies": {
"@babel/runtime": "^7.9.2",
Expand Down
9 changes: 8 additions & 1 deletion packages/icons/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
## Master

Include TypeScript type declarations ([#21487](https://github.com/WordPress/gutenberg/pull/21487))
### Bug Fix

- Hide TypeScript type declarations ([#21613](https://github.com/WordPress/gutenberg/pull/21613))
after they were found to conflict with DefinitelyTyped provided declarations.

## 1.3.0 (2020-04-15)

- Include TypeScript type declarations ([#21487](https://github.com/WordPress/gutenberg/pull/21487))

## 1.0.0 (2020-02-04)

Expand Down
1 change: 0 additions & 1 deletion packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"main": "build/index.js",
"module": "build-module/index.js",
"react-native": "src/index",
"types": "build-types",
"dependencies": {
"@babel/runtime": "^7.9.2",
"@wordpress/element": "../element",
Expand Down
9 changes: 8 additions & 1 deletion packages/primitives/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
## Master

Include TypeScript type declarations ([#21482](https://github.com/WordPress/gutenberg/pull/21482))
### Bug Fix

- Hide TypeScript type declarations ([#21613](https://github.com/WordPress/gutenberg/pull/21613))
after they were found to conflict with DefinitelyTyped provided declarations.

## 1.3.0 (2020-04-15)

- Include TypeScript type declarations ([#21482](https://github.com/WordPress/gutenberg/pull/21482))

## 1.0.0

Expand Down
1 change: 0 additions & 1 deletion packages/primitives/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"module": "build-module/index.js",
"react-native": "src/index",
"sideEffects": false,
"types": "build-types",
"dependencies": {
"@babel/runtime": "^7.9.2",
"@wordpress/element": "file:../element",
Expand Down
9 changes: 6 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@
{ "path": "packages/autop" },
{ "path": "packages/blob" },
{ "path": "packages/block-editor" },
{ "path": "packages/element" },
{ "path": "packages/dom-ready" },
{ "path": "packages/escape-html" },
{ "path": "packages/html-entities" },
{ "path": "packages/i18n" },
{ "path": "packages/icons" },
{ "path": "packages/is-shallow-equal" },
{ "path": "packages/prettier-config" },
{ "path": "packages/primitives" },
{ "path": "packages/priority-queue" },
{ "path": "packages/project-management-automation" },
{ "path": "packages/token-list" },
{ "path": "packages/url" },
{ "path": "packages/warning" }

// Temporarily disabled due to conflicts with 3rd party DefinitelyTyped types
// See https://github.com/WordPress/gutenberg/pull/21613
// { "path": "packages/element" },
// { "path": "packages/icons" },
// { "path": "packages/primitives" }
],
"files": []
}

0 comments on commit c2684b2

Please sign in to comment.