Skip to content

Commit

Permalink
test: remove duplicated playgrounds that are tested on other reposito…
Browse files Browse the repository at this point in the history
…ries
  • Loading branch information
patak-dev committed Dec 3, 2022
1 parent 05959c7 commit 607ff09
Show file tree
Hide file tree
Showing 198 changed files with 6 additions and 4,349 deletions.
10 changes: 5 additions & 5 deletions docs/guide/ssr.md
Expand Up @@ -18,8 +18,8 @@ If you have questions, the community is usually helpful at [Vite Discord's #ssr

Vite provides built-in support for server-side rendering (SSR). The Vite playground contains example SSR setups for Vue 3 and React, which can be used as references for this guide:

- [Vue 3](https://github.com/vitejs/vite/tree/main/playground/ssr-vue)
- [React](https://github.com/vitejs/vite/tree/main/playground/ssr-react)
- [Vue 3](https://github.com/vitejs/vite-plugin-vue/tree/main/playground/ssr-vue)
- [React](https://github.com/vitejs/vite-plugin-vue/tree/main/playground/ssr-react)

## Source Structure

Expand Down Expand Up @@ -177,7 +177,7 @@ Then, in `server.js` we need to add some production specific logic by checking `
- Move the creation and all usage of the `vite` dev server behind dev-only conditional branches, then add static file serving middlewares to serve files from `dist/client`.
Refer to the [Vue](https://github.com/vitejs/vite/tree/main/playground/ssr-vue) and [React](https://github.com/vitejs/vite/tree/main/playground/ssr-react) demos for a working setup.
Refer to the [Vue](https://github.com/vitejs/vite-plugin-vue/tree/main/playground/ssr-vue) and [React](https://github.com/vitejs/vite-plugin-react/tree/main/playground/ssr-react) demos for a working setup.
## Generating Preload Directives
Expand All @@ -201,11 +201,11 @@ const html = await vueServerRenderer.renderToString(app, ctx)
// ctx.modules is now a Set of module IDs that were used during the render
```
In the production branch of `server.js` we need to read and pass the manifest to the `render` function exported by `src/entry-server.js`. This would provide us with enough information to render preload directives for files used by async routes! See [demo source](https://github.com/vitejs/vite/blob/main/playground/ssr-vue/src/entry-server.js) for a full example.
In the production branch of `server.js` we need to read and pass the manifest to the `render` function exported by `src/entry-server.js`. This would provide us with enough information to render preload directives for files used by async routes! See [demo source](https://github.com/vitejs/vite-plugin-vue/blob/main/playground/ssr-vue/src/entry-server.js) for a full example.
## Pre-Rendering / SSG
If the routes and the data needed for certain routes are known ahead of time, we can pre-render these routes into static HTML using the same logic as production SSR. This can also be considered a form of Static-Site Generation (SSG). See [demo pre-render script](https://github.com/vitejs/vite/blob/main/playground/ssr-vue/prerender.js) for working example.
If the routes and the data needed for certain routes are known ahead of time, we can pre-render these routes into static HTML using the same logic as production SSR. This can also be considered a form of Static-Site Generation (SSG). See [demo pre-render script](https://github.com/vitejs/vite-plugin-vue/blob/main/playground/ssr-vue/prerender.js) for working example.
## SSR Externals
Expand Down
30 changes: 0 additions & 30 deletions playground/react-classic/App.jsx

This file was deleted.

39 changes: 0 additions & 39 deletions playground/react-classic/__tests__/react.spec.ts

This file was deleted.

10 changes: 0 additions & 10 deletions playground/react-classic/index.html

This file was deleted.

23 changes: 0 additions & 23 deletions playground/react-classic/package.json

This file was deleted.

16 changes: 0 additions & 16 deletions playground/react-classic/vite.config.ts

This file was deleted.

56 changes: 0 additions & 56 deletions playground/react-emotion/App.jsx

This file was deleted.

46 changes: 0 additions & 46 deletions playground/react-emotion/__tests__/react.spec.ts

This file was deleted.

10 changes: 0 additions & 10 deletions playground/react-emotion/index.html

This file was deleted.

27 changes: 0 additions & 27 deletions playground/react-emotion/package.json

This file was deleted.

18 changes: 0 additions & 18 deletions playground/react-emotion/vite.config.ts

This file was deleted.

14 changes: 0 additions & 14 deletions playground/react-env/App.jsx

This file was deleted.

6 changes: 0 additions & 6 deletions playground/react-env/__tests__/react.spec.ts

This file was deleted.

10 changes: 0 additions & 10 deletions playground/react-env/index.html

This file was deleted.

18 changes: 0 additions & 18 deletions playground/react-env/package.json

This file was deleted.

16 changes: 0 additions & 16 deletions playground/react-env/vite.config.ts

This file was deleted.

8 changes: 0 additions & 8 deletions playground/react-sourcemap/App.jsx

This file was deleted.

0 comments on commit 607ff09

Please sign in to comment.