Skip to content

Commit

Permalink
drop create-react-app
Browse files Browse the repository at this point in the history
  • Loading branch information
n1ru4l committed Feb 24, 2023
1 parent 183ee72 commit 0ee4c0c
Show file tree
Hide file tree
Showing 109 changed files with 574 additions and 5,942 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": ["website", "example-*", "@graphql-codegen/client-preset-swc-plugin"],
"ignore": ["website", "example-*", "@graphql-codegen/client-preset-swc-plugin", "example-apollo-client-swc-plugin"],
"changelog": [
"@changesets/changelog-github",
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.swc
7 changes: 7 additions & 0 deletions examples/react/apollo-client-swc-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Apollo Client Vite SWR Example

Example of using the SWC plugin for smaller bundle size.

```bash
yarn dev
```
File renamed without changes.
13 changes: 13 additions & 0 deletions examples/react/apollo-client-swc-plugin/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
27 changes: 27 additions & 0 deletions examples/react/apollo-client-swc-plugin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "example-apollo-client-swc-plugin",
"version": "0.1.0",
"private": true,
"dependencies": {
"@apollo/client": "^3.6.9",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@graphql-codegen/client-preset-swc-plugin": "0.1.1",
"@graphql-codegen/client-preset": "^2.0.0",
"@graphql-codegen/cli": "^3.0.0",
"@vitejs/plugin-react-swc": "^3.2.0",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.11",
"typescript": "4.9.5",
"vite": "^4.1.0"
},
"scripts": {
"dev": "vite",
"build": "vite build",
"test": "node scripts/test.js",
"test:end2end": "exit 0",
"codegen": "graphql-codegen --config codegen.ts"
}
}
1 change: 1 addition & 0 deletions examples/react/apollo-client-swc-plugin/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import './main.css';
import App from './App';
import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';

Expand All @@ -9,7 +9,7 @@ const client = new ApolloClient({
cache: new InMemoryCache(),
});

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
const root = ReactDOM.createRoot(document.getElementById('app') as HTMLElement);
root.render(
<React.StrictMode>
<ApolloProvider client={client}>
Expand Down
18 changes: 18 additions & 0 deletions examples/react/apollo-client-swc-plugin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"module": "ESNext",
"moduleResolution": "Node",
"strict": true,
"jsx": "preserve",
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"lib": ["ESNext", "DOM"],
"skipLibCheck": true,
"noEmit": true
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"references": [{ "path": "./tsconfig.node.json" }]
}
9 changes: 9 additions & 0 deletions examples/react/apollo-client-swc-plugin/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
14 changes: 14 additions & 0 deletions examples/react/apollo-client-swc-plugin/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* eslint-disable import/no-extraneous-dependencies */
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({
plugins: [
['@graphql-codegen/client-preset-swc-plugin', { artifactDirectory: './src/gql', gqlTagName: 'graphql' }],
],
}),
],
});
13 changes: 13 additions & 0 deletions examples/react/apollo-client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
22 changes: 5 additions & 17 deletions examples/react/apollo-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,23 @@
"devDependencies": {
"@graphql-codegen/cli": "^3.2.1",
"@graphql-codegen/client-preset": "^2.1.0",
"@vitejs/plugin-react": "^3.1.0",
"@types/jest": "^27.5.2",
"@types/node": "^18.11.18",
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.10",
"react-scripts": "^5.0.1",
"typescript": "4.9.5",
"serve": "14.2.0",
"cypress": "12.6.0",
"start-server-and-test": "1.15.4"
"start-server-and-test": "1.15.4",
"vite": "^4.1.0"
},
"scripts": {
"dev": "react-scripts start",
"build": "react-scripts build",
"dev": "vite",
"build": "vite build",
"start": "serve -s build",
"test": "cypress run",
"test:end2end": "start-server-and-test start http://localhost:3000 test",
"eject": "react-scripts eject",
"codegen": "graphql-codegen --config codegen.ts"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Binary file removed examples/react/apollo-client/public/favicon.ico
Binary file not shown.
40 changes: 0 additions & 40 deletions examples/react/apollo-client/public/index.html

This file was deleted.

Binary file removed examples/react/apollo-client/public/logo192.png
Binary file not shown.
Binary file removed examples/react/apollo-client/public/logo512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions examples/react/apollo-client/public/manifest.json

This file was deleted.

3 changes: 0 additions & 3 deletions examples/react/apollo-client/public/robots.txt

This file was deleted.

1 change: 1 addition & 0 deletions examples/react/apollo-client/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import './main.css';
import App from './App';
import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';

Expand All @@ -9,7 +9,7 @@ const client = new ApolloClient({
cache: new InMemoryCache(),
});

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
const root = ReactDOM.createRoot(document.getElementById('app') as HTMLElement);
root.render(
<React.StrictMode>
<ApolloProvider client={client}>
Expand Down
1 change: 0 additions & 1 deletion examples/react/apollo-client/src/react-app-env.d.ts

This file was deleted.

23 changes: 11 additions & 12 deletions examples/react/apollo-client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"target": "ESNext",
"useDefineForClassFields": true,
"module": "ESNext",
"moduleResolution": "Node",
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"jsx": "preserve",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
"esModuleInterop": true,
"lib": ["ESNext", "DOM"],
"skipLibCheck": true,
"noEmit": true
},
"include": ["src"]
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"references": [{ "path": "./tsconfig.node.json" }]
}
9 changes: 9 additions & 0 deletions examples/react/apollo-client/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
8 changes: 8 additions & 0 deletions examples/react/apollo-client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable import/no-extraneous-dependencies */
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
});
7 changes: 0 additions & 7 deletions examples/react/babel-optimized/.babelrc.js

This file was deleted.

46 changes: 0 additions & 46 deletions examples/react/babel-optimized/README.md

This file was deleted.

Loading

0 comments on commit 0ee4c0c

Please sign in to comment.