preferences: Convert the package to TypeScript#71915
preferences: Convert the package to TypeScript#71915manzoorwanijk merged 20 commits intoWordPress:trunkfrom
Conversation
…g issues in @wordpress/preferences
|
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. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @joshualip-plaudit! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
|
I don't know how to add the "props-bot" label, but I linked my account |
|
So... Tests failed because they timed out while downloading themes. How do I go about restarting them? |
manzoorwanijk
left a comment
There was a problem hiding this comment.
Thank you for working on this. I have some suggestions for further improvements and some ideas about preserving git history for some files.
packages/preferences/src/components/preference-base-option/index.tsx
Outdated
Show resolved
Hide resolved
packages/preferences/src/components/preferences-modal/index.tsx
Outdated
Show resolved
Hide resolved
packages/preferences/src/components/preferences-modal-section/index.tsx
Outdated
Show resolved
Hide resolved
packages/preferences/src/components/preferences-modal-tabs/index.tsx
Outdated
Show resolved
Hide resolved
packages/preferences/src/components/preferences-modal-tabs/index.tsx
Outdated
Show resolved
Hide resolved
packages/preferences/src/components/preferences-modal-tabs/index.tsx
Outdated
Show resolved
Hide resolved
packages/preferences/src/components/preferences-modal/index.tsx
Outdated
Show resolved
Hide resolved
|
@manzoorwanijk I'll make the changes that you requested to try to fix the git history later today (although, I don't know if that's going to be recoverable without me remaking the branch + changes from scratch). Wrt to the "replace react imports with Update: Fixing the history loss is done. I wound up recreating the branch and separating the rename and edit steps for the files that had issues into two commits |
2f25917 to
c81c5fa
Compare
|
@manzoorwanijk Ping on this one? I'm unsure what you mean by, "move this to an inline types.ts file". I was able to resolve the history issue without relying on an external file, so I don't think it's needed anymore. Also, I am still curious why using |
Since |
|
Thanks for the clarification! I've made the requested changes. |
packages/preferences/src/components/preference-base-option/types.ts
Outdated
Show resolved
Hide resolved
manzoorwanijk
left a comment
There was a problem hiding this comment.
This looks good. I just have a couple of questions about maybe not enforcing certain things.
packages/preferences/src/components/preference-base-option/types.ts
Outdated
Show resolved
Hide resolved
packages/preferences/src/components/preferences-modal-section/index.tsx
Outdated
Show resolved
Hide resolved
|
Nice, this will make #64799 obsolete |
manzoorwanijk
left a comment
There was a problem hiding this comment.
This looks good to ship now. Let us update it from trunk and fix the merge conflicts.
manzoorwanijk
left a comment
There was a problem hiding this comment.
Let us ship it. Thank you for your contribution.
What?
Closes #71913
This is a direct conversion of the Preferences package to TypeScript. None of the functionality has been modified - it just emits typedefs now.
Why?
I want to be able to convert the Block Editor package to TypeScript. The Preferences package is one that it depends on, so it seemed like a good place to start.
How?
I made a direct conversion of the package to TypeScript. This boiled down to swapping out the extensions and some minor tweaks to the typedefs.
I did also have to make a minor modification to the Components package (the CardHeader component was missing some props)
Testing Instructions
Everything should be covered by existing build-time tests.