-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(react): Upgrade to React 18 (#14760)
* chore(react): Upgrade to React 18 * fix type errors * lib: bump palette to latest * test: use fresnel@6 in legacy tests * wip start addressing tests * canary * convert more enzyme tests * feat(scripts): add move enzyme scripts * chore: migrate more enzyme tests * fix: regenerate detect-secrets baseline * lib: bump palette
- Loading branch information
Showing
1,629 changed files
with
3,775 additions
and
4,928 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -64,8 +64,8 @@ | |
"webpack": "node --max_old_space_size=4096 -r @babel/register node_modules/.bin/webpack" | ||
}, | ||
"resolutions": { | ||
"@types/express": "4.17.21", | ||
"@types/react": "16.9.34", | ||
"@types/react": "^18.3.12", | ||
"@types/react-dom": "^18.3.1", | ||
"@types/relay-runtime": "14.1.1", | ||
"chokidar": "3.4.0", | ||
"colors": "1.3.0", | ||
|
@@ -85,12 +85,12 @@ | |
"@artsy/detect-responsive-traits": "^0.1.0", | ||
"@artsy/dismissible": "^0.3.2", | ||
"@artsy/express-reloadable": "^1.7.0", | ||
"@artsy/fresnel": "3.5.0", | ||
"@artsy/fresnel": "^8.0.1", | ||
"@artsy/icons": "3.22.0", | ||
"@artsy/img": "1.0.3", | ||
"@artsy/multienv": "^1.2.0", | ||
"@artsy/palette": "39.1.2", | ||
"@artsy/palette-charts": "38.1.2", | ||
"@artsy/palette": "^40.1.0", | ||
"@artsy/palette-charts": "^39.1.0", | ||
"@artsy/react-html-parser": "^3.0.2", | ||
"@artsy/xapp": "2.0.0", | ||
"@babel/runtime": "7.13.10", | ||
|
@@ -162,10 +162,10 @@ | |
"proportional-scale": "^4.0.0", | ||
"qrcode.react": "1.0.0", | ||
"qs": "6.5.3", | ||
"react": "17.0.2", | ||
"react": "^18.3.1", | ||
"react-17": "npm:[email protected]", | ||
"react-dfp": "^0.21.0", | ||
"react-dom": "17.0.2", | ||
"react-dom": "^18.3.1", | ||
"react-dom-17": "npm:[email protected]", | ||
"react-dropzone": "^11.4.2", | ||
"react-head": "3.0.2", | ||
|
@@ -232,8 +232,8 @@ | |
"@swc/jest": "^0.2.29", | ||
"@swc/plugin-relay": "^1.5.94", | ||
"@swc/plugin-styled-components": "^1.5.94", | ||
"@testing-library/jest-dom": "^5.16.5", | ||
"@testing-library/react": "^11.2.7", | ||
"@testing-library/jest-dom": "^6.6.3", | ||
"@testing-library/react": "^16.0.1", | ||
"@testing-library/react-hooks": "^8.0.1", | ||
"@testing-library/user-event": "^13.1.9", | ||
"@types/autosuggest-highlight": "3.1.0", | ||
|
@@ -253,8 +253,8 @@ | |
"@types/prop-types": "15.7.1", | ||
"@types/qrcode.react": "1.0.0", | ||
"@types/qs": "6.5.3", | ||
"@types/react": "16.9.34", | ||
"@types/react-dom": "16.8.4", | ||
"@types/react": "^18.3.12", | ||
"@types/react-dom": "^18.3.1", | ||
"@types/react-is": "^18.2.0", | ||
"@types/react-relay": "^16.0.4", | ||
"@types/react-stickynode": "^4.0.0", | ||
|
@@ -267,7 +267,7 @@ | |
"@types/styled-system": "5.1.10", | ||
"@types/styled-system__theme-get": "5.0.0", | ||
"@types/superagent": "^4.1.24", | ||
"@types/testing-library__jest-dom": "^5.14.5", | ||
"@types/testing-library__jest-dom": "^6.0.0", | ||
"@types/testing-library__react": "^10.2.0", | ||
"@types/underscore.string": "0.0.32", | ||
"@types/webpack-env": "1.16.0", | ||
|
@@ -302,6 +302,7 @@ | |
"eslint-plugin-styled-components-a11y": "0.0.16", | ||
"eslint-plugin-testing-library": "^4.6.0", | ||
"fork-ts-checker-notifier-webpack-plugin": "4.0.0", | ||
"fresnel-17": "npm:@artsy/fresnel@6", | ||
"graphql-tag": "2.10.3", | ||
"graphql-tools": "4.0.3", | ||
"html-webpack-plugin": "5.3.1", | ||
|
@@ -339,7 +340,7 @@ | |
"swc-loader": "^0.2.3", | ||
"terser-webpack-plugin": "5.1.3", | ||
"time-fix-plugin": "^2.0.7", | ||
"typescript": "4.7.4", | ||
"typescript": "^5.6.3", | ||
"typescript-styled-plugin": "0.15.0", | ||
"webpack": "5.76.0", | ||
"webpack-bundle-analyzer": "4.4.2", | ||
|
This file contains 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const fs = require("fs") | ||
const path = require("path") | ||
|
||
const srcFolder = path.join(process.cwd(), "src") | ||
|
||
// Test git status untracked: | ||
// git status --porcelain | grep '^??' | awk '{print $2}' | grep -E '\.jest\.enzyme\.(js|ts|tsx)$' | xargs -r yarn jest-enzyme | ||
|
||
function findAndRenameFiles(dir) { | ||
const filesAndDirs = fs.readdirSync(dir, { withFileTypes: true }) | ||
|
||
filesAndDirs.forEach(dirent => { | ||
const fullPath = path.join(dir, dirent.name) | ||
|
||
if (dirent.isDirectory()) { | ||
// Recursively search in subdirectories | ||
findAndRenameFiles(fullPath) | ||
} else if ( | ||
dirent.isFile() && | ||
[".js", ".ts", ".tsx"].includes(path.extname(fullPath)) && | ||
fullPath.includes(".jest") | ||
) { | ||
// Read the file content | ||
const content = fs.readFileSync(fullPath, "utf8") | ||
if ( | ||
content.includes( | ||
'import { renderRelayTree } from "DevTools/renderRelayTree"' | ||
) | ||
) { | ||
// Rename the file to include .enzyme before the current extension | ||
const ext = path.extname(fullPath) | ||
const newFileName = path.basename(fullPath, ext) + `.enzyme${ext}` | ||
const newPath = path.join(dir, newFileName) | ||
|
||
fs.renameSync(fullPath, newPath) | ||
console.log(`Renamed: ${fullPath} -> ${newPath}`) | ||
} | ||
} | ||
}) | ||
} | ||
|
||
// Start processing from the src folder | ||
findAndRenameFiles(srcFolder) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.