-
Notifications
You must be signed in to change notification settings - Fork 354
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(open in codesandbox button): optimize for long sandoxes #120
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/codesandbox/sandpack/6xMena4KZ2GL6Z4118YH1B4ARUeF |
8f4f43a
to
d3a9799
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments, but nothing to block the PR if you have other priorities right now
It seems the export for |
Hi @danilowoz, I just stumbled on this limitation (401 on long requests) and wanted to open an issue but then noticed this PR :) |
f9ca199
to
badadcd
Compare
badadcd
to
1420605
Compare
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. Latest deployment of this branch, based on commit 08ceba9:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small docs suggestion ❤️ Looks great tho!
Co-authored-by: Sanne <sanne@codesandbox.io>
Co-authored-by: Sanne <sanne@codesandbox.io>
This introduces a breaking change due to
useCodeSandboxLink
is no longer used to generate the URL. From now on, theUnstyledOpenInCodeSandboxButton
is responsible for managing the URL or the form that will create a new sandbox in the CodeSandbox.In the previous approach, all the parameters to create a sandbox in the CodeSandbox were attached directly in the URL, making it easily reach the
request too long (401)
. That's why we deprecated the hook in favor of using a whole new component, which is responsible for either using an anchor (for short sandboxes) or a form-POST (for long sandboxes).The
UnstyledOpenInCodeSandboxButton
is a basic component that doesn't carry any style, so if you want a ready-to-use component, use theOpenInCodeSandboxButton
instead, which contains the CodeSandbox logo and the same functionality.Migration guide:
CSB-519