single-spa / single-spa-svelte

a single-spa plugin for svelte applications
Apache License 2.0
20 stars 3 forks source link

Is this active? #5

Closed northkode closed 4 years ago

northkode commented 4 years ago

Is there active development on this?

How does one use this to pass data to initialized component dynamically? etc?

joeldenning commented 4 years ago

Hi @northkode, the single-spa core team (5 people) maintain this project. As you can see in the git history, we haven't updated this project in a couple years. But it was working then when we worked on it then.

We'd be happy to fix any issues you find with it, and also add any features that are missing. To pass data to the initialized component, you can use the data property (and also maybe the props property):

const lifecycles = singleSpaSvelte({
  component: MySvelteComponent,
  data: {
    foo: 'bar'
  }
})

^ Are you referring to something different than this in your question? There is also the possibility of using single-spa props. They are not yet implemented in single-spa-svelte, but we could add them if they'd be helpful to you.

northkode commented 4 years ago

Hey Joel, Yes sorry, I'm referring to the spa props based on outside lifecycle hooks. If those could be added to this for support that would be fantastic 👍🏻

I'm slowing integrating this as a way to move forward with a massive application I'm writing as I see the value of the import maps for dynamic publishing of certain parts of the app.

Thanks for your help!

joeldenning commented 4 years ago

See #6 which will resolve this

northkode commented 4 years ago

Thanks ill take a look!

Is there a way to call navigateToUrl with props that inject into that component? it seems sometimes you want runtime props based on user interaction instead of inside pub/sub or dispatchers?

northkode commented 4 years ago

@joeldenning am i missing something, i can't find the documentation for how to use single-spa props and how that actually gets passed down into my bundle? the documentation isn't overly clear or I can't seem to find it.

joeldenning commented 4 years ago

single-spa-svelte@2.0.0 is published with support for single-spa props, making domElementGetter optional, and support with latest versions of svelte. https://github.com/single-spa/single-spa-svelte/releases/tag/v2.0.0

northkode commented 4 years ago

Thanks @joeldenning

joeldenning commented 4 years ago

i can't find the documentation for how to use single-spa props and how that actually gets passed down into my bundle? the documentation isn't overly clear or I can't seem to find it.

This is a feature I implemented yesterday, which is why it was not in the documentation. I've added it to the documentation in https://github.com/single-spa/single-spa.js.org/pull/190.

northkode commented 4 years ago

@joeldenning perfect. Thank you!