Ideally module IDs stay the same once created. Not sure how they are determined, but if it's based on file-content, that shouldn't be the case either. It seems every single module ID name changes whenever you update the sandbox.
For example, the 2 links on the homepage (and all my articles) don't correctly deep-link anymore after making some updates.
Oh yes I forgot about this issue. A solution would be to make shortid deterministic based on title and directoryshortid. That should work. I don't have time today to try it out, but I'll keep you posted!
I have a better idea, let's put the path in the URL, like you said before. This is easier to read for the user and stays consistent between updates. Waddaya think @faceyspacey?
that's the way to go. u mentioned that it didn't work well with the inner iframe. You said that when you push on the parent window it breaks the inner iframe.
If we can work around that, this is a must. I have a hard time believing that's an issue, but if it is, it is.
need this asap by the way. u should just change how u do module IDs immediately and worry about the paths later.
all my embeds are broken. they're looking at how to call ReactDOM.render. not good for business.
that's the way to go. u mentioned that it didn't work well with the inner iframe.
Ah, I think I misunderstood then. It does work with inner frame, but it doesn't if we mess with the history (so update browser url on each click). It's possible to use paths in url.
I have changed the shortid generation to be deterministic based on path, this means that the shortids will be consistent. I need to find a time to deploy, I'm on an unstable connection atm. This will just be a quick solution for now, best case scenario would be paths of course. Maybe you can pick this up if you want to (all functions are already there modules/selectors.js -> getModulePath), I can also look at it somewhere in the coming week.
This is done! Now we use paths for module references.
that's excellent. this should give codesandbox deep linking lots of mileage.
Most helpful comment
Ah, I think I misunderstood then. It does work with inner frame, but it doesn't if we mess with the history (so update browser url on each click). It's possible to use paths in url.
I have changed the shortid generation to be deterministic based on path, this means that the shortids will be consistent. I need to find a time to deploy, I'm on an unstable connection atm. This will just be a quick solution for now, best case scenario would be paths of course. Maybe you can pick this up if you want to (all functions are already there
modules/selectors.js -> getModulePath), I can also look at it somewhere in the coming week.