pateketrueke / yrv

Your routing vibes! (for Svelte)
https://svelte.dev/repl/0f07c6134b16432591a9a3a0095a80de
161 stars 9 forks source link

Dynamic components #17

Closed intermundos closed 4 years ago

intermundos commented 4 years ago

As we talked before, this PR introduces use of dynamic components.

Now you can pass as component property either of 4:

  1. As slot - string/expression
  2. Svelte component
  3. import('..path/to/component') as promise
  4. () => import('..path/to/component') as function for async component loading and code splitting

This makes dynamic property redundant since we can now handle all types of component in one go, without need to use additional prop.

Pending property now can accept either String or Svelte component.

Tested on my local project and it work flawlessly.

Let me know what do you think. A.

intermundos commented 4 years ago

Changes done. Please review.

pateketrueke commented 4 years ago

Awesome, thank you!

intermundos commented 4 years ago

My pleasure!

Thank you for sharing this awesome lib with us!

When do you plan to publish it to NPM?

pateketrueke commented 4 years ago

Just published this new patch already. 💣