-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Real-time collaboration: Add typings in core-data for @wordpress__blocks
#72450
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
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Flaky tests detected in e9231c9. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18599600115
|
ramonjd
left a comment
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.
aaronjorbin
left a comment
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.
Tested and fixes the issue with having GB in a wordpress-develop checkout for me, but I'll defer the final decision on merging to someone who has a sense of if this is the correct direction
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.
Working for me also
Just wondering why
| // @ts-expect-error No exported types. |
Is passing though
|
The way we incrementally type packages in Gutenberg so far is not by defining .d.ts files, instead we prefer to rename the files to |
@youknowriad can you show me an example of a package that is already doing this? I think that the work that has to be done for this to pass in the blocks package is pretty big. There are a ton of files ignoring non-typed elements from blocks. (I've counted 10, including the one in this PR). And I will say that more than half, if not all, Meanwhile, this obviously is a hacky way to go through this process, but I wonder if having this in place could hinder the future conversion to TS of the |
|
The editor package is doing this. Here's the config. The blocks package is a fundamental one and a migration to TS would bring a lot of benefits IMO. That said, I agree it's a bit of a challenge but that might be an opportunity to start thinking about it. |
Oh, I thought you meant that it was possible to migrate one TS at a time. But with this method, it's all or none, right? |
No, it's one at a time, only |
I was just wondering why they did this #48604 then... It's seriously disgusting to review knowing that one file can be incremental at a time, much easier to review, I'm wondering if we could split that PR and make it happen (plus now 5 hunks are failing to apply). Also, with this in the works, pretty much we can close this one. |


See WordPress/wordpress-develop#10282
See WordPress/wordpress-develop#10283
What?
Add typings in
core-datafor@wordpress__blocks.Why?
These hard-coded typings avoid the use of
@ts-expect-error, which generates a TypeScript error in build environments where typings for@wordpress/blocksmight be incidentally available or inferred. One prominent example is when Gutenberg is built insidewordpress-develop(example build log).How?
@wordpress/blocksinside ofpackages/core-data.tsconfig.json.Once
@wordpress/blocksdefines and provides its own types, this change can be reverted.Testing Instructions
Testing Instructions for Keyboard
n/a