-
Notifications
You must be signed in to change notification settings - Fork 487
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
feat(@clayui/core): Add Provider
component and the new @clayui/core
package
#4162
Conversation
… package This commit adds the initial implementation of the `@clayui/core` package which will aggregate all Clay components during the next releases of v3, and v4 we will be stopping publishing packages separately if the separate packages still have a lot of value, we will discuss further. When exporting components, we are adopting semantics without adding the Clay prefix to the component names so that the library can be more harmonious within an application and eliminate noise in the JSX markup views. We are also adding the new `Provider` component which aggregates the main Clay, Icon, and Modal Contexts but we have not added Link and Tooltip contexts because both are commonly used in certain parts of the application structure, the Tooltip is used as a Global component in DXP, so we're discarding here to avoid conflicts.
@matuzalemsteles just a question, isn't it a bit early to talk about v4? |
Hey @julien I think we've been talking about the next major version for some time in some issues and PRs, we're accumulating changes for the next major version, see the It's also natural to think about the next major version, v3 was released almost 2 years ago, so we wanted to maybe shorten those major versions to enable us to ship more changes and refinements and new improvements of things that didn't work out earlier, instead of accumulating a lot APIs, probably following the same release time as DXP. This is natural in some open source software but of course, we want to be careful with this but Clay is starting to get into the maturity process, we figured out what doesn't work in v3 and what we need to fix. It's also worth remembering that a Major Version doesn't mean doing a complete Clay rewrite like we did from v2 to v3, this was a technology change exception. So we can have major versions just deprecating some APIs, behaviors... The Squad should take responsibility for this now, adding other people to the conversation is always welcome, just as we did at the beginning of V3 #2017 development, also the RFC process input is an incentive for that #4126 🙂. Regarding this change, as I had commented @bryceosterhaus had started work after we talked about it in #3940 raising by Greg and I think we all agreed with the one-package idea. See more speeches here too #3966. The idea of bringing this back is that we need a new cc @pat270 see the Storybook example for usage. |
Hey @matuzalemsteles thanks for that information. I also fetched this branch and when building I'm getting warnings from
Not sure if that intended, but in any case the build works as expected and the storybook examples work just fine. I checked the "CI" errors and wasn't able to figure out why |
@julien no problem. Yes, yesterday I was looking at this, I found it strange that checkDeps fails, I did a clean repo and ran it locally and it seems to fail, for some reason when I run |
I investigated this a bit today and it actually relates to the cyclic dependency between I thought about moving some components but the problem will still persist. Maybe the only solution for now is to create a new package |
Hey @matuzalemsteles thanks for the update - if creating a private package solves the issue it sounds like a good idea, if I have time to have a look too I will. |
…de packages This allows us to create documents without the README or is at the root of the package, we can move the documents to the docs folder of each package.
1159153
to
72b4f61
Compare
Stories files were being compiled as part of the build process and we don't want to include them in the build, to avoid this we are moving out of the source and also removing the nested src from the components.
Yesterday I made some advances, one of the solutions to alleviate this problem is to add I just tested it by creating a new package for Maybe it's not so much worth keeping |
We are adding a new package to Provider to avoid circular dependency and increasing package sizes. We are not going to encourage the direct use of `@clayui/provider` but rather use the direct `@clayui/core`.
It looks safe now, we've averaged a 7% increase in package sizes compared to 50%. This is failing because we have a 5% quota, for now I'm going to ignore that so we can merge this. Although we have the The |
Well, since the I'm going to merge that so we have the |
Fixes #2353
This commit adds the initial implementation of the
@clayui/core
package which will aggregate all Clay components during the next releases of v3, and v4 we will be stopping publishing packages separately if the separate packages still have a lot of value, we will discuss further. Bryce had an initial brainstorm on #3966.When exporting components, we are adopting semantics without adding the Clay prefix to the component names so that the library can be more harmonious within an application and eliminate noise in the JSX markup views. This might look like a breaking change but I'm not changing this on packages just in the export in the
core
package.Unlike the #3966 implementation, I haven't added all the packages yet in the
core
package, but I plan to do that in the next few days, we also don't export thetypes
yet we have to handle it better but thetypes
will work. As in future versions, it is to aggregate the packages in the core, I also added a minimal structure to follow with the other packages, this is similar with some other libraries that have the same purpose of exporting all components in the same package.Unlike what we do with current packages, we mix
index.js
to export components and also add components to it, in this structure we want to useindex
only for file export to facilitate import/export of module components and also to facilitate the search, thestories
also follows the same naming in order to facilitate the search by components and to differentiate what is a story and a component.If necessary, I can describe an RFC to adopt this as a pattern for the next components that will be added to
core
.We are also adding the new
Provider
component which aggregates the main Clay, Icon, and Modal Contexts but we have not added Link and Tooltip contexts because both are commonly used in certain parts of the application structure, the Tooltip is used as a Global component in DXP, so we're discarding here to avoid conflicts. It also implements thetheme
API as discussed in liferay-frontend/liferay-portal#1194 (comment).