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

Audit experimental features in WordPress Components Gallery #46496

Closed
10 tasks
WunderBart opened this issue Oct 15, 2020 · 9 comments
Closed
10 tasks

Audit experimental features in WordPress Components Gallery #46496

WunderBart opened this issue Oct 15, 2020 · 9 comments
Assignees
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Type] Task

Comments

@WunderBart
Copy link
Member

WunderBart commented Oct 15, 2020

Master tracking issue: #44251

WordPress Components Gallery is dependant on experimental features without a fallback for a scenario where such a feature is not supported anymore. Below is a list of usages that we need to update in this matter:

@WunderBart WunderBart changed the title Audit experimental features in alignment-matrix-control.tsx Audit experimental features in wordpress-components-gallery Oct 15, 2020
@WunderBart WunderBart changed the title Audit experimental features in wordpress-components-gallery Audit experimental features in WordPress Components Gallery Oct 15, 2020
@WunderBart WunderBart added the [Goal] Gutenberg Working towards full integration with Gutenberg label Oct 15, 2020
@WunderBart
Copy link
Member Author

@Automattic/team-calypso is this something that you could look into?

@sarayourfriend
Copy link
Contributor

@diegohaz I wonder if you have any insight into the best way to deal with experimental features? Would it be wiser to just not use them at all in this setting or is there a safe way to use them? I'm not familiar with how to do "safe" imports or anything like that.

@diegohaz
Copy link
Contributor

diegohaz commented Oct 15, 2020

@saramarcondes

If it's just for internal usage and we're okay with things unexpectedly breaking, I think it's not a big problem. But, ideally, we shouldn't depend on experimental features.

The problem is that code will eventually break:

The conversion to a stable API will inherently be considered a breaking change by the mere fact that the function name must be changed to remove the __experimental prefix.

source

If we use experimental features, we should set fixed versions in our package.json (which is currently not the case).

For reference, this has already been a problem because Gutenberg was depending on experimental features of Reakit without fixing the dependency version: ariakit/ariakit#667 (comment). Reakit has a dedicated section about this that would also apply to @wordpress/components usage: https://reakit.io/docs/experimental/

@sarayourfriend
Copy link
Contributor

That's helpful @diegohaz, thank you. I think it's safe for things to break in the components gallery world... however I'm wary of adding another potentially roadblock to upgrading the WordPress dependencies (as today it's already a hassle). I wonder if we should remove these afterall?

This PR #46424 does depend on an experimental feature... in fact I don't believe there's any other component that could be used there. Luckily I believe we can switch it to just use a regular input because it is ultimately de-styled by the Search component's styles.

@griffbrad
Copy link
Contributor

I'd recommend doing a pass through the list that @WunderBart provided and asking whether each one provides value in regards to the broader style compatibility efforts for @wordpress/components in Calypso. For example, I feel totally fine dropping AlignmentMatrixControl out of the gallery. It's a newer component used in particular blocks that is styled with CSS-in-JS, so it's not really important to monitor as we remove global styles from Calypso. ToolbarItem, on the other hand, can be used in many core blocks (wherever a straightforward ToolbarButton isn't appropriate) and may be used elsewhere in Calypso.
I'd err on the side of removing the experimental usages to ease future upgrades, like you suggested. Worst-case, though, it's good to keep in mind that removing the usage in the context of the gallery is always pretty trivial. We're not talking about a component really being used for actual functionality.

@tyxla
Copy link
Member

tyxla commented Oct 16, 2020

I agree we can drop some of the experimental components out - some of them may never end up being stable ones, and if they end up stable, we can always include them back.

It's worth keeping an eye on the WordPress components gallery every now and then, as the list of experimental components will always change with every new release.

That being said, it's also worth keeping an open mind that the gallery is far from being a widely used tool at this point, but that is going to start changing as we continue adopting @wordpress/components more and more in Calypso.

@WunderBart
Copy link
Member Author

Worth keeping an eye on this one in case you've missed it: WordPress/gutenberg#25786

@diegohaz
Copy link
Contributor

ToolbarItem, on the other hand, can be used in many core blocks (wherever a straightforward ToolbarButton isn't appropriate) and may be used elsewhere in Calypso.

ToolbarItem is an example of a component that dropped the __experimental flag. So this will break when upgrading @wordpress/components.

@sirreal
Copy link
Member

sirreal commented Nov 27, 2020

Closing this as of #47712 / p4TIVU-9xW-p2

@sirreal sirreal closed this as completed Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Type] Task
Projects
None yet
Development

No branches or pull requests

7 participants