-
Notifications
You must be signed in to change notification settings - Fork 49
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
newspack-components library #72
Conversation
The issue here lies in the distinction of bundling vs transpilation. Webpack bundles (app) code for use in the browser, i.e. essentially turns npm packages, by, definition (being Node modules) aren't bundled. They are however expected to be in CommonJS format. This means that |
On a higher level: Great to see an initiative to share components for re-use! As it happens, we've been working on a similar initiative in Calypso (Automattic/wp-calypso#32869, Automattic/wp-calypso#33154). In order to avoid the proverbial 15 standards situation, I think it'd be great to coordinate. After all, we'd want one canonical source of truth for shared components across Automattic. Maybe we can schedule a Zoom call for stakeholders some time soon? Looping in @Automattic/team-calypso 🙂 |
@ockham I'd love to be part of that call. /cc @griffbrad |
I've got things sorted and updated the instructions at the top of the PR. Let's definitely coordinate around components packaging with the Calypso team, as there is definitely some duplicated work we can try and avoid (e.g. we also have a ProgressBar component in this package and a Checklist component, and they look like the Calypso ones). |
Awesome work Claudiu! Thank you for working on this. I was able to get this successfully running in our new onboarding work. I only had one issue, with the I had to make sure the following like the following was in our
|
I've noticed a few behaviors with the components that differ from what I see in the Figma Component file. Let me know if you want me to help tackle these. For inputs, the label should still be displayed when active: I also noticed that the active class does not get applied if the input is empty. That means the input looks unfocused even though it is. There should be some kind of active but empty state. I also noticed that if you tab/keyboard navigate into the inputs, the active class is not appended, even if you begin typing. |
@justinshreve I've created an issue for what you reported at #75 . If you want to tackle it, that would be super helpful (just assign yourself to the issue), otherwise we'll get it handled soon. Good catch and thanks! |
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.
The double "src" in the new path structure seems confusing. Could we refactor the components to live in assets/components/src
instead of assets/src/components/src
? We could also relocate wizards
and shared
to be siblings of components
.
I've done the requested folder restructuring in 9305614. This should make things cleaner. I'm going to do some research around the best package name for this, then it should be good to merge. |
Let's keep the current published name ( |
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.
OK, agreed about the package name, and possible plan to unpublish. Perhaps we should add a line to the README to indicate that this is not a stable release and is subject to change at any time, just in case someone we don't know installs and uses the package?
Added disclaimer to readme. 👍 |
This PR sets up the ability to publish our components to npm as a stand-alone package. This work is largely based on the two Calypso PRs linked below. Thanks to @ockham for pointing me in the right direction!
To test
cd assets/src/components; npm install;
.npm publish --dry-run
to see what would be published.You should see something like this: