-
Notifications
You must be signed in to change notification settings - Fork 799
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
Upgrade Nudge: Add generic lib, style properly #13074
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
This is an automated check which relies on |
ockham, Your synced wpcom patch D30523-code has been updated. |
3 similar comments
ockham, Your synced wpcom patch D30523-code has been updated. |
ockham, Your synced wpcom patch D30523-code has been updated. |
ockham, Your synced wpcom patch D30523-code has been updated. |
4183a40
to
e9ae350
Compare
I'm going to abandon this since it's kinda untenable:
Working on #13070 instead. |
|
||
// TODO: Make button work | ||
|
||
return <<<EOF |
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.
You might be saved from the rabbit hole by abandoning the goal of getting the same markup and shared CSS from the editor to work in the frontend, reasons I'm suggesting that are:
- it's a complex process that isn't likely utilized elsewhere than these nudges
- CSS and
editor-warning
is heavily geared towards working in a block-editor context; it would be very easy to miss this frontend nudge breaking because of changes in upgrade nudge made for the editor or worse, changes in Gutenberg itself. - You'd have to enqueue all
wp-block-editor
/wp-editor
/wp-components
/wp-editor-font
(ref) styles which is a lot of CSS and none of it is scoped (things like.components-button
or.DayPicker
)
Since this upgrade nudge isn't probably seen very often (primary way of seeing the nudge would be in the editor), I'd suggest sticking to something simple and straightforward (HTML markup wise), similar to what current simple payments already has.
There are tons of good reasons to stick to one source of truth tho and those might very well outweigh risks. What do you think?
This same convo might've already happened somewhere else, I'm only catching up. ;-)
Fixes #13040
Changes proposed in this Pull Request:
Move the existing frontend upgrade nudge from the Simple Payments module into a shared library, parametrize it for use with other blocks, and style it akin to its editor (JS) counterpart .
Is this a new feature or does it add/remove features to an existing part of Jetpack?
Testing instructions:
TBD
Proposed changelog entry for your changes:
TBD
(Test both the block and the widget!)
TODO
Warning
component styling from@wordpress/block-editor
.UpgradeNudge
specific CSS file (rather than piggy-backing on the view-side mechanism forSimplePayments
), and enqueue it from_lib/inc/upgrade-nudge.php
)