-
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
Media Utils: Add TypeScript support and export more utils #64784
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. |
Size Change: +275 B (+0.02%) Total Size: 1.78 MB
ℹ️ View Unchanged
|
957d50a
to
db379b4
Compare
db379b4
to
1b70586
Compare
1b70586
to
6a73fa4
Compare
Flaky tests detected in 602a0b2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10644454071
|
I see that the README file doesn't contain auto-generated documentation for the public API. I'm wondering if we should put
to test out how it all plays out together? It would also be easier to review if it existed before, as we would see the difference unless everything was undocumented ... |
Just added the auto-generated API reference to the readme. Your observation is correct. React components are not part of the generated API reference. And TypeScript types are also not properly detected by that tool, so it says "Undocumented declaration." |
media-utils
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.
This looks good to me, great work! I've left just a few small comments, with the private vs public
exports the most important one.
Co-authored-by: Nik Tsekouras <ntsekouras@outlook.com>
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.
Great work @swissspidy, thanks for adding all the tests!
Would be nice if we can document all the newly exported utilities.
I've also left a few drive-by questions, let me know what you think.
@jsnajdr could potentially be interested to review the types.
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.
LGTM, thank you!
What?
See #61447 for full context.
Split out from #64278, this converts the
media-utils
package to TypeScript and simultaneously exports more of the utils for consumers to use.Why?
With client-side media processing, there is a need to validate files twice: once before they're processed in the browser, and once before upload. This is only possible if
media-utils
utils are exported so theblock-editor
package can use them.How?
Very simple, introduces TypeScript to this package and adds more exports.
Testing Instructions
Tests should pass
Testing Instructions for Keyboard
N/A
Screenshots or screencast
N/A