@@ -14,11 +14,12 @@ def move(old_path, new_path)
1414 File . rename ( old_path , new_path )
1515end
1616
17- move ( "../spec/dummy/config/shakapacker.yml" , "../spec/dummy/config/webpacker.yml" )
17+ # Keep shakapacker.yml since we're using Shakapacker 8+
18+ # move("../spec/dummy/config/shakapacker.yml", "../spec/dummy/config/webpacker.yml")
1819
19- # Shakapacker
20- gsub_file_content ( "../Gemfile.development_dependencies" , /gem "shakapacker", "[^"]*"/ , 'gem "shakapacker", "6.6 .0"' )
21- gsub_file_content ( "../spec/dummy/package.json" , /"shakapacker": "[^"]*",/ , '"shakapacker": "6.6 .0",' )
20+ # Shakapacker - use minimum supported version (8.0)
21+ gsub_file_content ( "../Gemfile.development_dependencies" , /gem "shakapacker", "[^"]*"/ , 'gem "shakapacker", "8.0 .0"' )
22+ gsub_file_content ( "../spec/dummy/package.json" , /"shakapacker": "[^"]*",/ , '"shakapacker": "8.0 .0",' )
2223
2324# The below packages don't work on the oldest supported Node version and aren't needed there anyway
2425gsub_file_content ( "../package.json" , /"[^"]*eslint[^"]*": "[^"]*",?/ , "" )
@@ -31,25 +32,26 @@ gsub_file_content("../package.json", %r{"@testing-library/[^"]*": "[^"]*",}, "")
3132# Clean up any trailing commas before closing braces
3233gsub_file_content ( "../package.json" , /,(\s *})/ , "\\ 1" )
3334
34- # Switch to the oldest supported React version
35- gsub_file_content ( "../package.json" , /"react": "[^"]*",/ , '"react": "16.14 .0",' )
36- gsub_file_content ( "../package.json" , /"react-dom": "[^"]*",/ , '"react-dom": "16.14 .0",' )
37- gsub_file_content ( "../spec/dummy/package.json" , /"react": "[^"]*",/ , '"react": "16.14 .0",' )
38- gsub_file_content ( "../spec/dummy/package.json" , /"react-dom": "[^"]*",/ , '"react-dom": "16.14 .0",' )
35+ # Switch to minimum supported React version (React 18 since we removed PropTypes)
36+ gsub_file_content ( "../package.json" , /"react": "[^"]*",/ , '"react": "18.0 .0",' )
37+ gsub_file_content ( "../package.json" , /"react-dom": "[^"]*",/ , '"react-dom": "18.0 .0",' )
38+ gsub_file_content ( "../spec/dummy/package.json" , /"react": "[^"]*",/ , '"react": "18.0 .0",' )
39+ gsub_file_content ( "../spec/dummy/package.json" , /"react-dom": "[^"]*",/ , '"react-dom": "18.0 .0",' )
3940gsub_file_content (
4041 "../package.json" ,
4142 "jest node_package/tests" ,
4243 'jest node_package/tests --testPathIgnorePatterns=\".*(RSC|stream|' \
4344 'registerServerComponent|serverRenderReactComponent|SuspenseHydration).*\"'
4445)
45- gsub_file_content ( "../tsconfig.json" , "react-jsx" , "react" )
46- gsub_file_content ( "../spec/dummy/babel.config.js" , "runtime: 'automatic'" , "runtime: 'classic'" )
47- # https://rescript-lang.org/docs/react/latest/migrate-react#configuration
48- gsub_file_content ( "../spec/dummy/rescript.json" , '"version": 4' , '"version": 4, "mode": "classic"' )
49- # Find all files under app-react16 and replace the React 19 versions
50- Dir . glob ( File . expand_path ( "../spec/dummy/**/app-react16/**/*.*" , __dir__ ) ) . each do |file |
51- move ( file , file . gsub ( "-react16" , "" ) )
52- end
46+ # Keep modern JSX transform for React 18+
47+ # gsub_file_content("../tsconfig.json", "react-jsx", "react")
48+ # gsub_file_content("../spec/dummy/babel.config.js", "runtime: 'automatic'", "runtime: 'classic'")
49+ # Keep modern ReScript configuration for React 18+
50+ # gsub_file_content("../spec/dummy/rescript.json", '"version": 4', '"version": 4, "mode": "classic"')
51+ # Skip React 16 file replacements since we're using React 18+
52+ # Dir.glob(File.expand_path("../spec/dummy/**/app-react16/**/*.*", __dir__)).each do |file|
53+ # move(file, file.gsub("-react16", ""))
54+ # end
5355
5456gsub_file_content ( "../spec/dummy/config/webpack/commonWebpackConfig.js" , /generateWebpackConfig(\( \) )?/ ,
5557 "webpackConfig" )
0 commit comments