-
Notifications
You must be signed in to change notification settings - Fork 1
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
Upgrade to react-scripts 5 #249
Changes from all commits
78dab04
7a62500
327f2f0
aa0a3d1
eb310cf
9a85a78
89e043f
40af361
254ed9d
a10f741
63436e6
131b5d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
FROM node:16.13.2-alpine | ||
WORKDIR /app-prototype | ||
COPY package.json yarn.lock ./ | ||
RUN npx yarn@1.12.1 install --production | ||
RUN npx yarn@1.22.17 install | ||
COPY . . | ||
RUN DISABLE_ESLINT_PLUGIN=true npm run build | ||
RUN npm run build | ||
EXPOSE 3000 | ||
ENV NODE_ENV=production | ||
CMD npx --no-install serve -s |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,24 +3,16 @@ | |
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"@types/node": "^16.11.21", | ||
"@types/react": "^17.0.38", | ||
"@types/react-dom": "^17.0.11", | ||
"classnames": "^2.3.1", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"react-scripts": "4.0.3", | ||
"sass": "^1.45.1", | ||
"serve": "^13.0.2", | ||
"typescript": "^4.5.4" | ||
}, | ||
"devDependencies": { | ||
"@testing-library/dom": "^8.11.1", | ||
"@testing-library/jest-dom": "^5.16.1", | ||
"@testing-library/react": "^12.1.2", | ||
"@testing-library/user-event": "^13.5.0", | ||
"@types/jest": "^27.4.0", | ||
"eslint": "^7.32.0", | ||
"@types/node": "^16.11.21", | ||
"@types/react": "^17.0.38", | ||
"@types/react-dom": "^17.0.11", | ||
"classnames": "^2.3.1", | ||
"eslint": "^8.6.0", | ||
"eslint-config-prettier": "^8.1.0", | ||
"eslint-plugin-jest": "^25.3.4", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
|
@@ -30,16 +22,23 @@ | |
"lint-staged": "^12.1.4", | ||
"npm-run-all": "^4.1.3", | ||
"prettier": "2.5.1", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"react-scripts": "5.0.0", | ||
"sass": "^1.48.0", | ||
"serve": "^13.0.2", | ||
"shelljs": "^0.8.5", | ||
"stylelint": "^13.12.0", | ||
"stylelint-config-recommended-scss": "^4.3.0", | ||
"stylelint-config-standard": "^22.0.0", | ||
"stylelint": "^14.2.0", | ||
"stylelint-config-recommended-scss": "^5.0.2", | ||
"stylelint-config-standard": "^24.0.0", | ||
"stylelint-declaration-strict-value": "^1.8.0", | ||
"stylelint-scss": "^3.21.0" | ||
"stylelint-scss": "^4.1.0", | ||
"typescript": "^4.5.4", | ||
"web-vitals": "^2.1.3" | ||
}, | ||
"resolutions": { | ||
"@typescript-eslint/typescript-estree": "^5.6.0", | ||
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. 🗒️ I dropped this resolution |
||
"caniuse-lite": "^1.0.30001272" | ||
"caniuse-lite": "^1.0.30001299", | ||
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. 🗒️ Updated the caniuse-lite def to match what was installed from scratch |
||
"mini-css-extract-plugin": "2.4.7" | ||
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. 🤦 This is a temporary workaround for this issue: facebook/create-react-app#11930 |
||
}, | ||
"scripts": { | ||
"prepare": "husky install", | ||
|
@@ -71,7 +70,6 @@ | |
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not ie <= 11", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# https://www.robotstxt.org/robotstxt.html | ||
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. 🤔 Not sure if this was intentionally omitted before, but it was generated by create-react-app |
||
User-agent: * | ||
Disallow: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
pointer-events: none; | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
animation: App-logo-spin infinite 20s linear; | ||
animation: app-logo-spin infinite 20s linear; | ||
} | ||
} | ||
|
||
|
@@ -34,7 +34,7 @@ | |
color: colors.$blue; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
@keyframes app-logo-spin { | ||
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. 🗒️ New |
||
from { | ||
transform: rotate(0deg); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,16 @@ import React from "react"; | |
import ReactDOM from "react-dom"; | ||
import "./index.scss"; | ||
import App from "./App"; | ||
import reportWebVitals from "./reportWebVitals"; | ||
|
||
ReactDOM.render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
document.getElementById("root") | ||
); | ||
|
||
// If you want to start measuring performance in your app, pass a function | ||
// to log results (for example: reportWebVitals(console.log)) | ||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals | ||
reportWebVitals(); | ||
Comment on lines
+13
to
+17
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. 🗒️ Here's the boilerplate for web-vitals. More info on the linked page. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ReportHandler } from "web-vitals"; | ||
|
||
const reportWebVitals = (onPerfEntry?: ReportHandler) => { | ||
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. 🤣 Would be funny if this code affected these metrics. |
||
if (onPerfEntry && onPerfEntry instanceof Function) { | ||
import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { | ||
getCLS(onPerfEntry); | ||
getFID(onPerfEntry); | ||
getFCP(onPerfEntry); | ||
getLCP(onPerfEntry); | ||
getTTFB(onPerfEntry); | ||
}); | ||
} | ||
}; | ||
|
||
export default reportWebVitals; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
// allows you to do things like: | ||
// expect(element).toHaveTextContent(/react/i) | ||
// learn more: https://github.com/testing-library/jest-dom | ||
import "@testing-library/jest-dom/extend-expect"; | ||
import "@testing-library/jest-dom"; | ||
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. 🗒️ CRA generates this file with the shorter import (which matches the docs) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
@use "sass:color"; | ||
$blue: #61dafb; | ||
$blue-darker: darken($blue, 30%); | ||
$blue-lighter: lighten($blue, 5%); | ||
$blue-darker: color.adjust($blue, $lightness: -30%); | ||
$blue-lighter: color.adjust($blue, $lightness: 5%); | ||
Comment on lines
+1
to
+4
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. 🗒️ |
||
|
||
$white: #fff; | ||
$gray-28: #282c34; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗒️ CRA includes this extend now. I wonder if that includes
plugin:jest/recommended
, which makes the below extend a dupe.