-
Notifications
You must be signed in to change notification settings - Fork 2
[Vite] Instruct users to create plugins with Vite instead of CRA #23
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,42 +67,54 @@ While you are not required to use React for your plugin, it must be written in | |
Javascript and React is recommended. We support both a standard Javascript API | ||
and a React Hooks API. | ||
|
||
#### Create a Project with React | ||
#### Create a Project with Vite | ||
|
||
NOTE: Facebook's [create-react-app](https://github.com/facebook/create-react-app) breaks with React 19 (see https://github.com/facebook/create-react-app/issues/17004). | ||
|
||
You should use [vite](https://github.com/vitejs/vite) instead to create custom plugins. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Edit the wording to not use |
||
|
||
1. Open your terminal and navigate to the directory you want to create your | ||
project in. | ||
2. Create your new project. We recommend using Facebook’s | ||
[`create-react-app`](https://create-react-app.dev/). | ||
2. Create your new project. We recommend using | ||
[`create-vite`](https://www.npmjs.com/package/create-vite). | ||
|
||
```sh | ||
npx create-react-app <my-cool-plugin> | ||
yarn create vite <my-cool-plugin> | ||
# or | ||
npm create vite@latest <my-cool-plugin> | ||
``` | ||
|
||
3. Navigate to the project's main directory. | ||
3. Then follow the prompts! You can also directly specify the project name and the template you want to use via additional command line options. For example, to scaffold a Vite + Vue project, run: | ||
|
||
```sh | ||
yarn create vite my-vue-app --template vue | ||
``` | ||
|
||
4. Navigate to the project's main directory. | ||
|
||
```sh | ||
cd <my-cool-plugin> | ||
``` | ||
|
||
4. Use your package manager to install Sigma’s plugin library. We recommend | ||
5. Use your package manager to install Sigma’s plugin library. We recommend | ||
using `yarn`. | ||
|
||
```sh | ||
yarn add @sigmacomputing/plugin | ||
``` | ||
|
||
5. Spin up your local development server. | ||
6. Spin up your local development server. | ||
|
||
```sh | ||
yarn && yarn start | ||
yarn && yarn dev | ||
``` | ||
|
||
6. Start developing: | ||
7. Start developing: | ||
|
||
- Get started with Sigma’s Plugin APIs. | ||
- Test your plugin directly in a Sigma workbook using the Sigma Plugin Dev | ||
Playground. | ||
- By default, Create React App dev servers run on http://localhost:3000. | ||
- By default, Vite dev servers run on http://localhost:5173. | ||
|
||
## Testing your Plugin | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.