-
Notifications
You must be signed in to change notification settings - Fork 350
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
Deprecate custom ID generation APIs from Wonder Blocks #2007
Conversation
Size Change: +457 B (+0.04%) Total Size: 1.27 MB
ℹ️ View Unchanged
|
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.
Approved! Added note, @somewhatabstract the console errors are refering to the use of SingleSelect on answer-choices.tsx
. Just update line 33 with opener: (openerProps: OpenerProps) => React.ReactElement<any>;
.
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (259fc2c) and published it to npm. You Example: yarn add @khanacademy/perseus@PR2007 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR2007 |
I fixed this with what I think is a better approach that matches the intent of the broken declaration. I used |
{ | ||
selector: | ||
"JSXElement[openingElement.name.name='UniqueIDProvider']", | ||
message: | ||
"DEPRECATED: Use the `Id` Wonder Blocks Core component instead, or migrate to the `useId` React hook.", | ||
}, | ||
{ | ||
selector: "JSXElement[openingElement.name.name='IDProvider']", | ||
message: | ||
"DEPRECATED: Use the `Id` Wonder Blocks Core component instead, or migrate to the `useId` React hook.", | ||
}, | ||
{ | ||
selector: "CallExpression[callee.name='useUniqueIdWithMock']", | ||
message: "DEPRECATED: Use the `useId` React hook instead.", | ||
}, | ||
{ | ||
selector: | ||
"CallExpression[callee.name='useUniqueIdWithoutMock']", | ||
message: "DEPRECATED: Use the `useId` React hook instead.", | ||
}, |
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.
note: These are to discourage new uses of the deprecated APIs.
## Summary: This is the last piece in the first batch of work. This migrates all Wonder Blocks components off our old ID providers and onto the new `Id` component. There are also some documentation tweaks to make the deprecation clearer in our stories, since that's some primary documentation for folks. With this PR, we can cut a release and then begin updating consumer repos accordingly. First, to include this update, then to migrate them off the old ways and onto the new. ### Release process: Once this small stack of PRs are landed and released, the following PRs need to be updated with that release, then landed/deployed: - Perseus: Khan/perseus#2007 - Webapp - Khan/webapp#28105 - Khan/webapp#28127 Issue: WB-1812 ## Test plan: `yarn test` `yarn typecheck` `yarn start:storybook` Author: somewhatabstract Reviewers: jandrade, somewhatabstract Required Reviewers: Approved By: jandrade Checks: ⌛ Lint / Lint (ubuntu-latest, 20.x), ⌛ Check build sizes (ubuntu-latest, 20.x), ⌛ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ⌛ Publish npm snapshot (ubuntu-latest, 20.x), ⌛ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ⏭️ Chromatic - Skip on Release PR (changesets), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ gerald, ⏭️ dependabot Pull Request URL: #2391
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @khanacademy/[email protected] ### Major Changes - [#2007](#2007) [`ea1bf0c2c`](ea1bf0c) Thanks [@somewhatabstract](https://github.com/somewhatabstract)! - Update to latest webapp dependencies and prepare for deprecation of custom WB ID generators ### Patch Changes - Updated dependencies \[[`ea1bf0c2c`](ea1bf0c)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Major Changes - [#2007](#2007) [`ea1bf0c2c`](ea1bf0c) Thanks [@somewhatabstract](https://github.com/somewhatabstract)! - Update to latest webapp dependencies and prepare for deprecation of custom WB ID generators ### Patch Changes - Updated dependencies \[[`ea1bf0c2c`](ea1bf0c)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Major Changes - [#2007](#2007) [`ea1bf0c2c`](ea1bf0c) Thanks [@somewhatabstract](https://github.com/somewhatabstract)! - Update to latest webapp dependencies and prepare for deprecation of custom WB ID generators ## @khanacademy/[email protected] ### Major Changes - [#2007](#2007) [`ea1bf0c2c`](ea1bf0c) Thanks [@somewhatabstract](https://github.com/somewhatabstract)! - Update to latest webapp dependencies and prepare for deprecation of custom WB ID generators ### Patch Changes - Updated dependencies \[[`ea1bf0c2c`](ea1bf0c)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`ea1bf0c2c`](ea1bf0c)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`ea1bf0c2c`](ea1bf0c)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`ea1bf0c2c`](ea1bf0c)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`ea1bf0c2c`](ea1bf0c)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`ea1bf0c2c`](ea1bf0c)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`ea1bf0c2c`](ea1bf0c)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Major Changes - [#2007](#2007) [`ea1bf0c2c`](ea1bf0c) Thanks [@somewhatabstract](https://github.com/somewhatabstract)! - Update to latest webapp dependencies and prepare for deprecation of custom WB ID generators ### Patch Changes - Updated dependencies \[[`ea1bf0c2c`](ea1bf0c)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected]
Summary:
Welcome to the Wonder Blocks 1812 Overture - a series of PRs that will deprecate and remove the custom ID generation utilities in favour of React's
useId
and the newId
component that is built atop of it.This updates dependencies in Perseus to latest webapp dependencies (used the sync script for that), and includes the soon to be released Wonder Blocks that deprecates the custom ID generation utilities in favour of React's
useId
and the newId
component that is built atop of it.An upcoming PR will then have the work of removing the old API uses so that we can then delete them from a future Wonder Blocks release.
NOTE: I will update this to the actual released WB before landing, once that happens. I am trying to get everything reviewed and ready to go so that when I do that release, I can get everything up-to-date quickly and correctly.
Issue: WB-1812
Test plan:
yarn test
yarn lint