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

react-live swizzle assumes "eject" option was selected #7735

Closed
2 tasks done
SheetJSDev opened this issue Jul 7, 2022 · 1 comment
Closed
2 tasks done

react-live swizzle assumes "eject" option was selected #7735

SheetJSDev opened this issue Jul 7, 2022 · 1 comment
Labels
documentation The issue is related to the documentation of Docusaurus status: accepting pr This issue has been accepted, and we are looking for community contributors to implement this

Comments

@SheetJSDev
Copy link
Contributor

Have you read the Contributing Guidelines on issues?

Description

https://docusaurus.io/docs/markdown-features/code-blocks#imports

If you need more imports available, swizzle the react-live scope:

The current command snippet is

# npm
npm run swizzle @docusaurus/theme-live-codeblock ReactLiveScope
# yarn
yarn run swizzle @docusaurus/theme-live-codeblock ReactLiveScope

On first run:

? Which swizzle action do you want to do? › - Use arrow-keys. Return to submit.
❯   Wrap (Unsafe)
    Eject (Unsafe)
    [Exit]

Comparing the generated code to the code snippet that follows, the docs assume that the user chooses to "Eject" rather than "Wrap".

To avoid confusion, the command snippets should include the flag to eject by default:

# use eject but keep unsafe warning
npm run swizzle @docusaurus/theme-live-codeblock ReactLiveScope -- --eject

Note: The unsafe warning can be suppressed with

# use eject and suppress 
npm run swizzle @docusaurus/theme-live-codeblock ReactLiveScope -- --eject --danger

but it may make more sense to add a warning.

Self-service

  • I'd be willing to address this documentation request myself.
@SheetJSDev SheetJSDev added documentation The issue is related to the documentation of Docusaurus status: needs triage This issue has not been triaged by maintainers labels Jul 7, 2022
@Josh-Cena Josh-Cena removed the status: needs triage This issue has not been triaged by maintainers label Jul 8, 2022
@Josh-Cena
Copy link
Collaborator

Yes, this doc was written before we had --wrap. Feel free to send a PR!

@Josh-Cena Josh-Cena added the status: accepting pr This issue has been accepted, and we are looking for community contributors to implement this label Jul 8, 2022
Josh-Cena pushed a commit that referenced this issue Jul 8, 2022
docs: swizzle react-live with eject (#7735)
slorber pushed a commit that referenced this issue Jul 14, 2022
docs: swizzle react-live with eject (#7735)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation The issue is related to the documentation of Docusaurus status: accepting pr This issue has been accepted, and we are looking for community contributors to implement this
Projects
None yet
Development

No branches or pull requests

2 participants