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

Add a link to docusaurus.new/ts in Playground page #8734

Closed
wants to merge 1 commit into from

Conversation

tats-u
Copy link
Contributor

@tats-u tats-u commented Mar 5, 2023

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Most changes in #8685 (comment) have been applied in #8723, but this link is not implemented.
This PR is to show users a link to create a new playground powered by TyepScript.

Test Plan

Test links

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/

Related issues/PRs

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Mar 5, 2023
@netlify
Copy link

netlify bot commented Mar 5, 2023

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 663945b
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/640434668e62850008b4030b
😎 Deploy Preview https://deploy-preview-8734--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented Mar 5, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 88 🟢 97 🟢 100 🟢 100 🟢 90 Report
/docs/installation 🟠 84 🟢 100 🟢 100 🟢 100 🟢 90 Report

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Support is not complete.

Try the link in a hidden browser session and you get redirected to the playground page.

If it works in your normal session it's just because we persisted your last accessed playground (probably a TS one) in a cookie.

Not sure we should have this feature because it probably means biasing toward using a specific vendor.

@@ -21,4 +21,6 @@ import {PlaygroundCardsRow} from '@site/src/components/Playground';

For convenience, we'll remember your choice next time you visit [docusaurus.new](https://docusaurus.new).

If you prefer a TypeScript playground, visit [docusaurus.new/ts](https://docusaurus.new/ts) instead.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this link doesn't work, there's no configured serverless function to handle it.

Also, how would we automatically choose between Codesandbox and Stackblitz without biasing toward one in particular??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you refer to and reuse the cookie used by the URL without ts suffix?
I can't believe the existence of people using CodeSandBox for JS and StackBlitz for TS or vice versa.

Copy link
Collaborator

@slorber slorber Mar 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cookie does not exist on the first visit.

When you first visit / it simply redirects to the playground page, not a specific sandbox. I could make /ts redirect to the playground page as well on the first visit if you want. Not sure it's worth it.

@slorber slorber marked this pull request as draft March 8, 2023 17:29
@slorber
Copy link
Collaborator

slorber commented Apr 13, 2023

Closing for now, because I don't see how to implement this feature without biasing toward a specific vendor (StackBlitz / CodeSandox) which i'd rather avoid

@slorber slorber closed this Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants