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

@babel/plugin-transform-spread regression of spread array #8907

Closed
nihgwu opened this issue Oct 20, 2018 · 2 comments · Fixed by #9108
Closed

@babel/plugin-transform-spread regression of spread array #8907

nihgwu opened this issue Oct 20, 2018 · 2 comments · Fixed by #9108
Assignees
Labels
7.x: regression i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@nihgwu
Copy link

nihgwu commented Oct 20, 2018

v7 Regression

First check out: https://new.babeljs.io/docs/en/next/v7-migration.html
Also a partial upgrade tool: https://github.com/babel/babel-upgrade

Potential Commit/PR that introduced the regression
If you have time to investigate, what PR/date introduced this issue.

#6763

before that PR [...array] was transpiled to [].concat(array) now it's array.concat(), this change breaks immutable array(seamless-immutable), for example

import Immutable from `seamless-immutable`
const array = Immutable([1, 2, 3]);
console.log(Immutable.isImmutable([...array]);

it prints false in console of latest Chrome and in Node v8.11.3, but it prints true with Babel@7, it should be false, but as it's transpiled to array.concat(), and an immutable array returns immutable array too with builtin methods(concat, map, reduce...)

Describe the regression
A clear and concise description of what the regression is.

Input Code

var your => (code) => here;

Babel Configuration (.babelrc, package.json, cli command)

{
  "your": { "config": "here" }
}

Expected behavior/code
A clear and concise description of what you expected to happen (or code).

Environment

  • Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34]
  • Node/npm version: [e.g. Node 8/npm 5]
  • OS: [e.g. OSX 10.13.4, Windows 10]
  • Monorepo [e.g. yes/no/Lerna]
  • How you are using Babel: [e.g. cli, register, loader]
@babel-bot
Copy link
Collaborator

Hey @nihgwu! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@danez danez self-assigned this Nov 30, 2018
@danez
Copy link
Member

danez commented Nov 30, 2018

Thanks for reporting this and thanks for linking to the PR that introduced the problem. Sorry for the late reply. I will now take care of this issue and probably partially revert some of the optimizations in the linked PR.

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Mar 15, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
7.x: regression i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants