-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add pure bundle build #489
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #489 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 3 3
Lines 94 94
Branches 15 15
=====================================
Hits 94 94 Continue to review full report at Codecov.
|
This doesn't work since // ./pure.js
// makes it so people can import from '@testing-library/react/pure'
module.exports = require('./dist/pure') May I ask why you don't use |
I don't want to compile async/await for the majority of use cases (people running tests in a recent version of node with jsdom). I think that it's reasonable to expect people to do extra work for the edge case: import {render} from '@testing-library/react/dist/@testing-library/react.pure.esm.js' If that's annoying enough, someone could make another module in their project that they import: // react-testing-library.js
export * from '@testing-library/react/dist/@testing-library/react.pure.esm.js'
export default from '@testing-library/react/dist/@testing-library/react.pure.esm.js' and then import {render} from './react-testing-library' |
Older browser support is not an edge case. It's directly in line with
My users don't use
I'll do that as well. If I was only concerned with my projects I wouldn't have opened this. I wanted to make this work as easy as possible for any I'm fine with having multiple bundles for various targets and happy with this change. Me personally I would make the bundle for older targets the default. Would like to hear some other opinions though. |
I want to have the common-case be the default. Considering this library has been available for a very long time available at the current level of compilation and this is the first time we're hearing anyone want this tells me that the common case is definitely not to compile/polyfill things further. |
🎉 This PR is included in version 9.2.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
async-await only got added recently. You can't consider the full time frame if the IE 11 target never would have had any effect. |
What: Adds a "pure" build for bundling with rollup (and parallelizes all build scripts)
Why: Closes #486
How: Used the environment variables supported by the kcd-scripts rollup config: https://github.com/kentcdodds/kcd-scripts/blob/bd3c762c0202ac3564bb6a329e3e9e972795b5e7/src/config/rollup.config.js so we can make the pure.js file an entry and set the output filename suffix (so it doesn't overwrite the existing build).
Checklist:
docs site N/A. I don't think the UMD is something we really document or need to honestly.