Skip to content
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

Drop core-js in favour of custom fallbacks #1725

Merged
merged 5 commits into from
Jan 31, 2020

Conversation

TrySound
Copy link
Contributor

Ref #1629 (comment)

I forbid using es6+ methods I added eslint-plugin-es6. It does not
forbid isInteger but I send PR nkt/eslint-plugin-es5#37.

Looks like we saved 2kb gzipped. And one less commonjs dependency!

Ref atlassian#1629 (comment)

I forbid using es6+ methods I added eslint-plugin-es6. It does not
forbid isInteger but I send PR nkt/eslint-plugin-es5#37.
"bundled": 321489,
"minified": 115006,
"gzipped": 34084
"bundled": 307334,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

package.json Outdated
@@ -56,7 +56,7 @@
"prepublishOnly": "yarn build"
},
"dependencies": {
"@babel/runtime-corejs2": "^7.6.3",
"@babel/runtime": "^7.6.3",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for sorting this!

// @flow
// https://allyjs.io/tutorials/hiding-elements.html
// Element is visually hidden but is readable by screen readers
const assignVisuallyHidden = (style: Object) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer my functions not to mutate. Are we avoiding Object.assign?

Copy link
Contributor Author

@TrySound TrySound Jan 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Object.assign need to be polyfilled. Though in this case much easier to use mutation. I think this is ok for this particular function. object assign ponyfill would mutate too.

Copy link
Collaborator

@alexreardon alexreardon Jan 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use spread {...values, ...otherValues} quite a bit in the library. Wouldn't that be using Object.assign?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spread uses extends helpers which comes from @babel/runtime package

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it won’t use that if you use object.assign. Can we import extends from Babel runtime and use that for the assign? 🤔

Copy link
Collaborator

@alexreardon alexreardon Jan 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My ideal is to not have a function modify the passed in object but rather to return a new object (or to do the Object.assign in place) But I am okay to not get hung up on it and merge soon

@@ -70,6 +70,7 @@
"@babel/core": "^7.6.4",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-transform-modules-commonjs": "^7.6.0",
"@babel/plugin-transform-object-assign": "^7.8.3",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to confirm - this won't polyfill, it is just ponyfill?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@TrySound
Copy link
Contributor Author

You will be able to get rid from eslint suppression in new release of es5 plugin

@alexreardon alexreardon merged commit 3b90400 into atlassian:master Jan 31, 2020
@alexreardon
Copy link
Collaborator

Thanks for this @TrySound. I will aim to release this on monday

@TrySound TrySound deleted the drop-core-js branch January 31, 2020 10:25
@davidchenfitzgerald
Copy link

Are you guys still planning on a release with this soon?

@TrySound
Copy link
Contributor Author

TrySound commented Feb 4, 2020

@davidchenfitzgerald Yes, after fixing a few minor issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants