Skip to content
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

Update: Document and Remove experimental mark from URLPopover "subcomponents" #16566

Conversation

jorgefilipecosta
Copy link
Member

Follow up on #15570.

I'm not sure if these components should be "inside" URLPopover as they may be used outside. But I don't know a better place for them.
Exposing the components inside wp.components... seems to pollute the number of components we offer. These components use other components, they are not very useful, and it is easy to get their behavior using different components. The main reason they were created was to avoid code repetition.
They make it more straightforward to get a URLPopover with some UI. Otherwise, for each block where we want to add href functionality, we will need to repeat this code all the time. The reason to have them inside URLPopover is that the use case we have in mind for them is as children of that component and they were only tested in that context they may or may not work correctly when the parent is different.

How has this been tested?

I verified the link functionality in the image block toolbar still works as expected.
I verified the link format in the paragraph block still works as expected.

Copy link
Contributor

@draganescu draganescu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this PR locally and the functionality is the same. Code wise it is an improvement and I see no issues.

@draganescu draganescu merged commit 442ff9d into master Jul 29, 2019
@draganescu
Copy link
Contributor

I have also merged this so that it is available in master, since the components can be useful in the incoming navigation menu block.

@github-actions github-actions bot added this to the Gutenberg 6.3 milestone Jul 29, 2019
@youknowriad youknowriad deleted the update/document-link-edit-components-and-remove-experimental-mark branch July 30, 2019 08:37
gziolo pushed a commit that referenced this pull request Aug 29, 2019
gziolo pushed a commit that referenced this pull request Aug 29, 2019
} from '@wordpress/components';
import { safeDecodeURI, filterURLForDisplay } from '@wordpress/url';

function LinkViewerUrl( { url, urlLabel, className } ) {
Copy link
Member

@aduth aduth Dec 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the file name, this probably should have been named LinkViewer. In any case, this specific naming doesn't adhere to capitalization guidelines, and it should at the very least be LinkViewerURL. Thankfully it doesn't seem to be part of the public API?

https://make.wordpress.org/core/handbook/best-practices/coding-standards/javascript/#abbreviations-and-acronyms

Edit: Oh, I see this file contains multiple components. In that case, I might have suggested each component get its own file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants