Skip to content

Remove react-scripts #937

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 53 commits into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
6421f57
Drop react-scripts
Dreamsorcerer May 29, 2025
b8f13cd
Update package.json
Dreamsorcerer May 29, 2025
f413a2f
Update package.json
Dreamsorcerer May 29, 2025
c89aed4
Rename admin-js/public/index.html to admin-js/index.html
Dreamsorcerer May 29, 2025
8d165af
Create vite.config.js
Dreamsorcerer May 29, 2025
b8ebc19
Update vite.config.js
Dreamsorcerer May 29, 2025
6657869
Rename index.js to index.jsx
Dreamsorcerer May 29, 2025
5fdb31d
Rename App.js to App.jsx
Dreamsorcerer May 29, 2025
e906d32
Update vite.config.js
Dreamsorcerer May 29, 2025
ccba67e
Update App.jsx
Dreamsorcerer May 29, 2025
e316bd5
Update vite.config.js
Dreamsorcerer May 29, 2025
5521f96
Update package.json
Dreamsorcerer May 29, 2025
8d55178
Update vite.config.js
Dreamsorcerer May 29, 2025
e1fc091
Update vite.config.js
Dreamsorcerer May 29, 2025
54b0d86
Update ci.yml
Dreamsorcerer May 29, 2025
72355cf
Update package.json
Dreamsorcerer May 29, 2025
e7c9b49
Update package.json
Dreamsorcerer May 29, 2025
04796f9
Delete admin-js/babel.config.js
Dreamsorcerer May 29, 2025
8a2994b
Create babel.config.js
Dreamsorcerer May 29, 2025
265b3cd
Update package.json
Dreamsorcerer May 29, 2025
8742aef
Update ci.yml
Dreamsorcerer May 29, 2025
6c45f1f
Update package.json
Dreamsorcerer May 29, 2025
bd90f36
Update ci.yml
Dreamsorcerer May 29, 2025
bb2d89a
Update ci.yml
Dreamsorcerer May 29, 2025
3812a3e
Rename index.jsx to admin.jsx
Dreamsorcerer May 29, 2025
e629ad0
Update vite.config.js
Dreamsorcerer May 29, 2025
33070cf
Update package.json
Dreamsorcerer May 29, 2025
bc3779e
Update package.json
Dreamsorcerer May 29, 2025
584fdc4
Delete admin-js/index.html
Dreamsorcerer May 29, 2025
925e41d
Update package.json
Dreamsorcerer May 29, 2025
ae2e378
Update vite.config.js
Dreamsorcerer May 29, 2025
019bef6
Update vite.config.js
Dreamsorcerer May 29, 2025
17db0fd
Update package.json
Dreamsorcerer May 29, 2025
e217bcf
Update ci.yml
Dreamsorcerer May 29, 2025
372a0df
Update ci.yml
Dreamsorcerer May 29, 2025
a37eaf2
Update ci.yml
Dreamsorcerer May 29, 2025
d043708
Update ci.yml
Dreamsorcerer May 29, 2025
8394ecd
Update ci.yml
Dreamsorcerer May 29, 2025
18a182b
Update package.json
Dreamsorcerer May 29, 2025
2eded32
Update package.json
Dreamsorcerer May 29, 2025
f535abe
Update ci.yml
Dreamsorcerer May 29, 2025
d81b05c
Update ci.yml
Dreamsorcerer May 29, 2025
b6c1119
Update .github/workflows/ci.yml
Dreamsorcerer May 29, 2025
6f32484
Update ci.yml
Dreamsorcerer May 29, 2025
4b29a7f
Merge branch 'master' into Dreamsorcerer-patch-3
Dreamsorcerer May 30, 2025
59ed32f
Merge branch 'master' into Dreamsorcerer-patch-3
Dreamsorcerer Jun 2, 2025
dcc05af
Update .github/workflows/ci.yml
Dreamsorcerer Jun 2, 2025
9c299c1
Update ci.yml
Dreamsorcerer Jun 2, 2025
65b2b17
Merge branch 'master' into Dreamsorcerer-patch-3
Dreamsorcerer Jun 6, 2025
ebce8ac
Update .github/workflows/ci.yml
Dreamsorcerer Jun 6, 2025
7847b97
Apply suggestions from code review
Dreamsorcerer Jun 6, 2025
fdbb207
Update ci.yml
Dreamsorcerer Jun 6, 2025
2b6de44
Update .github/workflows/ci.yml
Dreamsorcerer Jun 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ jobs:
path: |
${{ env.yarn_cache }}
admin-js/node_modules
admin-js/yarn.lock
- name: Yarn install
if: steps.cache_node_modules.outputs.cache-hit != 'true'
run: yarn install
run: yarn install --production
working-directory: admin-js/
- name: Cache output files
uses: actions/cache@v4
Expand All @@ -85,10 +86,10 @@ jobs:
key: yarn-${{ hashFiles('admin-js/src/*') }}-${{ hashFiles('admin-js/yarn.lock') }}
path: |
aiohttp_admin/static/admin.js
aiohttp_admin/static/*.map
aiohttp_admin/static/admin.js.map
- name: Yarn build
if: steps.cache_admin_js.outputs.cache-hit != 'true'
run: yarn build
run: yarn build --minify false
working-directory: admin-js/

test:
Expand Down Expand Up @@ -235,10 +236,10 @@ jobs:
- name: Install yarn
run: sudo apt install yarn -y
- name: Yarn install
run: yarn install
run: yarn install --production
working-directory: admin-js/
- name: Yarn build
run: yarn build
run: yarn build --production
working-directory: admin-js/
- name: Install dependencies
run:
Expand Down
15 changes: 10 additions & 5 deletions admin-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"react": "18.2.0",
"react-admin": "4.16.7",
"react-dom": "18.2.0",
"terser": "5.40.0",
"vite": "6.2.6",

"create-react-admin": "4.16.7",
"ra-core": "4.16.7",
Expand All @@ -25,19 +27,22 @@
"ra-ui-materialui": "4.16.7"
},
"devDependencies": {
"@babel/preset-env": "7.27.2",
"@babel/preset-react": "7.27.1",
"@testing-library/dom": "10.4.0",
"@testing-library/jest-dom": "6.6.3",
"@testing-library/react": "16.3.0",
"@testing-library/user-event": "14.6.1",
"@ungap/structured-clone": "1.3.0",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"jest-fail-on-console": "3.3.1",
"react-scripts": "5.0.1"
"whatwg-fetch": "3.6.20"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build && (rm ../aiohttp_admin/static/*.js.map || true) && mv build/static/js/main.*.js ../aiohttp_admin/static/admin.js && mv build/static/js/main.*.js.map ../aiohttp_admin/static/ && rm -rf build/",
"test": "jest",
"eject": "react-scripts eject"
"dev": "vite",
"build": "vite build",
"test": "jest"
},
"eslintConfig": {
"extends": [
Expand Down
Empty file removed admin-js/public/index.html
Empty file.
4 changes: 2 additions & 2 deletions admin-js/src/App.js → admin-js/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ const App = (props) => {
STATE = aiohttpState;
const [loaded, setLoaded] = useState(STATE["js_module"] === null);
if (!loaded) {
// The inline comment skips the webpack import() and allows us to use the native
// The inline comment skips the Vite import() and allows us to use the native
// browser's import() function. Needed to dynamically import a module.
import(/* webpackIgnore: true */ STATE["js_module"]).then((mod) => {
import(/* @vite-ignore */ STATE["js_module"]).then((mod) => {
Object.assign(COMPONENTS, mod.components);
Object.assign(FUNCTIONS, mod.functions);
setLoaded(true);
Expand Down
File renamed without changes.
15 changes: 15 additions & 0 deletions admin-js/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig } from "vite";

export default defineConfig({
build: {
minify: "terser",
outDir: "../aiohttp_admin/static/",
rollupOptions: {
input: "src/admin.jsx",
output: {
entryFileNames: "[name].js"
}
},
sourcemap: true,
},
})