Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deterministic transport references #3

Open
loreanvictor opened this issue Jun 17, 2020 · 1 comment
Open

Deterministic transport references #3

loreanvictor opened this issue Jun 17, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@loreanvictor
Copy link
Contributor

loreanvictor commented Jun 17, 2020

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.

@loreanvictor
Copy link
Contributor Author

I personally would wait a year until IE usage dies off, and then switch to document.currentScript. We could potentially even decide to drop IE support sooner as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant