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

Elements adds ng-version attribute to every Angular element on the page #23329

Open
vikerman opened this issue Apr 11, 2018 · 6 comments
Open
Assignees
Labels
area: elements Issues related to Angular Elements area: server Issues related to server-side rendering freq3: high P4 A relatively minor issue that is not relevant to core functions state: confirmed type: bug/fix
Milestone

Comments

@vikerman
Copy link
Contributor

vikerman commented Apr 11, 2018

Currently every top-level custom element tag gets a ng-version attribute

Ex.

...
<my-element name="Hello World!!" ng-version="6.0.0-rc.1" >
  <div>Hello World!!</div>
</my-element>
...

For server side rendered custom elements this adds extra bytes for every custom element on the page.

@vikerman vikerman added the area: elements Issues related to Angular Elements label Apr 11, 2018
@ngbot ngbot bot added this to the needsTriage milestone Apr 11, 2018
@robwormald
Copy link
Contributor

cc @StephenFluin

@artem-galas
Copy link
Contributor

I would like to handle this.
Could you please explain what are expected behaviour?

@gkalpak
Copy link
Member

gkalpak commented May 29, 2020

Confirming this still happens in v9. Not sure whether should be addressed on ngUniversal side or in core (or elements).

@gkalpak gkalpak added area: server Issues related to server-side rendering state: confirmed triage #1 labels May 29, 2020
@CaerusKaru
Copy link
Member

@gkalpak My guess is that it's primarily an elements issue in terms of how it integrates with core. There is no specific code in platform-server that dictates how ng-version is added to elements.

@CaerusKaru
Copy link
Member

Seems like the issue is here. The root element is always set as the custom element being initialized. Maybe we could provide a custom implementation for SSR that sets this to null.

@gkalpak
Copy link
Member

gkalpak commented Jun 22, 2020

Not sure what the correct fix is, but afaict setting to null will have other unwanted side-effects (such as creating a new element for the component).

@jelbourn jelbourn added P4 A relatively minor issue that is not relevant to core functions and removed severity2: inconvenient labels Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: elements Issues related to Angular Elements area: server Issues related to server-side rendering freq3: high P4 A relatively minor issue that is not relevant to core functions state: confirmed type: bug/fix
Projects
None yet
Development

No branches or pull requests

8 participants