-
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
Add experimental util to allow fetch remote url data from REST API #31085
Conversation
Size Change: +103 B (0%) Total Size: 1.47 MB
ℹ️ View Unchanged
|
Should this be a part of fetch links suggestions somehow? I am not sure it should be something more than an internal API. |
@draganescu I'm not sure it can be. The link suggestions is for searching for WP entities whereas we need to use this new REST API endpoint on direct entries (specifically URLs such as Here's the code path gutenberg/packages/block-editor/src/components/link-control/use-search-handler.js Lines 125 to 136 in 47f1147
As you can see we branch off depending on whether the entry is URL-like. It's only in the I guess we could introduce a completely new fork into the Perhaps I missed something? How did you see this working? |
@draganescu In the interests of moving forward could we merge this as experimental? We can always remove or refactor later. What's the etiquette here? |
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.
I think this works well and can be stabilized once the URL Details API endpoint is stable. Probably after #28791.
I've not reviewed experimental APIs before, but this matches description provided in Coding Guidelines.
Description
Since #18042 we've had a way to retrieve some data about a remote URL (currently just title but more is coming).
We'd like to start making use of this in the editor - specifically within the link UI to provide "rich" preview/details about external URLs.
This PR is the first step which adds the ability to call the REST API via
@worpress/core-data
.How has this been tested?
npm run dev
.Enter
.title
property which matches the contents of the<title>
tag onwww.wordpress.org
.Screenshots
Types of changes
New feature (non-breaking change which adds functionality)
Checklist:
*.native.js
files for terms that need renaming or removal).