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(client): use stable sw id #1169

Merged
merged 4 commits into from
Jul 31, 2024
Merged

fix(client): use stable sw id #1169

merged 4 commits into from
Jul 31, 2024

Conversation

danilowoz
Copy link
Member

@danilowoz danilowoz commented Jul 31, 2024

When using Private Package, Sandpack needs a deterministic bundler URL to persist the authentication token in the cookies. Clearly, this is not compatible with how SW works because it needs unique URLs by sandbox.

So, this implements a new feature to generate a deterministic short id based on the useId React hook (DOM location-based and probably more), and an SHA generated by files. I believe this should be okay to avoid conflicts between sandboxes.

Copy link

codesandbox bot commented Jul 31, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

vercel bot commented Jul 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sandpack-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 31, 2024 1:32pm
sandpack-landing 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jul 31, 2024 1:32pm
sandpack-theme 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jul 31, 2024 1:32pm

Copy link

codesandbox-ci bot commented Jul 31, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@danilowoz danilowoz merged commit 8c15b85 into main Jul 31, 2024
12 of 13 checks passed
@danilowoz danilowoz deleted the draft/romantic-blackburn branch July 31, 2024 13:47
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