-
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
NPS v2: Add the skeleton of the marketing package, including the empty NPS component #95046
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
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. |
marketing package.
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.
Looks great! Left some comments, but not sure if anything critical.
{ | ||
"name": "@automattic/marketing", | ||
"version": "1.0.0", | ||
"description": "The package where the marketing components related to Automattic products are located.", |
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.
I like this, overall. It means we can add stuff from JP/eslsewhere here too.
However, if that's not the intention - then it could also be @automattic/wpcom-marketting
for consideration.
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.
Have we considered adding a nps
slice to @automattic/data-stores
? It has pros & cons. I think it's tempting as a model of separation, so we keep all data-related stuff under there. It might be easier that way to focus on updates, keeping things consistent with other related data hooks, etc. But I can see how living here makes sense.
On a scale from 0–10, how likely are you to recommend WordPress.com to a friend or | ||
colleague? | ||
</legend> | ||
<div className="nps-scale"> |
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.
For classnames we should probably follow some convention to avoid clashes. Something like [name of package]-[name of component]__[...]
. So for this, maybe marketting-nps__scale
?
Which brings up the question whether marketting
might be too generic (or not)
colleague? | ||
</legend> | ||
<div className="nps-scale"> | ||
<span className="label-left">Not likely</span> |
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.
Similarly. Could be marketting-nps__scale-label-left
, etc.
); | ||
} | ||
|
||
export function Nps() { |
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.
Once we get a fully working version, we can keep this as the plain/view only component (that we can also build Stories for), and ship the wrapper as Nps that would also include the handlers for showing/not showing, mutating, etc.
import { useMutation } from '@tanstack/react-query'; | ||
import wpcomRequest from 'wpcom-proxy-request'; |
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.
We are missing these dependencies in package.json
🤔
This PR is now paused for further assessment of the overall project: p5uIfZ-g9B-p2#comment-24070 . |
Closing it since there isn't any sign that the work will be picked up again in the near future. |
Related to #94874
Proposed Changes
This PR establishes the foundational package structure of the
marketing
package with NPS v2 as the first component within it. Following the discussions in #94874, this PR attempts the direction of an isolated package with all the NPS v2 related components and data-related hooks consolidated inside.src/nps
.queries
andmutations
. The unit tests are located in the respected__tests__
directories, following the currentjest.config
setting.Why are these changes being made?
It's the foundation of the NPS v2 project.
Testing Instructions
yarn run test-packages -- marketing
should run the newly added two tests here and they should pass.yarn run @automattic/marketing storybook
should run the storybook instance. Note that the NPS component is meant to be rough for now:Pre-merge Checklist