Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Scope local storage to package name and branch name #54

merged 1 commit into from Mar 29, 2019


Copy link

commented Mar 29, 2019

Playroom's local storage is currently using playroom as the key, which is fine if you only run a single playroom. However, if you run different playrooms on the same URL or domain/subdomain (e.g. you have multiple component libraries, or you're running the examples in this repo) the local storage is shared across all them, which can cause issues—particularly when trying to restore code from a previous session.

To fix this, we now scope the storage to the name of the package (by finding the nearest package.json and reading the name field) and to the current git branch name. If either of these fail to be read correctly, we'll exclude them from the final key.

@markdalgleish markdalgleish merged commit 0dc59d3 into master Mar 29, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed

@markdalgleish markdalgleish deleted the storage-key branch Mar 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.