Skip to content

Conversation

@martikaljuve
Copy link
Contributor

Hey! Not sure if you are accepting PR-s for single-spa-related projects any more, but I'll just use my fork if not.

I'm using single-spa + single-spa-layout + vite-plugin-single-spa + @wjfe/single-spa-svelte.

I have a single microfrontend that is mounted to the page under two subroutes, with different props passed in each case.

Let's say the microfrontend "mfe1" is mounted as these variants:

// Variant A
{
  name: "mfe1",
  props: {
    mode: "A",
    foo: 100
  }
}
// Variant B
{
  name: "mfe1",
  props: {
    mode: "B",
    bar: "baz"
  }
}

If I follow these steps:

  1. mount Variant A
  2. unmount Variant A
  3. mount Variant B

Then Variant B is passed props like this:

props: {
  mode: "B",
  foo: 100,  // <-- SHOULD NOT BE HERE
  bar: "baz"
}

Getting the foo prop (only defined for Variant A) passed to Variant B is not expected.

I added a test that fails before the fix, and passes after the fix.

@webJose
Copy link
Contributor

webJose commented Nov 25, 2025

Hello. I'm no longer collaborating with the single-spa community. After all, I don't see single-spa doing any kind of advancements or improvements regardless of my history with the single-spa creator.

Having said that, I'm not opposed to merging and deploying so long I don't do the actual coding work. 😎

Since you did the work, I have no issues. I can merge this for you, no problem.

Allow me a day or so to add CI/CD, since I no longer want to do manual package deployments. The WJSoftware org has the CI/CD workflows already created. Just a matter of reusing them.

@webJose
Copy link
Contributor

webJose commented Nov 25, 2025

Shoot, OK. I just saw the workflows are there already. 😁

@webJose webJose changed the title Empty props on unmount fix: Empty props on unmount Nov 25, 2025
@webJose webJose merged commit b37b586 into WJSoftware:main Nov 25, 2025
1 check passed
@webJose
Copy link
Contributor

webJose commented Nov 25, 2025

Published in v1.0.1. Next time, please start by opening an issue as I believe documented issues help other users find what they're looking for.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants