Visitar URL original
Proposal: More intelligent transpilation for Differential Loading · Issue #16170 · angular/angular-cli · GitHub
The Wayback Machine - https://web.archive.org/web/20260503073800/https://github.com/angular/angular-cli/issues/16170
Skip to content

Proposal: More intelligent transpilation for Differential Loading #16170

@lacolaco

Description

@lacolaco

🚀 Feature request

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Description

This proposal is inspired by the Chrome team's work on babel/preset-modules.

Currently, Angular CLI's mechanism for differential loading is simple; creating original bundles targetted in ES2015 and down-leveling it for ES5 compatible.

But today, modules-compatible browsers can accept more modern JavaScript than es2015 like async/await, Object Spread, Tagged Template, and more. So the Chrome team created a babel preset for getting more compact modern JavaScript.

Please see more https://github.com/babel/preset-modules#how-does-it-work.

I guess that idea can help also Angular CLI's build process. Generate original bundles for browsers that support ES Modules, and down-leveling it for legacy browsers.

I'm not sure how we can achieve it with TypeScript-based toolchain, but I hope it isn't impossible.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions