-
Notifications
You must be signed in to change notification settings - Fork 429
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
fix(core): explicitly pass randomKey(12)
as the PTE keyGenerator
#7759
Conversation
In an effort to make `@portabletext/editor` become more stand-alone, I'm looking into removing the few `@sanity/*` dependencies that it has. Here, `@sanity/util` is a low-hanging fruit. If the `keyGenerator` prop isn't passed, the `PortableTextEditor` will use `randomKey(12)` from `@sanity/util`. However, passing this key generator explicitly from the `PortableTextInput` removes this implicit dependency. Now, the Studio keeps getting the same type of random keys and `@portabletext/editor` is free to remove the `@sanity/util` dependency and just copy/paste the source code of `randomKey` or use another default key generator.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
No changes to documentation |
Component Testing Report Updated Nov 5, 2024 2:30 PM (UTC) ✅ All Tests Passed -- expand for details
|
⚡️ Editor Performance ReportUpdated Tue, 05 Nov 2024 14:32:36 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
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.
Nice, LGTM
In an effort to make
@portabletext/editor
become more stand-alone, I'm looking into removing the few@sanity/*
dependencies that it has. Here,@sanity/util
is a low-hanging fruit.If the
keyGenerator
prop isn't passed, thePortableTextEditor
will userandomKey(12)
from@sanity/util
. However, passing this key generator explictly from thePortableTextInput
removes this implicit dependency. Now, the Studio keeps getting the same type of random keys and@portabletext/editor
is free to remove the@sanity/util
dependency and just copy/paste the source code ofrandomKey
or use another default key generator.