portal-vue
portal-vue copied to clipboard
Google's new "portal" element
So, I saw this from i/o 2019 yesterday, and figured i'd go ahead and raise the issue here.
https://web.dev/hands-on-portals/
it looks like google is wanting to create a <portal>
standard for linking between pages.
Would it be helpful to update the docs and examples to use portal-vue
as the component name in anticipation of google trying to push this through?
Yeah I saw that as well... 😤😅
I think there's two things we could do:
- Write up a warning or small guide in the docs about how to deal with that.
- Release a new major version that changes the default name to
<portal-source>
or some other hyphenated (and therefore safe) name.
I also think since this is still behind a flag in canary and only in chrome, there is time to warn people about this.
Sure.
A new major would be required once this becomes standard though
@LinusBorg you could prep people with a new element name (i.e. <portal-source>
) while still being backwards compatible (by providing <portal>
as well):
function install(Vue: VueConstructor<Vue>, options: PluginOptions = {}) {
Vue.component(options.portalName || 'PortalSource', Portal)
Vue.component(options.portalName || 'Portal', Portal)
Vue.component(options.portalTargetName || 'PortalTarget', PortalTarget)
Vue.component(options.MountingPortalName || 'MountingPortal', MountingPortal)
}
// ...
export {
Portal,
Portal as PortalSource,
PortalTarget,
MountingPortal,
Wormhole
}
Good idea!
And then in a major release, drop the older deprecated <portal>