-
Notifications
You must be signed in to change notification settings - Fork 3
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
STRWEB-69: Add support for transpilation #73
Conversation
describe('The babel-loader-rule', function () { | ||
describe.only('The babel-loader-rule', function () { |
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.
omit .only
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.
@zburke thank you for catching this!
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.
IIUC, consts.js::defaultExternals
needs to be kept in sync with a platform's direct-deps in order to avoid extern'ed things from being duped across UI modules. That feels risky.
Can/should defaultExternals
be imported directly from a platform? It bugs me that we have it in two totally separate repos. Maybe having platform-whatever/package.json
and platform-whatever/src/consts.js
is just as bad. Dunno. Just thinkin'.
'final-form', | ||
'final-form-arrays', | ||
'moment', | ||
'moment-timezone', |
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.
moment-timezone
isn't currently provided by the platform for apps use as a peer-dep but I think it needs to be for this to work correctly. After this PR, it would be extern'ed in apps but also never pulled in by the platform, and thus absent in the final bundle. (Right?)
'react-dom', | ||
'react-final-form', | ||
'react-final-form-arrays', | ||
'react-final-form-listeners', |
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.
Same as moment-timezone
; does this need to be added to the platform's direct-deps?
'react-intl', | ||
'react-query', | ||
'react-redux', | ||
'react-router', |
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.
Should we add react-router-dom
, react-titled
, redux-observable
, rxjs
, zustand
?
@zburke the reason we are listing these externals is to make sure they are not included in the transpiled version of any bundle. These are third party dependencies and somehow they need to be included in the bundle by being listed as a dependency of the consumer app (either single ui module or a platform). I don't think that list belongs to the platform because how would stripes-webpack get access to it? But perhaps this could be extracted to some other place as you suggested. Some of these libraries (like https://github.com/folio-org/ui-users/blob/master/package.json#L911 so that's how they will get fulfilled for now but what happens when all ui modules are also transpiled (with excluded Somehow they will have to be fulfilled by the higher level consumer (in this case the platform). So I think in short term we should be ok but in long term I think the answer is "yes" the platform will need to list them which I think is actually maybe a good thing? It pushes us to do more cleanup for these 3rd party deps. |
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.
🎉 🎉 🎉 👏 👏 👏
https://issues.folio.org/browse/STRWEB-69
This PR introduces support for transpilation of individual modules. This feature can be accessed via the new
transpile
command which is now available in stripes-cli (refer to folio-org/stripes-cli#295). Users can now transpile individual modules by running:yarn stripes transpile
.The transpilation has been set up for all stripes modules:
How to test it
Please copy and run the script below: