question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update to babel 7 ?

See original GitHub issue

Is there any plan to update aurelia-cli to babel 7 soon?

It seems that these 2 requires messed transpilation when we want to use new babel version: https://github.com/aurelia/cli/blob/15b1f1f6d4ee74a5a429ca90651d61b0e8d8abdf/lib/project.js#L207-L218

And it seems that this transformation do the trick:

function installBabel() {
  require('@babel/polyfill');
  require('@babel/register')({
    plugins: [
      '@babel/plugin-transform-modules-commonjs'
    ],
    ignore: [(filename) => {
      let relativeFromProjectRoot = path.relative(this.directory, filename);
      return !/^aurelia_project/.test(relativeFromProjectRoot);
    }]
  });
}

This will allow us to use improvements of @babel/preset-env in a local .babelrc file.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
EisenbergEffectcommented, Mar 14, 2018

A couple of weeks ago there was a meeting with Yahuda, who is working on the decorators spec, and the major framework leaders. I’m completely up to speed about where decorators is at now 😃 The new spec looks very good and is poised to move into stage 3. At that point, we’ll probably see transpiler and polyfill implementations. During that meeting we also talked about compatibility layers for transpiler migration. I think we’ll probably wait for that to happen before we make any moves. Otherwise, it’s a major breaking change to update our implementations. For vNext we can start from day 1 with the new spec.

2reactions
arabsightcommented, Jul 2, 2018

you can use the legacy option with the new plugin, and if you’re using class-properties then the decorators plugin must come before class-properties pluginn and the later must must use loose mode:

const plugins = [
  ['@babel/plugin-proposal-decorators', { legacy: true }],
  ['@babel/plugin-proposal-class-properties', { loose: true }]
];
Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade to Babel 7
Upgrade to Babel 7 · All of Babel · Config Lookup Changes · Yearly Preset Deprecations · Stage Preset Deprecations · Remove proposal...
Read more >
How to upgrade to babel 7 - Stack Overflow
Most of the packages in Babel has been renamed to follow the pattern @babel/PACKAGE_NAME . So if you want to upgrade, change the...
Read more >
Babel upgrade from babel 6.x to 7.0 | by maicmi | Medium
Babel upgrade from babel 6.x to 7.0. Usually, I build a new project, I use the default value configuration which provided from babel...
Read more >
npx babel-upgrade - GitHub
Run at the root of your git repo: If using npm < v5.2.0, install npx globally. ... Without the --write (or -w )...
Read more >
babel-upgrade - npm
Upgrade tool for Babel. Latest version: 1.0.1, last published: 4 years ago. Start using babel-upgrade in your project by running `npm i ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found