Skip to content
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 vite 5 #526

Merged
merged 7 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
os: [ubuntu-latest]

steps:
Expand All @@ -24,6 +24,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-test-env
- name: Build JS
run: pnpm build
- name: Run Lint
run: pnpm run lint

Expand Down
12 changes: 6 additions & 6 deletions flake.lock

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

4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
packages =
rec {
bash = pkgs.bash;
nodejs = pkgs.nodejs-18_x;
pnpm = pkgs.nodePackages.pnpm;
nodejs = pkgs.nodejs_22;
corepack = pkgs.corepack_22;
};

devShell = pkgs.mkShell {
Expand Down
3 changes: 0 additions & 3 deletions jest.config.js

This file was deleted.

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
"lint:fix": "prettier --loglevel warn --write \"packages/**/*.{ts,tsx}\" && eslint \"packages/**/*.{ts,tsx}\" --quiet --fix",
"release": "pnpm -F=fastify-renderer publish",
"preinstall": "npx only-allow pnpm",
"prerelease": "pnpm -F=fastify-renderer run gitpkg publish",
"test": "jest --forceExit -w=1",
"test:debug": "cross-env FR_DEBUG_SERVE=1 node --inspect-brk ./node_modules/.bin/jest --forceExit"
"prerelease": "pnpm -F=fastify-renderer exec gitpkg publish",
"test": "vitest --pool=forks --run"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -44,9 +43,8 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"expect-playwright": "^0.8.0",
"fs-extra": "^11.1.0",
"jest": "^29.7.0",
"vitest": "^2.1.2",
"playwright-chromium": "^1.39.0",
"prettier": "^2.8.8",
"prettier-plugin-organize-imports": "^3.2.3",
Expand All @@ -59,5 +57,6 @@
"@types/react": "17.0.4",
"@types/react-dom": "17.0.4"
}
}
},
"packageManager": "[email protected]+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b"
}
196 changes: 0 additions & 196 deletions packages/fastify-renderer/jest.config.js

This file was deleted.

22 changes: 13 additions & 9 deletions packages/fastify-renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{
"name": "fastify-renderer",
"version": "0.4.2",
"version": "0.5.0",
"description": "Simple, high performance client side app renderer for Fastify.",
"exports": {
".": {
"require": "./node/index.js"
"import": "./node/index.js",
"default": "./node/index.js"
},
"./client/react": {
"import": "./client/react/index.js",
"default": "./client/react/index.js"
},
"./client/react/DefaultLayout": {
"import": "./client/react/DefaultLayout.js",
"default": "./client/react/DefaultLayout.js"
},
"./package": "./package.json",
"./package.json": "./package.json"
},
Expand All @@ -29,7 +35,7 @@
"lint:fix": "prettier --loglevel warn --write \"{src,test}/**/*.{ts,tsx}\" && eslint \"{src,test}/**/*.{ts,tsx}\" --quiet --fix",
"prepublishOnly": "npm run build",
"test": "run-s build test:unit lint",
"test:unit": "jest"
"test:unit": "vitest --run"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -64,11 +70,11 @@
"@vitejs/plugin-react-refresh": "^1.3.6",
"fastify-plugin": "^4.5.1",
"http-errors": "^1.8.1",
"path-to-regexp": "^6.2.1",
"path-to-regexp": "^8.2.0",
"sanitize-filename": "^1.6.3",
"stream-template": "^0.0.10",
"vite": "^2.9.15",
"wouter": "^2.7.5"
"vite": "^5.3.1",
"wouter": "^3.3.2"
},
"peerDependencies": {
"fastify": "^4.24.2",
Expand All @@ -77,9 +83,7 @@
},
"devDependencies": {
"@swc/core": "^1.3.95",
"@swc/jest": "^0.2.29",
"@types/connect": "^3.4.35",
"@types/jest": "^29.5.6",
"@types/node": "^18.11.9",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.11",
Expand All @@ -95,7 +99,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"fastify": "^4.24.2",
"gitpkg": "^1.0.0-beta.2",
"jest": "^29.7.0",
"vitest": "^2.1.2",
"npm-run-all": "^4.1.5",
"pino-pretty": "^8.1.0",
"prettier": "^2.7.1",
Expand Down
12 changes: 7 additions & 5 deletions packages/fastify-renderer/src/client/react/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useEffect, useState } from 'react'
import { Route, Router, Switch, useLocation, useRouter } from 'wouter'
import { usePromise } from './fetcher'
import { shouldScrollToHash, useNavigationDetails, useTransitionLocation } from './locationHook'
import { matcher } from './matcher'
import { shouldScrollToHash, useNavigationDetails, useTransitionLocation, TransitionProvider } from './locationHook'
import { parser } from './parser'

export interface LayoutProps {
isNavigating: boolean
Expand Down Expand Up @@ -82,8 +82,10 @@ export function Root<BootProps extends Record<string, any>>(props: {
]

return (
<Router base={props.basePath} hook={useTransitionLocation as any} matcher={matcher}>
<RouteTable routes={routes} Layout={props.Layout} bootProps={props.bootProps} />
</Router>
<TransitionProvider>
<Router base={props.basePath} hook={useTransitionLocation as any} parser={parser}>
<RouteTable routes={routes} Layout={props.Layout} bootProps={props.bootProps} />
</Router>
</TransitionProvider>
)
}
Loading
Loading