Skip to content

Compiler option to generate native JS output with minimal Angular runtime #64871

@boomrollkick

Description

@boomrollkick

Which @angular/* package(s) are relevant/related to the feature request?

No response

Description

Suggesting a new compiler mode that compiles most Angular template logic directly into vanilla JavaScript/DOM operations, leaving only a small runtime kernel for dependency injection and reactive signals. This could dramatically reduce bundle size and improve startup performance, especially for mobile and embedded applications.

Motivation:
Angular’s Ivy compiler already emits fine-grained JS instructions.
With the recent move to Signals and away from Zone.js, Angular could further minimize its runtime dependency.
Similar “compile away the framework” approaches (e.g., Svelte, Solid) show strong performance benefits.

Benefits:

  • Reduced bundle size and faster cold starts
  • Lower memory usage
  • Potential “Angular Lite” variant for low-resource environments

Related Work:

  • React Compiler (Forget)
  • Svelte compile-to-DOM approach
  • Angular Ivy / Signals architecture

Proposed solution

Extend AOT to inline static template bindings as direct DOM operations.
Retain a minimal runtime for DI, event binding, and reactive state updates.
Make this an opt-in build mode to preserve backward compatibility.

Alternatives considered

Relying on Ivy AOT compilation alone: Angular’s Ahead-of-Time compilation and tree-shaking already reduce runtime overhead, but they still depend on a fairly large core runtime (zone.js, change detection, DI). This proposal goes further by removing most of that runtime for static components.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions