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

Add optional chaining and nullish operator to Babel config #6308

Closed
wojciechczerniak opened this issue Oct 3, 2019 · 5 comments
Closed

Add optional chaining and nullish operator to Babel config #6308

wojciechczerniak opened this issue Oct 3, 2019 · 5 comments

Comments

@wojciechczerniak
Copy link
Member

@wojciechczerniak wojciechczerniak commented Oct 3, 2019

Description

We should add those three Babel plugins for cleaner code and an easier migration to Typescript in the future:

@budnix

This comment has been minimized.

Copy link
Member

@budnix budnix commented Oct 9, 2019

And maybe it's a proper time to rethink about adding support for for of loops? Currently, using for of loops causes bigger generated dist files. Maybe assumeArray could balance that https://babeljs.io/docs/en/next/babel-plugin-transform-for-of#assumearray.

@wojciechczerniak

This comment has been minimized.

Copy link
Member Author

@wojciechczerniak wojciechczerniak commented Oct 10, 2019

@budnix What if someone will use it with something that isn't an array? Will he get an error or will it compile and fail later?

@budnix

This comment has been minimized.

Copy link
Member

@budnix budnix commented Oct 10, 2019

Yeah, good question. This could be investigated in this task.

pnowak added a commit that referenced this issue Oct 11, 2019
…lint and babel-eslint #6308
@pnowak pnowak mentioned this issue Oct 11, 2019
2 of 6 tasks complete
@wojciechczerniak wojciechczerniak assigned pnowak and unassigned jansiegel Oct 22, 2019
@pnowak

This comment has been minimized.

Copy link
Member

@pnowak pnowak commented Nov 4, 2019

It seems if in for of loops with assumeArray we use something that isn't an array we can't iterate over them.
With this config, babel plugin creates ordinary for loop: for (let _i = 0; _i < iterable.length; _i++). If we try to iterate over Map or Set we couldn't enter to this loop because we don't have .length property.
So we can iterate only on array and string.
If we want to use the full functionality we should use this plugin without assumeArray. If not, we have to remember iterate in for of loops only for array.

pnowak added a commit that referenced this issue Nov 15, 2019
pnowak added a commit that referenced this issue Nov 15, 2019
pnowak added a commit that referenced this issue Nov 18, 2019
pnowak added a commit that referenced this issue Nov 22, 2019
pnowak added a commit that referenced this issue Nov 27, 2019
pnowak added a commit that referenced this issue Jan 9, 2020
pnowak added a commit that referenced this issue Jan 13, 2020
pnowak added a commit that referenced this issue Jan 14, 2020
…hem, remove the unneccessary plugins #6308
pnowak added a commit that referenced this issue Jan 14, 2020
pnowak added a commit that referenced this issue Jan 14, 2020
pnowak added a commit that referenced this issue Jan 15, 2020
* Update babel core to 7.8.3 version and the other modules related to them, remove the unneccessary plugins #6308
jansiegel added a commit that referenced this issue Feb 3, 2020
* Update babel core to 7.8.3 version and the other modules related to them, remove the unneccessary plugins #6308
@aninde

This comment has been minimized.

Copy link

@aninde aninde commented Feb 7, 2020

Notes from testing release of 7.4.0:
How it was tested?
I did a build on which I tested according to the checklist and checked the size of the version. Looks good.

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

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.