Skip to content
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

Core Data: Import types before exporting them #39479

Merged
merged 1 commit into from
Mar 16, 2022

Conversation

dmsnell
Copy link
Member

@dmsnell dmsnell commented Mar 15, 2022

Description

Part of #39211

Previously we've been exporting the Context and Updatable types
from a helper module and also using those types in the same file.
This represents a type violation since we're not importing those
types into the module's namespace.

In this patch we're also importing them before re-exporting them
so that the names are available as we expect.

Testing Instructions

This is a type-only change and should have no impact on the output code bundles.

Please audit the change and verify that the types are accurate.

@dmsnell dmsnell requested a review from nerrad as a code owner March 15, 2022 22:55
@adamziel
Copy link
Contributor

TIL, good spot

Previously we've been exporting the `Context` and `Updatable` types
from a helper module and also using those types in the same file.
This represents a type violation since we're not importing those
types into the module's namespace.

In this patch we're also importing them before re-exporting them
so that the names are available as we expect.
@adamziel adamziel force-pushed the types/core-data-import-exports-first branch from 8f95063 to 8f6a519 Compare March 16, 2022 10:40
@adamziel
Copy link
Contributor

The e2e tests seem to be broken globally at the moment

@adamziel adamziel merged commit 270320f into trunk Mar 16, 2022
@adamziel adamziel deleted the types/core-data-import-exports-first branch March 16, 2022 11:12
@github-actions github-actions bot added this to the Gutenberg 12.9 milestone Mar 16, 2022
dmsnell added a commit that referenced this pull request Mar 31, 2022
In this commit we're cleaning up type issues in the core-data package
that prevent us from telling TypeScript to run on the package and all
of its existing code, even the JS files.

After these changes we should be able to do so and start converting
more modules to TypeScript with less friction.

This patch follows a series of other smaller updates:
 - #39212
 - #39214
 - #39225
 - #39476
 - #39477
 - #39479
 - #39480
 - #39525
 - #39526
 - #39655
 - #39656
 - #39659

It was built in order to support ongoing work to add types to the
`getEntityRecord` family of functions in #39025.
dmsnell added a commit that referenced this pull request Apr 1, 2022
In this commit we're cleaning up type issues in the core-data package
that prevent us from telling TypeScript to run on the package and all
of its existing code, even the JS files.

After these changes we should be able to do so and start converting
more modules to TypeScript with less friction.

This patch follows a series of other smaller updates:
 - #39212
 - #39214
 - #39225
 - #39476
 - #39477
 - #39479
 - #39480
 - #39525
 - #39526
 - #39655
 - #39656
 - #39659

It was built in order to support ongoing work to add types to the
`getEntityRecord` family of functions in #39025.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants