Skip to content

Commit

Permalink
update to react 19. Additionally, update react webpack project to use…
Browse files Browse the repository at this point in the history
… latest dependencies
  • Loading branch information
AtofStryker committed Dec 6, 2024
1 parent 89ad4f7 commit 3827362
Show file tree
Hide file tree
Showing 11 changed files with 6,529 additions and 6,296 deletions.
3 changes: 2 additions & 1 deletion react-next14-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"cypress:run": "cypress run --component"
},
"dependencies": {
"next": "14.2.16",
Expand Down
173 changes: 88 additions & 85 deletions react-next15-ts/package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions react-next15-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"cypress:run": "cypress run --component"
},
"dependencies": {
"cypress": "https://cdn.cypress.io/beta/npm/13.15.2/darwin-arm64/feat/support_next_15-59114cf3e41a566a857eb7713bfab7d1b130678a/cypress.tgz",
"next": "15.0.3",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106"
"react": "^19.0.0",
"react-dom": "^19.0.0",
"next": "15.0.4"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "15.0.3",
"eslint-config-next": "15.0.4",
"msw": "^2.6.5",
"postcss": "^8",
"tailwindcss": "^3.4.1",
Expand Down
28 changes: 21 additions & 7 deletions react-next15-ts/public/mockServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* - Please do NOT serve this file on production.
*/

const PACKAGE_VERSION = '2.6.0'
const INTEGRITY_CHECKSUM = '07a8241b182f8a246a7cd39894799a9e'
const PACKAGE_VERSION = '2.6.7'
const INTEGRITY_CHECKSUM = '00729d72e3b82faf54ca8b9621dbb96f'
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
const activeClientIds = new Set()

Expand Down Expand Up @@ -192,12 +192,26 @@ async function getResponse(event, client, requestId) {
const requestClone = request.clone()

function passthrough() {
const headers = Object.fromEntries(requestClone.headers.entries())
// Cast the request headers to a new Headers instance
// so the headers can be manipulated with.
const headers = new Headers(requestClone.headers)

// Remove the "accept" header value that marked this request as passthrough.
// This prevents request alteration and also keeps it compliant with the
// user-defined CORS policies.
const acceptHeader = headers.get('accept')
if (acceptHeader) {
const values = acceptHeader.split(',').map((value) => value.trim())
const filteredValues = values.filter(
(value) => value !== 'msw/passthrough',
)

// Remove internal MSW request header so the passthrough request
// complies with any potential CORS preflight checks on the server.
// Some servers forbid unknown request headers.
delete headers['x-msw-intention']
if (filteredValues.length > 0) {
headers.set('accept', filteredValues.join(', '))
} else {
headers.delete('accept')
}
}

return fetch(requestClone, { headers })
}
Expand Down
141 changes: 48 additions & 93 deletions react-vite-ts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions react-vite-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
},
"dependencies": {
"msw": "^2.6.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.1",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@vitejs/plugin-react": "^4.3.4",
"autoprefixer": "^10.4.20",
"cypress": "https://cdn.cypress.io/beta/npm/13.15.2/darwin-arm64/feat/support_vite_6-4cc6dd61609e9d9f1fcd42ec1573ea79feda602a/cypress.tgz",
"cypress": "https://cdn.cypress.io/beta/npm/14.0.0/darwin-arm64/release/14.0.0-e4904d6e4c006ce2f58d50fd6d978e785007c86d/cypress.tgz",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.14",
"typescript": "^5.6.3",
Expand Down
Loading

0 comments on commit 3827362

Please sign in to comment.