-
Notifications
You must be signed in to change notification settings - Fork 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
New Page Layout Picker: rename "templates" to "page patterns" #50971
Conversation
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
Cool! Taking a quick look at the build log for ETK, I see the changed files look pretty safe: (Link to the lines in the build output) It looks like from the perspective of the build artifact, only one JS file has changed, and that wouldn't be an asset file anyways, so it should be safe to go |
1142f0d
to
6af8bb9
Compare
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.
Tested this and it all LGTM 👍
I think it would also make sense to update the naming in the starter-page-templates subproject of the ETK in this PR, we still use templates
in there.
But that's up to you
🚢 once the modal itself is deployed and rebased ✅
Thanks @roo2 👍
Definitely want to rename this, but we're just going to have to have a think how to do this with the new deployment process. We'll need to have one PR that adds a copy of the files with a new name, and then another PR that removes the old files. And perhaps temporarily the JS will need to be able to deal with either |
995dd93
to
3188a55
Compare
facd793
to
767c14a
Compare
377b80c
to
41ee893
Compare
767c14a
to
5392c8b
Compare
I believe e2e tests are failing because the I've changed some test selectors to use the new classname. However because this is a change to the ETK build, the calypso e2e tests are still being run against the production version of ETK. This should be fixed once this PR merges and the new ETK build is released. |
41ee893
to
cbc4c26
Compare
5392c8b
to
0f3d163
Compare
import React, { useCallback } from '@wordpress/element'; | ||
|
||
const INSERTING_HOOK_NAME = 'isInsertingPageTemplate'; | ||
const INSERTING_HOOK_NAMESPACE = 'automattic/full-site-editing/inserting-template'; | ||
const INSERTING_HOOK_NAME = 'isInsertingPagePattern'; |
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.
👋🏼 Wanted to let you know that this rename broke the from_template_selector
property in our tracking events. PR, for more context: #53640
I humbly recommend a more thorough code search in the future to catch any consumers of the existing hook 🙂
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.
Sorry about that! I did search for usage but clearly I wasn't thorough enough (I don't know how I missed it given the usage in wpcom-block-editor
is in the same repo 🤦♂️). Losing 3 months worth of that prop is frustrating.
Changes proposed in this Pull Request
Initially proposed here (#49661 (review)) when we refactored the modal into it's own package. The word "template" has become very overloaded. The things chosen by the new page modal are really more like "patterns" (i.e. the pattern inserter in core Gutenberg), except they're for a whole page. Hence "Page Patterns".
I also considered calling the package
@automattic/new-page-modal
, since it's the modal that appears when creating a new page. But that's just what we happen to use it for now. Since it's a package it could be used anywhere one needed to select a page pattern.FYI @noahtallen
Testing instructions
starterPageTemplatesConfig
global) and that it won't cause fatals when deployingRelated to #50363