-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Experiments: sharing private APIs with lock() and unlock() #46131
Merged
Merged
Changes from 19 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
982b862
Experiments: pivot towards lock()/unlock() based API
adamziel bb2e1e0
Rename lazyDecorator to onFirstUnlock and use it to process even the …
adamziel 48fd5a4
Document the new API
adamziel 65750cf
Add unit tests to demonstrate how to export private functions, functi…
adamziel 12bbcb6
Explain how to avoid new experimental APIs in coding-guidelines.md
adamziel 2a706c3
Editorial updates to the documentation
adamziel 3efd500
Editorial updates to coding guidelines
adamziel 435ea50
Do not export isExperimentsConfig from the experiments package
adamziel 75ec4fd
Clarify the deprecation process does not always span multiple WP
adamziel 7f1b499
Private experimental cross-module selectors and actions (#44521)
adamziel 6933b2a
Roll back the demo changes to blocks/ and block-editor/ packages
adamziel f8e199f
Update the coding guidelines to reflect registerPrivateActionsAndSele…
adamziel cb11084
Lint
adamziel 8b5103c
Use consistent method names in docstring examples
adamziel 00a07b8
Rebuild docs
adamziel ce9d2a2
Remove the configureLockTarget utility
adamziel 9a01309
Update packages/experiments/README.md
adamziel 22369b7
Lint
adamziel eaff546
Fix typo in coding-guidelines.md
adamziel 41582b7
Update packages/experiments/src/implementation.js
adamziel c0ebbf8
Update packages/experiments/src/implementation.js
adamziel 583fd45
Clarify the meaning of the second argument to __dangerousOptInToUnsta…
adamziel 954b353
Assert that the public selector and actions still exist on the object…
adamziel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It took me a long long time to realise that this is supposed to be the name of the package calling
__dangerousOptInToUnstableAPIsOnlyForCoreModules
, not the name of the package whose APIs you want to access.I wonder if there's a way to get the package name from an environment variable or something so that it's clearer.
Probably not. Just noting my confusion nonetheless.
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.
Good note! I just updated the docs to clarify that.
As for the automation – both arguments could probably be injected by a custom babel plugin. Brownie points – it would obscure the correct usage even further for extenders trying to reverse-engineer it without consulting the docs. Would you be game for exploring it?