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

The update of ecmascript cause issues #8399

Open
Themandunord opened this Issue Feb 20, 2017 · 33 comments

Comments

Projects
None yet
9 participants
@Themandunord

Themandunord commented Feb 20, 2017

Hi,

With the last version of ecmascript@0.6.3, a plugin for babel don't work anymore.
This package is https://github.com/ant-design/babel-plugin-import

With the version @0.6.1 of ecmascript, this plugin works great.

Do you have any idea ?

meteor/babel#13
ant-design/babel-plugin-import#117

@abernix

This comment has been minimized.

Member

abernix commented Feb 20, 2017

What version of Meteor are you using?

@Themandunord

This comment has been minimized.

Themandunord commented Feb 20, 2017

Hi @abernix

I use the version 1.4.2.6 at this moment. But same problem with 1.4.2.7

@abernix

This comment has been minimized.

Member

abernix commented Feb 20, 2017

If you're using Meteor 1.4.2.x and experience problems like this you'll want to pin your ecmascript to 0.6.1 as the 0.6.3 version is only compatible with Meteor 1.4.3.x. See some additional information on this comment.

I'd also encourage you to try Meteor 1.4.3.1 and see if it works for you. It's not currently marked as recommended (which means, it becomes the "Default" version for new Meteor installations), but it is believed to be stable and upgrading to Meteor 1.4.3.x from 1.4.2.x should be painless.

If you choose to stay on Meteor 1.4.2.x, you'll want to pin your ecmascript by putting ecmascript@=0.6.1 in your .meteor/packages file.

@abernix

This comment has been minimized.

Member

abernix commented Feb 20, 2017

Closing, but happy to reopen if that doesn't fix it for you!

@abernix abernix closed this Feb 20, 2017

@Themandunord

This comment has been minimized.

Themandunord commented Feb 20, 2017

@abernix Thanks, but with Meteor 1.4.3.1 the babel plugin still not works :/

@abernix

This comment has been minimized.

Member

abernix commented Feb 20, 2017

Will you please provide a reproduction repo as instructed in reporting a bug?

@Themandunord

This comment has been minimized.

Themandunord commented Feb 20, 2017

@abernix No problem. I will do that 👍

@Themandunord

This comment has been minimized.

Themandunord commented Feb 20, 2017

@abernix Here the repo : https://github.com/Themandunord/babel-error
I take the meteor chef base to make this repreoduction app , and I remove many things to keep the repo small.

Tell me if it not necessary to reproduce the bug :)

@klaussner

This comment has been minimized.

Collaborator

klaussner commented Feb 20, 2017

I think Babel plugins that process ImportDeclarations no longer work since this commit because imports are converted to module.import calls before Babel transpilation.

@abernix

This comment has been minimized.

Member

abernix commented Feb 22, 2017

@Themandunord Considering import statements are already transpiled to require statements, what do you need/use babel-plugin-import for?

@Themandunord

This comment has been minimized.

Themandunord commented Feb 22, 2017

@abernix it's explain here : https://github.com/ant-design/babel-plugin-import

It's to avoid to load all components.
And load css (or less) file.

@Themandunord

This comment has been minimized.

Themandunord commented Feb 27, 2017

@abernix, any updates ?

@abernix

This comment has been minimized.

Member

abernix commented Feb 27, 2017

I haven't had an opportunity to look at your reproduction or analyze a possible fix yet. Does your project work correctly if you just remove babel-plugin-import?

If you need to keep going at the moment, you should use Meteor 1.4.2.7 with ecmascript@=0.6.1 in your .meteor/packages file.

@Themandunord

This comment has been minimized.

Themandunord commented Feb 27, 2017

@abernix Yes for now, I use meteor 14.2.7. But it's not a solution :/

If I remove the babel plugin, the whole package is used, so it's not a good solution too :/

@lhz516

This comment has been minimized.

lhz516 commented Mar 11, 2017

I got the same problem here. According to this issue meteor/babel#13 , it might be caused by the reifyCompiler. Hope this can be solved soon.

@abernix abernix added this to the Release 1.4.3.x milestone Mar 14, 2017

@benjamn

This comment has been minimized.

Member

benjamn commented Mar 17, 2017

This should be fixed if you run meteor update --release 1.4.3.3-beta.4 in your application directory. Please feel free to reopen this issue if it's not resolved for you.

@benjamn benjamn closed this Mar 17, 2017

@Themandunord

This comment has been minimized.

Themandunord commented Mar 17, 2017

Hi @benjamn, thanks for that. But when I update to the beta release, I still have the issue :/
@lhz516 Have you still got the problem too ?

@benjamn

This comment has been minimized.

Member

benjamn commented Mar 17, 2017

@Themandunord I definitely did test https://github.com/Themandunord/babel-error before I commented. Perhaps try meteor reset to be sure?

@Themandunord

This comment has been minimized.

Themandunord commented Mar 17, 2017

@benjamn I don't doubt your skills ;)
I will test on my other computer tonight, and I reply here :)

@Themandunord

This comment has been minimized.

Themandunord commented Mar 18, 2017

@benjamn Sorry, I don't have access to my computer last night... And I'm going to vacation this week. So I can't try to update my repo.
I will check it as soon as possible.

@abernix abernix removed this from the Release 1.4.3.x milestone Mar 21, 2017

@abernix abernix modified the milestones: Release 1.4.3.3, Release 1.4.3.x Mar 21, 2017

@abernix

This comment has been minimized.

Member

abernix commented Mar 21, 2017

@lhz516 Are you still experiencing this problem after meteor update --release 1.4.3.3-beta.4?

@lhz516

This comment has been minimized.

lhz516 commented Mar 21, 2017

@abernix @Themandunord

I just tested and it still doesn't work. These's still a warning message in the browser console:

You are using a whole package of antd,
please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size.

Env:
Meteor version: 1.4.3.3-beta.4
ecmascript package version: 0.7.1-beta.4

In .babelrc

{
  "plugins": [
    ["import", { "libraryName": "antd", "style": true }]
  ]
}

In package.json

···
"dependencies": {
    "antd": "^2.8.1",
    "babel-runtime": "^6.20.0",
    "bcrypt": "^1.0.2",
    "eslint": "^3.17.1",
    "indexof": "0.0.1",
    "meteor-node-stubs": "^0.2.5",
    "moment": "^2.17.1",
    "react": "^15.4.2",
    "react-dom": "^15.4.2",
    "react-helmet": "^4.0.0",
    "react-komposer": "^2.0.0",
    "react-router": "^4.0.0",
    "react-router-dom": "^4.0.0",
    "react-simple-di": "^1.2.0",
    "simpl-schema": "^0.2.3"
  },
"devDependencies": {
    "babel-plugin-import": "^1.1.1",
    "eslint": "^3.16.1",
    "eslint-plugin-meteor": "^4.0.0",
    "eslint-plugin-react": "^6.10.0"
  }
···

The expectation of using babel-plugin-import is to automatically transfer

import { Menu } from 'antd';

to

import Menu from 'antd/lib/menu';
import 'antd/lib/menu/style';

If you need a reproduction project, I can upload the repo to GitHub.

@abernix

This comment has been minimized.

Member

abernix commented Mar 21, 2017

Reproductions always welcome!

@abernix abernix reopened this Mar 21, 2017

@lhz516

This comment has been minimized.

lhz516 commented Mar 21, 2017

@abernix

No problem. I just uploaded a reproduction https://github.com/lhz516/antd-meteor-1.4-babel-bug

@kvetoslavnovak

This comment has been minimized.

kvetoslavnovak commented Mar 28, 2017

I can confirm same results as @abernix

@benjamn benjamn closed this in 9d4d748 Apr 7, 2017

@fangjj

This comment has been minimized.

fangjj commented Oct 16, 2017

I hit the issues in meteor 1.5.2.2, this is a reproduction https://github.com/fangjj/antd-meteor-1.6.1-bug, please help me out! @benjamn

@fangjj

This comment has been minimized.

fangjj commented Oct 18, 2017

I hit the issues in meteor 1.5.2.2, this is a reproduction https://github.com/fangjj/antd-meteor-1.6.1-bug, please help me out! @benjamn @abernix

@fangjj

This comment has been minimized.

fangjj commented Nov 2, 2017

this issues still in meteor 1.6.

@avalanche1

This comment has been minimized.

avalanche1 commented Feb 22, 2018

Same issue on 1.6.1

@hwillson

This comment has been minimized.

Member

hwillson commented Feb 22, 2018

Thanks @fangjj @avalanche1 - I'll re-open this for now so it doesn't get lost (but I haven't had a chance to verify / look into it).

@hwillson hwillson reopened this Feb 22, 2018

@hwillson hwillson removed this from the Release 1.4.4 milestone Mar 5, 2018

@hwillson

This comment has been minimized.

Member

hwillson commented Mar 9, 2018

@fangjj Your reproduction doesn't seem to be available anymore.

@avalanche1 Do you have a reproduction that demonstrates this is still happening with Meteor 1.6.1?

@fangjj

This comment has been minimized.

fangjj commented Mar 10, 2018

@hwillson i'm sorry, https://github.com/fangjj/antd-meteor-1.6.1-bug this is new repository for it.

@lhz516

This comment has been minimized.

lhz516 commented Mar 10, 2018

I'm glad that this issue is opened again.

In my understanding, babel-plugin-import should transform import { Button } from 'antd' to import Button from 'antd/lib/button' and one line of style importing. However, this plugin needs to run before babel-preset-meteor, because babel-preset-meteor transforms module import patterns to another shape. In a Meteor project, any Babel plugins in .babelrc will run after the Meteor presets. This will make babel-plugin-import no longer to work.

It would be great if there's a more flexible way to load custom Babel plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment