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

Support multiple vue app's on one page (i.e. vuetify 2.0 compatiblity) #372

Closed
pimlie opened this issue Jun 1, 2019 · 0 comments · Fixed by #373
Closed

Support multiple vue app's on one page (i.e. vuetify 2.0 compatiblity) #372

pimlie opened this issue Jun 1, 2019 · 0 comments · Fixed by #373

Comments

@pimlie
Copy link
Collaborator

pimlie commented Jun 1, 2019

Reported by @aldarund on discord.

If there are multiple top-level Vue-components (e.g. two apps or 1 app with off-document components) then the meta data will be overwritten completely when each app updates with the data (or lack of) of that vue app only. Eg in the case of off-document components which dont specify any metainfo , this means that all metadata is removed from the webpage once the off-doc component is updated

Vuetify 2.0 will use off-document components for eg overlays.

Proposal:

  • Identify the origin app of each metadata tag by using this.$root._uid as value for data-${attribute:=vue-meta} (this root uid probably needs to be stored separately on ssr)
  • Metadata with a $tagIDKeyName are listed under special value -1
  • If one of the app updates:
    • only replace/remove values specified by the corresponding app identifier
    • metadata tags with a $tagIDKeyName can be overwritten by any app

Disadvantages:

  • There will be no general merge of metadata of different apps, so its possible to generate non-validating html which contains more then one of the same tag while the spec specify that tag should be unique. Eg its up to the user to solve the issue of two title tags being added if both apps specify a title.

The title is a bad example as we update that on the client with document.title. So the title will always be set to the title of the last app that updated its metadata

@manniL @atinux @pi0 would appreciate your insights on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant