Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Build Optimizer does not support es2015 code #816

Closed

Description

@filipesilva

Build Optimizer does not currently support es2015 modules code, but we should support it.

Related to #237

Activity

  1. added this to the v6.1.0 milestone on Apr 30, 2018
  2. robwormald commented on May 4, 2018

    @robwormald

    Should also support ES2015 code (really, it should support esnext)

  3. hansl commented on May 5, 2018

    @hansl
    Contributor

    I was under the impression UglifyES (or whatever NG version of uglify) was doing a proper job at DCE on ES2015 code and that we wouldn't need build optimizer for those.

  4. cyrilletuzi commented on May 8, 2018

    @cyrilletuzi
    Contributor

    Note: now we have Angular Elements, support for ES2015 becomes more important, because transpiling custom elements to ES5 is not supported by the standard and produces an error.

  5. rafaelfgx commented on May 10, 2018

    @rafaelfgx

    With all the respect, this is a very basic bug and one that should be avoided.

    You create an Angular 6 application, without changing anything, with all the default settings, build it for production, and it does not work.

    It is very serious that something so trivial as publishing in production is not working in the final version.

    More testing is needed, especially for the most important and essential tasks.

  6. robwormald commented on May 11, 2018

    @robwormald

    @rafaelfgx - nobody should be using es2015 modules in production, Webpack doesn’t export them, and they’re not turned on by default.

  7. msklvsk commented on May 11, 2018

    @msklvsk

    While buildOptimizer is turned on by default, es6 is not, including the docs:

    image

    (angular.io/guide/typescript-configuration)

  8. devoto13 commented on May 14, 2018

    @devoto13
    Contributor

    @hansl It does not seem to be the case.

    Here is ES2015 with build optimizer on (fails with angular/angular-cli#10658):

    screenshot 2018-05-14 13 56 39

    Here is ES2015 with build optimizer off:

    screenshot 2018-05-14 14 14 36

    As you can see it is ~200k less with build optimizer enabled. Not sure if it is real gain or a side effect of build optimizer removing not dead code, but this looks like a lot of gain. Most of it comes from Angular packages (~180k).

  9. catull commented on May 16, 2018

    @catull

    Hmm, I see a build optimiser bug for production builds with ES5.

    See angular/angular-cli#7799 (comment).
    That issue is closed, stating that the bug is tracked here.

    As a work-around, I switched off build-optimiser and the app is working.
    With build-optimiser ON, the error is as documented in the "issue comment" at the top of this comment.

  10. hijamoya commented on May 17, 2018

    @hijamoya

    I got same issues here.

  11. byrondover commented on May 27, 2018

    @byrondover

    robwormald commented 10 days ago

    @rafaelfgx - nobody should be using es2015 modules in production, Webpack doesn’t export them, and they’re not turned on by default.

    @robwormald You may want to align with @StephenFluin on your community messaging around enabling ES2015. 😅

    https://twitter.com/stephenfluin/status/997224523610116096

    P.S. Big fans of all the work you do and are doing! 🤞for production ES2015 support by 2020. :neckbeard:

  12. robwormald commented on May 27, 2018

    @robwormald

    @byrondover ES2015 syntax (classes, const,let,etc) is fine (assuming your browser target supports it) - lots of good wins to be had there.

    ES2015 modules, not so much (though if you a very adventurous, no harm trying)

  13. 16 remaining items

  14. Maximaximum commented on May 31, 2018

    @Maximaximum
  15. cedvdb commented on Jun 5, 2018

    @cedvdb

    issue still here with 0.7.0 and target es6.

    What would be really nice is an error at compilation time as to maybe find a temporary fix for the part of the code that's problematic.

  16. filipesilva commented on Jun 5, 2018

    @filipesilva
    ContributorAuthor

    @cedvdb can you put up a repro I can look at please?

  17. cedvdb commented on Jun 6, 2018

    @cedvdb

    @filipesilva

    The problem seems to be resolved. I didn't manage to reproduce it yet. If you need so I could dig deeper this evening, right now I gotta work.

  18. filipesilva commented on Jun 6, 2018

    @filipesilva
    ContributorAuthor

    As long as it's working, I think there's no need to look further. If I had to bet it wasn't working because at some point you were in an old version.

    This fix is only on @angular-devkit/build-optimizer@0.7.0-beta.1 that comes with @angular-devkit/build-angular@0.7.0-beta.1.

    You can check what version you have with npm list @angular-devkit/build-optimizer.

  19. shahafal commented on Jun 6, 2018

    @shahafal

    @StephenFluin ... things like the Google crawler don't support ES2015

    thank you for this, it's the first time i'm hearing of it. unfortunately except for discussions about this being an issue i can't find anywhere a discussion about the status to fix this.
    do you know if there is an open thread in github (or someplace else) discussing the fix? i would like to follow it

  20. alexeagle commented on Sep 4, 2018

    @alexeagle
    Contributor

    This issue was moved to angular/angular-cli#12112

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions