Skip to content

v1.3.0-beta.0 - Support for scoped slots

Pre-release
Pre-release
Compare
Choose a tag to compare
@LinusBorg LinusBorg released this 02 Jan 13:27
· 274 commits to next since this release

how to test this beta release

npm i -D portal-vue@next

About this beta

There's two main reasons we release this one as a beta:

  1. We refactored the whole Wormhole class (only internal APIs)
  2. We had to trick Vue to play nice with scoped slots and abstract component settings on the portals.

All tests pass, manual tests are looking fine as well, but we want to make sure this doesn't break anything for users.

Things we added

Scoped Slots!

This means you can now do this:

<portal to="target">
  <p slot-scope="props">
    {{props.message}}
  </p>
</portal>

<portal-target name="message" v-bind:slot-props="{message: 'Hi!'}">

Things we deprecated

  • the portal's targetEl prop is now officially deprecated and will be removed in 2.0, since it added a lot of internal complexity that can be solved more elegantly in userland.

Internals

  • Switched the Wormhole from a naked ES6 class to a Vue instance. This saves us some boilerplate from babel-transform-runtime. (#73)
  • Added integration tests (#43)

Things to come

We will try and push 2.0 quite quickly. Removing targetEl (#74) will be the only breaking change.