-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Convert sets to arrays prior to using spread operator to enable transpilation to ES5 #3297
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.
Hi, note that we dropped support for 2.0.0 for older browsers that require a lot of polyfills. But you are saying there isn't a decent polyfill to fix this for you?
Yes, the lack of a polyfill for the spread operator for Set, specifically, due to the lack of I didn't do a comprehensive check, but it does seem that these are the only lines preventing Uppy 2 from working for ES5 browsers. |
It's unclear to me how |
* main: @uppy/aws-s3: use `Promise.allSettled` insead of custom utils (#3079) Convert sets to arrays prior to using spread operator to enable transpilation to ES5 (#3297) Add showRecordingLength to webcam types (#3303) Required meta fields UI (#3285) Update BACKLOG.md Release [email protected] @uppy/[email protected]
Here's how it's output in the legacy bundle (https://releases.transloadit.com/uppy/v2.2.1/uppy.legacy.js): steps = [].concat(_classPrivateFieldLooseBase(this, _preProcessors)[_preProcessors], _classPrivateFieldLooseBase(this, _uploaders)[_uploaders], _classPrivateFieldLooseBase(this, _postProcessors)[_postProcessors]); What seems to be happening is Babel replacing array spread operator with a concat operation, which would work if we were spreading arrays, but doesn't with |
* main: Remove references of incorrect `options` argument for `companion.socket` (#3307) Upgrade linting to 2.0.0-0 (#3280) Release [email protected], @uppy/[email protected] @uppy/[email protected] meta: update version references in docs Release @uppy/[email protected] @uppy/[email protected] @uppy/aws-s3: use `Promise.allSettled` insead of custom utils (#3079) Convert sets to arrays prior to using spread operator to enable transpilation to ES5 (#3297) Add showRecordingLength to webcam types (#3303) Required meta fields UI (#3285) Update BACKLOG.md Release [email protected] @uppy/[email protected] fix: @uppy/utils - `getFileType()` always returns a string (#3294) Remove yarn file @uppy/companion: fix Dockerfiles (#3291) @uppy/companion: use Node.js 16.x for Dockerfile (#3289) if an item is checked, it can’t be disabled (#3288)
* main: (30 commits) Refactor locale scripts & generate types and docs (#3276) Remove references of incorrect `options` argument for `companion.socket` (#3307) Upgrade linting to 2.0.0-0 (#3280) Release [email protected], @uppy/[email protected] @uppy/[email protected] meta: update version references in docs Release @uppy/[email protected] @uppy/[email protected] @uppy/aws-s3: use `Promise.allSettled` insead of custom utils (#3079) Convert sets to arrays prior to using spread operator to enable transpilation to ES5 (#3297) Add showRecordingLength to webcam types (#3303) Required meta fields UI (#3285) Update BACKLOG.md Release [email protected] @uppy/[email protected] fix: @uppy/utils - `getFileType()` always returns a string (#3294) Remove yarn file @uppy/companion: fix Dockerfiles (#3291) @uppy/companion: use Node.js 16.x for Dockerfile (#3289) if an item is checked, it can’t be disabled (#3288) ...
* Revert "Convert sets to arrays prior to using spread operator to enable transpilation to ES5 (#3297)" This reverts commit a545c66. * build: disable loose transpilation for legacy bundle Refs: #3297 (comment)
For reference, this was reverted following this issue so we're back to a lack of ES5 support in the 2.3.0 release. |
* main: (30 commits) Refactor locale scripts & generate types and docs (transloadit#3276) Remove references of incorrect `options` argument for `companion.socket` (transloadit#3307) Upgrade linting to 2.0.0-0 (transloadit#3280) Release [email protected], @uppy/[email protected] @uppy/[email protected] meta: update version references in docs Release @uppy/[email protected] @uppy/[email protected] @uppy/aws-s3: use `Promise.allSettled` insead of custom utils (transloadit#3079) Convert sets to arrays prior to using spread operator to enable transpilation to ES5 (transloadit#3297) Add showRecordingLength to webcam types (transloadit#3303) Required meta fields UI (transloadit#3285) Update BACKLOG.md Release [email protected] @uppy/[email protected] fix: @uppy/utils - `getFileType()` always returns a string (transloadit#3294) Remove yarn file @uppy/companion: fix Dockerfiles (transloadit#3291) @uppy/companion: use Node.js 16.x for Dockerfile (transloadit#3289) if an item is checked, it can’t be disabled (transloadit#3288) ...
This goes with: #3296
Transpiling Uppy 2 to ES5 results in errors due to the lack of polyfill support for the spread operator in ES5. Converting Sets to arrays prior to spreading fixes this and allows for Uppy 2 to be used in ES5 browsers.