Skip to content

Deterministic transport references #3

@loreanvictor

Description

@loreanvictor

Transport references are generated randomly, which results in generated files being different every time they are built even if the actual DOM does not have any changes. A better option would be to somehow make the transport references deterministic while maintaining their uniqueness across the DOM tree.

The main difficulty of that is situations where a compiled HTML snippet is used across multiple HTML files. In that situation the transport references within the re-used snippet should not collide with transport references within the host HTML.

Potential solutions:

  • default to a super-deterministic transport ref generator like a counter, then allow for namespacing, either via the StaticRenderer, via Context object, etc. the problem is that this is not a fix, but rather opening up API surface and allowing users to implement context-based fixes (it is notable that this is also what JSS does and it doesn't look that bad over there).
  • use document.currentScript to avoid needing a transport reference to begin with. the problem is that then we would be unable to support IE anymore.

The original discussion on this matter happened in this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions