Skip to content

Pluggable NgModules with AoT compatibility #13218

Closed as not planned
Closed as not planned

Description

@matt-psaltis

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

I'll preface this by saying I think I have a basic understanding of some of the technical challenges here - I expect its a much bigger problem space. Essentially I'm trying to recreate our server side development process where teams work against agreed contracts and their code is consumed as optional plugins into the core system. I'm specifically interested in AoT compatibility here because of our observed application performance increases.

Current behavior
When using AoT, Angular 2 currently supports monolithic applications where there is a clear compile time coherence between all NgModules.

Expected behavior (Expected is a bit strong here - desired?)
I am requesting techniques either through additional documentation or new supported features which allow for AoT compiled NgModules to be registered at runtime into the DI container. Furthermore, NgModules registered at runtime can be imported by other NgModules such that the exports of the module are available for use. Routers treat these as lazy loaded modules so routes become part of the route tree.

Application composition:
Main application:

  • Built by core application team.
  • Contains core application logic as well as shared vendor libraries.
  • Contains call to bootstrapModuleFactory. Application boots from here.

Plugin 1..n:

  • Built by auxiliary teams.
  • Teams need to be able to compile the plugin for production without duplicating vendor code.
  • Plugins register themselves with core application at runtime.
  • Plugins should be able to add additional multi provider entries to existing multi providers.
  • Plugins should be able to register additional forChild routes.

Currently using TypeScript and Webpack 2 with ngtools/webpack for AoT.

Activity

  1. added
    area: core
    on Dec 5, 2016
  2. added
    feature
    on Apr 10, 2017
  3. added this to the Backlog milestone on Jan 23, 2018
  4. added
    feature: under consideration
    on Jun 4, 2021
  5. alxhub commented on Mar 30, 2024

    @alxhub
    Member

    I'm going to close this issue as I think a combination of evolutions since it was originally filed make it obsolete:

    • Angular has shifted away from NgModules as an architectural piece.
    • Microfrontends exist, and try to address the problem of multiple teams authoring and deploying independently.
    • Angular has gotten more capable when it comes to lazy loading and providers.
  6. angular-automatic-lock-bot commented on Apr 30, 2024

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  7. locked and limited conversation to collaborators on Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: corefeaturefeature: under consideration

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions