Add experimental util to allow fetch remote url data from REST API #31085
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 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? |
Mamaduka
left a comment
There was a problem hiding this comment.
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.titleproperty 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.jsfiles for terms that need renaming or removal).