Skip to content

feat(platform-node): create platform-node based on angular/universal #12495

Closed

Description

@jeffbcross

Create platform-node inside this repository, to be consumed by Angular Universal and other packages that would rely on platform-node. By having it inside this repository, the package will be tested and updated alongside the core, and will be maintained by the core team.

The API should be generally compatible with the existing [platform-node](https://github.com/angular/universal/tree/master/modules/platform-node) inside the angular/universal repository so that Universal would ideally be able to just change its dependency to point at the @angular/platform-node npm package.

CC: @jeffwhelpley @gdi2290 @IgorMinar

Activity

  1. added
    refactoring
    on Oct 24, 2016
  2. self-assigned this
    on Oct 24, 2016
  3. PatrickJS commented on Oct 24, 2016

    @PatrickJS
    Contributor

    notes:

    • platform-node/node-http should be merged with http as main/browser fork.
    • serialize in NodePlatform shouldn't live in NodePlatform so you can mostly ignore this. Here's what's in the pipeline.
      • lifecycle hooks
      • view utils component id problems
      • check if the app is stable
      • injecting preboot
      • dehydrate resources
      • serialize document
      • dispose
    • ignore asyncPromiseSeries as rxjs is the correct way to manage the pipeline rather than promises
    • PlatformLocation can't live in platform due to the service having state but we need to have PlatformLocation in the platform for multiple application to use the same state.
    • platformNodeDynamic was created in the way it was due to limitation of core
    • 2.1.1 broke universal due to exports privates change with compiler
    • NodeDomRenderer needs to be refactored to remove a lot of code dealing with converting props to attributes and ensuring that attributes are strings. The whitelist needs to be reworked to reflect attributes when setting a prop.
    • node-location there were problems dealing with baseUrl/requestUrl/originUrl and what is the correct way to manage them compared to the browser's way of handling them
    • node-document should be merged with parse5 as parse and add serialize. .head, .body, .title need to grab new references (html component fix) and title needs to correctly set a text node.
    • parse5-adapter has a zone.js workaround for context in it as it's impossible otherwise since there are a few methods that were not made with more than one document in mind. This sort of can be fixed by reworking some of the services but then core needs to be updated. getHistory, getCookie, etc are also impossible without our zone workaround or core change

    There should be a Context service for configuration with a ZoneContext strategy to refactor the zone out the current solution. That way NodePlatform.withConfig can work again and AoT will work. The problem you will run into with constants are providers being created during platform or application before bootstrap (where dynamic config values can be used. Most dynamic configs are set at class definition time which causes a problem. For example, the URL and document are constant values that need to be dynamic per user). This problem has been a pain for location state.

    you can also view this old fork of commits that show how to convert a browser version to node
    https://github.com/IgorMinar/new-world-test/pull/9/files

    github-tipe-logo

  4. PatrickJS commented on Jan 13, 2017

    @PatrickJS
    Contributor

    close for #13822

    github-tipe-logo

  5. DzmitryShylovich commented on Feb 3, 2017

    @DzmitryShylovich
    Contributor
  6. angular-automatic-lock-bot commented on Sep 13, 2019

    @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 Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

effort2: daysrefactoring

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions