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
Add build task for publishing #266
Conversation
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.
Awesome stuff! Please check my comment about the babel preset.
package.json
Outdated
"babel-plugin-module-resolver": "^3.0.0", | ||
"babel-preset-es2015": "^6.24.1", |
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.
Any reason why you're not using the env
preset? AFAIK, all the ES version specific presets are deprecated.
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.
🙇 neat stuff. We just need to check the preset-env instead of 2015
I'm not really the build expert to really tell you if this is the right way to go, but my impression is that it looks great and will allow us to move forward. Thanks a ton for the extra initiative and focusing on a simple solution 👍 Once you address Felix/Fernando's feedback item, you have my approval! |
@elanoism Just a note that one needs to have |
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 published this PR to npm under the canary
tag as version 0.0.1-canary
, then I took it for a spin with Next.js and Webpack 4 on a test project. The treeshaking works great, I'd estimate that it'll reduce the website's bundle size by 1.5MB (or 250kB gzipped). 🙌
However, there's one thing we need to fix:
Importing from @sumup/circuit-ui
works, but importing from a subdirectory such as @sumup/circuit-ui/themes
doesn't. Instead, it would need to be @sumup/circuit-ui/lib/themes
— tedious to type and not backward compatible.
Suggestion: replicate @felixjung's approach and copy package.json
, LICENSE.md
, README.md
, and any other required files to the dist folder, so we can publish from there with a flat file structure.
I'm happy to make these changes myself if you agree. :)
7792454
to
15d7424
Compare
Replaced Gathered some feedback locally and the theme is now exported trough the main export as: import { theme } from 'circuit-ui';
<ThemeProvider theme={theme.standard}>...</Theme> This comes from @connor-baer and leaves the possibility open for adding Generally we should try to export everything trough the main export in order to leverage bundlers choosing appropriate module type. Later I will focus on exporting the utils trough the main export as well. |
15d7424
to
f64a9e5
Compare
@elanoism As long as you spell |
b795537
to
e29ad90
Compare
I rebased it in so .... it didn't happen. |
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 good to me :) Thanks for going the extra mile on this.
@elanoism Will you also export the style helpers at root level? |
5464493
to
974826f
Compare
Added the utils export. Rebased on master and made a release @connor-baer . @herberthenrique , please try it out. I need to move on to different things, before I can spin it up in the P.S. Take a look at the exports in the bottom for styles/globalStyles/utils and stuff. |
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 had updated Partner Portal to use this canary version and works perfectly <3
@elanoism I upgraded the website to Webpack 4 (adds support for
I didn't look into the errors any further. Also, the reduction in bundle size won't be as big as I estimated. I'm seeing improvements of 400kb (110kb gzipped). Still substantial though! |
@connor-baer , these are general bugs in the library. I can fix them before release, though. Edit: @herberthenrique is addressing those in #279. I will publish a new npm version after it is merged. |
@elanoism @felixjung @fernandofleury Looks like there are a lot of approvals, is there more work to be done before this can be merged? 🎉 |
974826f
to
07c58fa
Compare
Published next release @mlent, we need to prepare extra release for the dashboard (website and referrals are already fine, afaik) before we can merge this. We believe that due to the name change it may cause problems otherwise. I can do it after the release of the transactions history. |
b0c16c1
to
b4da0cc
Compare
Codecov Report
@@ Coverage Diff @@
## master #266 +/- ##
==========================================
+ Coverage 66.71% 66.95% +0.23%
==========================================
Files 135 135
Lines 1992 1985 -7
Branches 321 319 -2
==========================================
Hits 1329 1329
+ Misses 541 536 -5
+ Partials 122 120 -2
|
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.
Maybe also update the readme with the new commands for releasing?
f7c78e0
f7c78e0
to
8f4be35
Compare
@elanoism Ready to merge? 🚀 |
Resolves #109.
The goal for this is to make
circuit-ui
easy to add to a project without additional modifications. This is most important for apps that are built with CRA where you cannot change the config.Changes
.babelrc
so we have different configs for different env targets.cjs
andes
modules and puts them inlib
.I've created two example repos using this.
For testing, you need circuit-ui and the example app working side by side and:
yarn build:js
in the circuit-ui folderyarn upgrade circuit-ui
in the example folder