portal-vue icon indicating copy to clipboard operation
portal-vue copied to clipboard

Google's new "portal" element

Open fimion opened this issue 5 years ago • 6 comments

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?

fimion avatar May 11 '19 13:05 fimion

Yeah I saw that as well... 😤😅

I think there's two things we could do:

  1. Write up a warning or small guide in the docs about how to deal with that.
  2. Release a new major version that changes the default name to <portal-source> or some other hyphenated (and therefore safe) name.

LinusBorg avatar May 11 '19 13:05 LinusBorg

I also think since this is still behind a flag in canary and only in chrome, there is time to warn people about this.

fimion avatar May 11 '19 13:05 fimion

Sure.

A new major would be required once this becomes standard though

LinusBorg avatar May 11 '19 14:05 LinusBorg

@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
}

tmorehouse avatar May 11 '19 14:05 tmorehouse

Good idea!

LinusBorg avatar May 11 '19 14:05 LinusBorg

And then in a major release, drop the older deprecated <portal>

tmorehouse avatar May 11 '19 14:05 tmorehouse