diff --git a/examples/hackathon-submissions/package-lock.json b/examples/hackathon-submissions/package-lock.json index 5449b0059..1f9ccca45 100644 --- a/examples/hackathon-submissions/package-lock.json +++ b/examples/hackathon-submissions/package-lock.json @@ -21,12 +21,10 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@prisma/client": "5.18.0", + "@prisma/client": "5.19.1", "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "autoprefixer": "^10.4.13", "axios": "^1.4.0", @@ -36,33 +34,18 @@ "mitt": "3.0.0", "msw": "^1.1.0", "postcss": "^8.4.21", - "prisma": "5.18.0", + "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2", "tailwindcss": "^3.2.7", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" - } - }, - ".wasp/out/sdk/wasp/node_modules/prisma": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.18.0.tgz", - "integrity": "sha512-+TrSIxZsh64OPOmaSgVPH7ALL9dfU0jceYaMJXsNrTkFHO7/3RANi5K2ZiPB1De9+KDxCWn7jvRq8y8pvk+o9g==", - "hasInstallScript": true, - "license": "Apache-2.0", - "dependencies": { - "@prisma/engines": "5.18.0" - }, - "bin": { - "prisma": "build/index.js" - }, - "engines": { - "node": ">=16.13" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" } }, "node_modules/@adobe/css-tools": { @@ -858,10 +841,11 @@ "integrity": "sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==" }, "node_modules/@prisma/client": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.18.0.tgz", - "integrity": "sha512-BWivkLh+af1kqC89zCJYkHsRcyWsM8/JHpsDMM76DjP3ZdEquJhXa4IeX+HkWPnwJ5FanxEJFZZDTWiDs/Kvyw==", + "version": "5.19.1", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.19.1.tgz", + "integrity": "sha512-x30GFguInsgt+4z5I4WbkZP2CGpotJMUXy+Gl/aaUjHn2o1DnLYNTA+q9XdYmAQZM8fIIkvUiA2NpgosM3fneg==", "hasInstallScript": true, + "license": "Apache-2.0", "engines": { "node": ">=16.13" }, @@ -874,49 +858,12 @@ } } }, - "node_modules/@prisma/debug": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.18.0.tgz", - "integrity": "sha512-f+ZvpTLidSo3LMJxQPVgAxdAjzv5OpzAo/eF8qZqbwvgi2F5cTOI9XCpdRzJYA0iGfajjwjOKKrVq64vkxEfUw==", - "license": "Apache-2.0" - }, - "node_modules/@prisma/engines": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.18.0.tgz", - "integrity": "sha512-ofmpGLeJ2q2P0wa/XaEgTnX/IsLnvSp/gZts0zjgLNdBhfuj2lowOOPmDcfKljLQUXMvAek3lw5T01kHmCG8rg==", - "hasInstallScript": true, - "license": "Apache-2.0", - "dependencies": { - "@prisma/debug": "5.18.0", - "@prisma/engines-version": "5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169", - "@prisma/fetch-engine": "5.18.0", - "@prisma/get-platform": "5.18.0" - } - }, - "node_modules/@prisma/engines-version": { - "version": "5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169.tgz", - "integrity": "sha512-a/+LpJj8vYU3nmtkg+N3X51ddbt35yYrRe8wqHTJtYQt7l1f8kjIBcCs6sHJvodW/EK5XGvboOiwm47fmNrbgg==", - "license": "Apache-2.0" - }, - "node_modules/@prisma/fetch-engine": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.18.0.tgz", - "integrity": "sha512-I/3u0x2n31rGaAuBRx2YK4eB7R/1zCuayo2DGwSpGyrJWsZesrV7QVw7ND0/Suxeo/vLkJ5OwuBqHoCxvTHpOg==", - "license": "Apache-2.0", - "dependencies": { - "@prisma/debug": "5.18.0", - "@prisma/engines-version": "5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169", - "@prisma/get-platform": "5.18.0" - } - }, - "node_modules/@prisma/get-platform": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.18.0.tgz", - "integrity": "sha512-Tk+m7+uhqcKDgnMnFN0lRiH7Ewea0OEsZZs9pqXa7i3+7svS3FSCqDBCaM9x5fmhhkufiG0BtunJVDka+46DlA==", - "license": "Apache-2.0", - "dependencies": { - "@prisma/debug": "5.18.0" + "node_modules/@remix-run/router": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz", + "integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==", + "engines": { + "node": ">=14.0.0" } }, "node_modules/@rollup/rollup-android-arm-eabi": { @@ -1263,6 +1210,7 @@ "version": "4.17.43", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -1270,11 +1218,6 @@ "@types/send": "*" } }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, "node_modules/@types/js-levenshtein": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz", @@ -1283,7 +1226,8 @@ "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true }, "node_modules/@types/ms": { "version": "0.7.34", @@ -1306,12 +1250,14 @@ "node_modules/@types/qs": { "version": "6.9.11", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", - "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==" + "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==", + "dev": true }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true }, "node_modules/@types/react": { "version": "18.2.60", @@ -1331,25 +1277,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, "node_modules/@types/scheduler": { "version": "0.16.8", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", @@ -1359,6 +1286,7 @@ "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -3107,27 +3035,6 @@ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz", "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==" }, - "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -4655,7 +4562,6 @@ "version": "5.19.1", "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.19.1.tgz", "integrity": "sha512-c5K9MiDaa+VAAyh1OiYk76PXOme9s3E992D7kvvIOhCrNsBQfy2mP2QAQtX0WNj140IgG++12kwZpYB9iIydNQ==", - "devOptional": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -4675,14 +4581,12 @@ "version": "5.19.1", "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.19.1.tgz", "integrity": "sha512-lAG6A6QnG2AskAukIEucYJZxxcSqKsMK74ZFVfCTOM/7UiyJQi48v6TQ47d6qKG3LbMslqOvnTX25dj/qvclGg==", - "devOptional": true, "license": "Apache-2.0" }, "node_modules/prisma/node_modules/@prisma/engines": { "version": "5.19.1", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.19.1.tgz", "integrity": "sha512-kR/PoxZDrfUmbbXqqb8SlBBgCjvGaJYMCOe189PEYzq9rKqitQ2fvT/VJ8PDSe8tTNxhc2KzsCfCAL+Iwm/7Cg==", - "devOptional": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -4696,14 +4600,12 @@ "version": "5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3", "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3.tgz", "integrity": "sha512-xR6rt+z5LnNqTP5BBc+8+ySgf4WNMimOKXRn6xfNRDSpHvbOEmd7+qAOmzCrddEc4Cp8nFC0txU14dstjH7FXA==", - "devOptional": true, "license": "Apache-2.0" }, "node_modules/prisma/node_modules/@prisma/fetch-engine": { "version": "5.19.1", "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.19.1.tgz", "integrity": "sha512-pCq74rtlOVJfn4pLmdJj+eI4P7w2dugOnnTXpRilP/6n5b2aZiA4ulJlE0ddCbTPkfHmOL9BfaRgA8o+1rfdHw==", - "devOptional": true, "license": "Apache-2.0", "dependencies": { "@prisma/debug": "5.19.1", @@ -4715,7 +4617,6 @@ "version": "5.19.1", "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.19.1.tgz", "integrity": "sha512-sCeoJ+7yt0UjnR+AXZL7vXlg5eNxaFOwC23h0KvW1YIXUoa7+W2ZcAUhoEQBmJTW4GrFqCuZ8YSP0mkDa4k3Zg==", - "devOptional": true, "license": "Apache-2.0", "dependencies": { "@prisma/debug": "5.19.1" @@ -4877,52 +4778,33 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "node_modules/react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz", + "integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz", + "integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2", + "react-router": "6.26.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" - } - }, - "node_modules/react-router/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/react-router/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dependencies": { - "isarray": "0.0.1" + "react": ">=16.8", + "react-dom": ">=16.8" } }, "node_modules/read-cache": { @@ -5020,11 +4902,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -5567,16 +5444,6 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, - "node_modules/tiny-invariant": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", - "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==" - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, "node_modules/tinybench": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", @@ -5824,11 +5691,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/examples/streaming/package-lock.json b/examples/streaming/package-lock.json index 5df18d67b..19a1fd11c 100644 --- a/examples/streaming/package-lock.json +++ b/examples/streaming/package-lock.json @@ -24,8 +24,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "axios": "^1.4.0", "express": "~4.18.1", @@ -36,13 +34,14 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" } }, "node_modules/@adobe/css-tools": { @@ -708,6 +707,14 @@ } } }, + "node_modules/@remix-run/router": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz", + "integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.9.6", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.6.tgz", @@ -1052,6 +1059,7 @@ "version": "4.17.43", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -1059,11 +1067,6 @@ "@types/send": "*" } }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, "node_modules/@types/js-levenshtein": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz", @@ -1072,7 +1075,8 @@ "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true }, "node_modules/@types/ms": { "version": "0.7.34", @@ -1095,12 +1099,14 @@ "node_modules/@types/qs": { "version": "6.9.11", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", - "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==" + "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==", + "dev": true }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true }, "node_modules/@types/react": { "version": "18.2.55", @@ -1120,25 +1126,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, "node_modules/@types/scheduler": { "version": "0.16.8", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", @@ -1148,6 +1135,7 @@ "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -2664,32 +2652,6 @@ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz", "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==" }, - "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -3670,14 +3632,6 @@ "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==" }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object-inspect": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", @@ -4001,21 +3955,6 @@ "@prisma/debug": "5.19.1" } }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -4151,59 +4090,35 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, "node_modules/react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz", + "integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz", + "integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2", + "react-router": "6.26.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8", + "react-dom": ">=16.8" } }, - "node_modules/react-router/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/react-router/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/react-router/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -4274,11 +4189,6 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -4691,16 +4601,6 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, - "node_modules/tiny-invariant": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz", - "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==" - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, "node_modules/tinybench": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", @@ -4914,11 +4814,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/examples/thoughts/package-lock.json b/examples/thoughts/package-lock.json index d221abcd5..718182b30 100644 --- a/examples/thoughts/package-lock.json +++ b/examples/thoughts/package-lock.json @@ -29,8 +29,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "axios": "^1.4.0", "express": "~4.18.1", @@ -43,13 +41,14 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" } }, ".wasp/out/sdk/wasp/node_modules/@emnapi/core": { @@ -1526,6 +1525,14 @@ } } }, + "node_modules/@remix-run/router": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz", + "integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", @@ -1887,6 +1894,7 @@ "version": "4.17.43", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -1902,11 +1910,6 @@ "@types/unist": "^2" } }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, "node_modules/@types/js-levenshtein": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz", @@ -1923,7 +1926,8 @@ "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true }, "node_modules/@types/ms": { "version": "0.7.34", @@ -1946,12 +1950,14 @@ "node_modules/@types/qs": { "version": "6.9.11", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", - "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==" + "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==", + "dev": true }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true }, "node_modules/@types/react": { "version": "18.2.57", @@ -1971,25 +1977,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, "node_modules/@types/scheduler": { "version": "0.16.8", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", @@ -1999,6 +1986,7 @@ "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -3683,32 +3671,6 @@ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz", "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==" }, - "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -5882,59 +5844,35 @@ } }, "node_modules/react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz", + "integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz", + "integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2", + "react-router": "6.26.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8", + "react-dom": ">=16.8" } }, - "node_modules/react-router/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/react-router/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/react-router/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -6030,11 +5968,6 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -6488,16 +6421,6 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, - "node_modules/tiny-invariant": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz", - "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==" - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, "node_modules/tinybench": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", @@ -6831,11 +6754,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/examples/thoughts/src/client/MainPage.jsx b/examples/thoughts/src/client/MainPage.jsx index 5a35e53bc..3519c4f2b 100644 --- a/examples/thoughts/src/client/MainPage.jsx +++ b/examples/thoughts/src/client/MainPage.jsx @@ -1,7 +1,8 @@ import { createThought } from "wasp/client/operations"; +import { routes } from "wasp/client/router"; import React, { useState, useRef } from 'react' import ReactMarkdown from 'react-markdown' -import { useHistory } from 'react-router-dom' +import { useNavigate } from 'react-router-dom' import Tag from './Tag' import './Main.css' @@ -35,7 +36,7 @@ const MainPage = ({ user }) => { ) } -const Thought = (props) => { +const Thought = () => { const defaultTextMd = '' const defaultNewTagName = '' const defaultTagNames = [] @@ -44,7 +45,7 @@ const Thought = (props) => { const [tagNames, setTagNames] = useState(defaultTagNames) const [newTagName, setNewTagName] = useState(defaultNewTagName) const [inPreviewMode, setInPreviewMode] = useState(defaultInPreviewMode) - const history = useHistory() + const navigate = useNavigate() const formRef = useRef(null) // TODO: Why do I have this ref? I don't seem to use it anywhere? const setNewTagNameIfValid = (tagName) => { @@ -61,7 +62,7 @@ const Thought = (props) => { } try { await createThought({ textMarkdown: textMd.trim(), tagNames }) - history.push('/thoughts') // TODO: Would be cool if this was type checked somehow or if string was coming from the Wasp API. + navigate(routes.ThoughtsRoute.build()) } catch (err) { return window.alert('Error: ' + err.message) } diff --git a/examples/todo-typescript/package-lock.json b/examples/todo-typescript/package-lock.json index e54d69add..561d5004f 100644 --- a/examples/todo-typescript/package-lock.json +++ b/examples/todo-typescript/package-lock.json @@ -27,8 +27,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "axios": "^1.4.0", "express": "~4.18.1", @@ -41,13 +39,14 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" } }, ".wasp/out/sdk/wasp/node_modules/@napi-rs/wasm-runtime": { @@ -2037,6 +2036,14 @@ "@prisma/debug": "5.19.1" } }, + "node_modules/@remix-run/router": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz", + "integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.9.6", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.6.tgz", @@ -2398,6 +2405,7 @@ "version": "4.17.43", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -2405,11 +2413,6 @@ "@types/send": "*" } }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, "node_modules/@types/js-levenshtein": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz", @@ -2418,7 +2421,8 @@ "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true }, "node_modules/@types/ms": { "version": "0.7.34", @@ -2441,12 +2445,14 @@ "node_modules/@types/qs": { "version": "6.9.11", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", - "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==" + "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==", + "dev": true }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true }, "node_modules/@types/react": { "version": "18.2.55", @@ -2466,25 +2472,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, "node_modules/@types/scheduler": { "version": "0.16.8", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", @@ -2494,6 +2481,7 @@ "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -4016,32 +4004,6 @@ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz", "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==" }, - "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -5051,14 +5013,6 @@ "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==" }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object-inspect": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", @@ -5346,21 +5300,6 @@ "fsevents": "2.3.3" } }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -5496,59 +5435,35 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, "node_modules/react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz", + "integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz", + "integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2", + "react-router": "6.26.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8", + "react-dom": ">=16.8" } }, - "node_modules/react-router/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/react-router/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/react-router/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -5619,11 +5534,6 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -6036,16 +5946,6 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, - "node_modules/tiny-invariant": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz", - "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==" - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, "node_modules/tinybench": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", @@ -6259,11 +6159,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/examples/tutorials/TodoApp/package-lock.json b/examples/tutorials/TodoApp/package-lock.json index b8c924d7c..840e3c753 100644 --- a/examples/tutorials/TodoApp/package-lock.json +++ b/examples/tutorials/TodoApp/package-lock.json @@ -27,8 +27,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "axios": "^1.4.0", "express": "~4.18.1", @@ -41,13 +39,14 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.1", "superjson": "^1.12.2", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" } }, ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2": { @@ -1576,6 +1575,15 @@ "@prisma/debug": "5.19.1" } }, + "node_modules/@remix-run/router": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.1.tgz", + "integrity": "sha512-S45oynt/WH19bHbIXjtli6QmwNYvaz+vtnubvNpNDvUOoA/OWh6j1OikIP3G+v5GHdxyC6EXoChG3HgYGEUfcg==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.18.1", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.1.tgz", @@ -2006,6 +2014,7 @@ "version": "4.19.5", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz", "integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==", + "dev": true, "license": "MIT", "dependencies": { "@types/node": "*", @@ -2014,12 +2023,6 @@ "@types/send": "*" } }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==", - "license": "MIT" - }, "node_modules/@types/js-levenshtein": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz", @@ -2030,6 +2033,7 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true, "license": "MIT" }, "node_modules/@types/ms": { @@ -2057,12 +2061,14 @@ "version": "6.9.15", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", + "dev": true, "license": "MIT" }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true, "license": "MIT" }, "node_modules/@types/react": { @@ -2084,31 +2090,11 @@ "@types/react": "*" } }, - "node_modules/@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "license": "MIT", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "license": "MIT", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, "node_modules/@types/send": { "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "license": "MIT", "dependencies": { "@types/mime": "^1", @@ -3798,35 +3784,6 @@ "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==", "license": "MIT" }, - "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "license": "BSD-3-Clause", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "license": "MIT" - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -4945,15 +4902,6 @@ "integrity": "sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==", "license": "MIT" }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object-inspect": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", @@ -5296,23 +5244,6 @@ "integrity": "sha512-xR6rt+z5LnNqTP5BBc+8+ySgf4WNMimOKXRn6xfNRDSpHvbOEmd7+qAOmzCrddEc4Cp8nFC0txU14dstjH7FXA==", "license": "Apache-2.0" }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "license": "MIT" - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -5461,64 +5392,37 @@ "license": "MIT" }, "node_modules/react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.1.tgz", + "integrity": "sha512-kIwJveZNwp7teQRI5QmwWo39A5bXRyqpH0COKKmPnyD2vBvDwgFXSqDUYtt1h+FEyfnE8eXr7oe0MxRzVwCcvQ==", "license": "MIT", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.1" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.1.tgz", + "integrity": "sha512-veut7m41S1fLql4pLhxeSW3jlqs+4MtjRLj0xvuCEXsxusJCbs6I8yn9BxzzDX2XDgafrccY6hwjmd/bL54tFw==", "license": "MIT", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.1", + "react-router": "6.26.1" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8", + "react-dom": ">=16.8" } }, - "node_modules/react-router/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", - "license": "MIT" - }, - "node_modules/react-router/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "license": "MIT", - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/react-router/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "license": "MIT" - }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -5597,12 +5501,6 @@ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "license": "MIT" }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==", - "license": "MIT" - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -6063,18 +5961,6 @@ "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "license": "MIT" }, - "node_modules/tiny-invariant": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", - "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", - "license": "MIT" - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==", - "license": "MIT" - }, "node_modules/tinybench": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", @@ -6312,12 +6198,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==", - "license": "MIT" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/examples/tutorials/TodoAppTs/package-lock.json b/examples/tutorials/TodoAppTs/package-lock.json index 3beced35b..ee33302b6 100644 --- a/examples/tutorials/TodoAppTs/package-lock.json +++ b/examples/tutorials/TodoAppTs/package-lock.json @@ -27,8 +27,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "axios": "^1.4.0", "express": "~4.18.1", @@ -41,13 +39,14 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.1", "superjson": "^1.12.2", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" } }, ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2": { @@ -1569,6 +1568,15 @@ "@prisma/debug": "5.19.1" } }, + "node_modules/@remix-run/router": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.1.tgz", + "integrity": "sha512-S45oynt/WH19bHbIXjtli6QmwNYvaz+vtnubvNpNDvUOoA/OWh6j1OikIP3G+v5GHdxyC6EXoChG3HgYGEUfcg==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.18.1", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.1.tgz", @@ -1999,6 +2007,7 @@ "version": "4.19.5", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz", "integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==", + "dev": true, "license": "MIT", "dependencies": { "@types/node": "*", @@ -2007,12 +2016,6 @@ "@types/send": "*" } }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==", - "license": "MIT" - }, "node_modules/@types/js-levenshtein": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz", @@ -2023,6 +2026,7 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true, "license": "MIT" }, "node_modules/@types/ms": { @@ -2050,12 +2054,14 @@ "version": "6.9.15", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", + "dev": true, "license": "MIT" }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true, "license": "MIT" }, "node_modules/@types/react": { @@ -2077,31 +2083,11 @@ "@types/react": "*" } }, - "node_modules/@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "license": "MIT", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "license": "MIT", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, "node_modules/@types/send": { "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "license": "MIT", "dependencies": { "@types/mime": "^1", @@ -3791,35 +3777,6 @@ "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==", "license": "MIT" }, - "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "license": "BSD-3-Clause", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "license": "MIT" - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -4938,15 +4895,6 @@ "integrity": "sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==", "license": "MIT" }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object-inspect": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", @@ -5270,23 +5218,6 @@ "fsevents": "2.3.3" } }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "license": "MIT" - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -5435,64 +5366,37 @@ "license": "MIT" }, "node_modules/react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.1.tgz", + "integrity": "sha512-kIwJveZNwp7teQRI5QmwWo39A5bXRyqpH0COKKmPnyD2vBvDwgFXSqDUYtt1h+FEyfnE8eXr7oe0MxRzVwCcvQ==", "license": "MIT", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.1" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.1.tgz", + "integrity": "sha512-veut7m41S1fLql4pLhxeSW3jlqs+4MtjRLj0xvuCEXsxusJCbs6I8yn9BxzzDX2XDgafrccY6hwjmd/bL54tFw==", "license": "MIT", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.1", + "react-router": "6.26.1" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8", + "react-dom": ">=16.8" } }, - "node_modules/react-router/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", - "license": "MIT" - }, - "node_modules/react-router/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "license": "MIT", - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/react-router/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "license": "MIT" - }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -5571,12 +5475,6 @@ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "license": "MIT" }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==", - "license": "MIT" - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -6037,18 +5935,6 @@ "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "license": "MIT" }, - "node_modules/tiny-invariant": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", - "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", - "license": "MIT" - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==", - "license": "MIT" - }, "node_modules/tinybench": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", @@ -6286,12 +6172,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==", - "license": "MIT" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/examples/waspello/package-lock.json b/examples/waspello/package-lock.json index 1cc3f5326..4de763447 100644 --- a/examples/waspello/package-lock.json +++ b/examples/waspello/package-lock.json @@ -31,8 +31,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "arctic": "^1.2.1", "autoprefixer": "^10.4.13", @@ -48,14 +46,15 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2", "tailwindcss": "^3.2.7", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" } }, ".wasp/out/sdk/wasp/node_modules/@emnapi/core": { @@ -1711,6 +1710,14 @@ "@prisma/debug": "5.19.1" } }, + "node_modules/@remix-run/router": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz", + "integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", @@ -2072,6 +2079,7 @@ "version": "4.17.43", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -2079,11 +2087,6 @@ "@types/send": "*" } }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, "node_modules/@types/hoist-non-react-statics": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.5.tgz", @@ -2101,7 +2104,8 @@ "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true }, "node_modules/@types/ms": { "version": "0.7.34", @@ -2124,12 +2128,14 @@ "node_modules/@types/qs": { "version": "6.9.11", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", - "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==" + "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==", + "dev": true }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true }, "node_modules/@types/react": { "version": "18.2.60", @@ -2160,25 +2166,6 @@ "redux": "^4.0.0" } }, - "node_modules/@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, "node_modules/@types/scheduler": { "version": "0.16.8", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", @@ -2188,6 +2175,7 @@ "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -3964,19 +3952,6 @@ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz", "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==" }, - "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, "node_modules/hoist-non-react-statics": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", @@ -6260,52 +6235,33 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, "node_modules/react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz", + "integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz", + "integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2", + "react-router": "6.26.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" - } - }, - "node_modules/react-router/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/react-router/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dependencies": { - "isarray": "0.0.1" + "react": ">=16.8", + "react-dom": ">=16.8" } }, "node_modules/react-tiny-popover": { @@ -6420,11 +6376,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -6972,11 +6923,6 @@ "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==" }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, "node_modules/tinybench": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", @@ -7232,11 +7178,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/examples/waspello/src/auth/LoginPage.jsx b/examples/waspello/src/auth/LoginPage.jsx index af1317118..a32ccfe84 100644 --- a/examples/waspello/src/auth/LoginPage.jsx +++ b/examples/waspello/src/auth/LoginPage.jsx @@ -1,6 +1,6 @@ import React, { useState } from 'react' -import { Link, useHistory } from 'react-router-dom' +import { Link, useNavigate } from 'react-router-dom' import EmailAndPassForm from './components/EmailAndPassForm' import GoogleAuthButton from './components/GoogleAuthButton' @@ -11,7 +11,7 @@ import './Signup.css' import { login } from "wasp/client/auth"; const LoginPage = (props) => { - const history = useHistory() + const navigate = useNavigate() const [usernameFieldVal, setUsernameFieldVal] = useState('') const [passwordFieldVal, setPasswordFieldVal] = useState('') @@ -24,7 +24,7 @@ const LoginPage = (props) => { setUsernameFieldVal('') setPasswordFieldVal('') - history.push('/') + navigate('/') } catch (err) { console.log(err) window.alert(err) diff --git a/examples/waspello/src/auth/SignupPage.jsx b/examples/waspello/src/auth/SignupPage.jsx index 767be5d44..ba33f8f47 100644 --- a/examples/waspello/src/auth/SignupPage.jsx +++ b/examples/waspello/src/auth/SignupPage.jsx @@ -1,5 +1,5 @@ import React, { useState } from 'react' -import { Link, useHistory } from 'react-router-dom' +import { Link, useNavigate } from 'react-router-dom' import EmailAndPassForm from './components/EmailAndPassForm' import GoogleAuthButton from './components/GoogleAuthButton' @@ -12,7 +12,7 @@ import { login, signup } from "wasp/client/auth"; const SignupPage = (props) => { - const history = useHistory() + const navigate = useNavigate() const [usernameFieldVal, setUsernameFieldVal] = useState('') const [passwordFieldVal, setPasswordFieldVal] = useState('') @@ -26,7 +26,7 @@ const SignupPage = (props) => { setUsernameFieldVal('') setPasswordFieldVal('') - history.push('/') + navigate('/') } catch (err) { console.log(err) window.alert(err) diff --git a/examples/waspleau/package-lock.json b/examples/waspleau/package-lock.json index e9e60107b..63856fe61 100644 --- a/examples/waspleau/package-lock.json +++ b/examples/waspleau/package-lock.json @@ -25,8 +25,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "axios": "^1.4.0", "express": "~4.18.1", @@ -38,13 +36,14 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" } }, "node_modules/@adobe/css-tools": { @@ -755,6 +754,14 @@ "@prisma/debug": "5.19.1" } }, + "node_modules/@remix-run/router": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz", + "integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", @@ -1099,6 +1106,7 @@ "version": "4.17.43", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -1106,11 +1114,6 @@ "@types/send": "*" } }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, "node_modules/@types/js-levenshtein": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz", @@ -1119,7 +1122,8 @@ "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true }, "node_modules/@types/ms": { "version": "0.7.34", @@ -1142,12 +1146,14 @@ "node_modules/@types/qs": { "version": "6.9.11", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", - "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==" + "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==", + "dev": true }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true }, "node_modules/@types/react": { "version": "18.2.60", @@ -1167,25 +1173,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, "node_modules/@types/scheduler": { "version": "0.16.8", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", @@ -1195,6 +1182,7 @@ "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -2778,32 +2766,6 @@ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz", "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==" }, - "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -3800,14 +3762,6 @@ "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==" }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object-inspect": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", @@ -4248,21 +4202,6 @@ "fsevents": "2.3.3" } }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -4398,59 +4337,35 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, "node_modules/react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz", + "integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz", + "integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2", + "react-router": "6.26.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8", + "react-dom": ">=16.8" } }, - "node_modules/react-router/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/react-router/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/react-router/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -4522,11 +4437,6 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -4978,16 +4888,6 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, - "node_modules/tiny-invariant": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", - "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==" - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, "node_modules/tinybench": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", @@ -5201,11 +5101,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/examples/websockets-realtime-voting/package-lock.json b/examples/websockets-realtime-voting/package-lock.json index 6624eaff4..a55ec5233 100644 --- a/examples/websockets-realtime-voting/package-lock.json +++ b/examples/websockets-realtime-voting/package-lock.json @@ -30,8 +30,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "autoprefixer": "^10.4.13", "axios": "^1.4.0", @@ -46,7 +44,7 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "socket.io": "^4.6.1", "socket.io-client": "^4.6.1", "superjson": "^1.12.2", @@ -54,7 +52,8 @@ "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" } }, ".wasp/out/sdk/wasp/node_modules/@napi-rs/wasm-runtime": { @@ -2175,6 +2174,14 @@ "@prisma/debug": "5.19.1" } }, + "node_modules/@remix-run/router": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz", + "integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.11.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.11.0.tgz", @@ -2563,6 +2570,7 @@ "version": "4.17.43", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -2570,11 +2578,6 @@ "@types/send": "*" } }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, "node_modules/@types/js-levenshtein": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz", @@ -2583,7 +2586,8 @@ "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true }, "node_modules/@types/ms": { "version": "0.7.34", @@ -2606,12 +2610,14 @@ "node_modules/@types/qs": { "version": "6.9.11", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", - "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==" + "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==", + "dev": true }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true }, "node_modules/@types/react": { "version": "18.2.55", @@ -2631,25 +2637,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, "node_modules/@types/scheduler": { "version": "0.16.8", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", @@ -2659,6 +2646,7 @@ "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -4682,32 +4670,6 @@ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz", "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==" }, - "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -6413,21 +6375,6 @@ "fsevents": "2.3.3" } }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -6589,59 +6536,35 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, "node_modules/react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz", + "integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz", + "integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2", + "react-router": "6.26.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8", + "react-dom": ">=16.8" } }, - "node_modules/react-router/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/react-router/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/react-router/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -6737,11 +6660,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -7474,16 +7392,6 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, - "node_modules/tiny-invariant": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz", - "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==" - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, "node_modules/tinybench": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", @@ -7719,11 +7627,6 @@ "node": ">= 0.4.0" } }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -9980,6 +9883,11 @@ "@prisma/debug": "5.19.1" } }, + "@remix-run/router": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz", + "integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==" + }, "@rollup/rollup-android-arm-eabi": { "version": "4.11.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.11.0.tgz", @@ -10215,6 +10123,7 @@ "version": "4.17.43", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "dev": true, "requires": { "@types/node": "*", "@types/qs": "*", @@ -10222,11 +10131,6 @@ "@types/send": "*" } }, - "@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, "@types/js-levenshtein": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz", @@ -10235,7 +10139,8 @@ "@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true }, "@types/ms": { "version": "0.7.34", @@ -10258,12 +10163,14 @@ "@types/qs": { "version": "6.9.11", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", - "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==" + "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==", + "dev": true }, "@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true }, "@types/react": { "version": "18.2.55", @@ -10283,25 +10190,6 @@ "@types/react": "*" } }, - "@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "requires": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "requires": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, "@types/scheduler": { "version": "0.16.8", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", @@ -10311,6 +10199,7 @@ "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "requires": { "@types/mime": "^1", "@types/node": "*" @@ -11707,34 +11596,6 @@ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz", "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==" }, - "history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "requires": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "requires": { - "react-is": "^16.7.0" - }, - "dependencies": { - "react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - } - } - }, "html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -12868,23 +12729,6 @@ "fsevents": "2.3.3" } }, - "prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "requires": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - }, - "dependencies": { - "react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - } - } - }, "proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -12989,53 +12833,20 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, "react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz", + "integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==", "requires": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "requires": { - "isarray": "0.0.1" - } - }, - "react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - } + "@remix-run/router": "1.19.2" } }, "react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz", + "integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==", "requires": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2", + "react-router": "6.26.2" } }, "read-cache": { @@ -13109,11 +12920,6 @@ "supports-preserve-symlinks-flag": "^1.0.0" } }, - "resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, "restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -13648,16 +13454,6 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, - "tiny-invariant": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz", - "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==" - }, - "tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, "tinybench": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", @@ -13819,11 +13615,6 @@ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" }, - "value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -14322,7 +14113,6 @@ "@testing-library/react": "^14.1.2", "@tsconfig/node18": "latest", "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "autoprefixer": "^10.4.13", "axios": "^1.4.0", @@ -14337,7 +14127,7 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "socket.io": "^4.6.1", "socket.io-client": "^4.6.1", "superjson": "^1.12.2", diff --git a/examples/websockets-realtime-voting/src/Layout.tsx b/examples/websockets-realtime-voting/src/Layout.tsx index ecf49aa4e..55593e6ec 100644 --- a/examples/websockets-realtime-voting/src/Layout.tsx +++ b/examples/websockets-realtime-voting/src/Layout.tsx @@ -1,6 +1,5 @@ -import { ReactNode } from "react"; +import { Outlet } from "react-router-dom"; import { logout, useAuth } from "wasp/client/auth"; -// @ts-check import "./Main.css"; import { Flowbite, Dropdown, Navbar, Avatar } from "flowbite-react"; @@ -14,7 +13,7 @@ const customTheme = { }, }; -export const Layout = ({ children }: { children: ReactNode }) => { +export const Layout = () => { const { data: user } = useAuth(); return ( @@ -40,7 +39,9 @@ export const Layout = ({ children }: { children: ReactNode }) => { } > - {user.getFirstProviderUserId()} + + {user.getFirstProviderUserId()} + Dashboard Settings @@ -61,7 +62,9 @@ export const Layout = ({ children }: { children: ReactNode }) => { Contact */} -
{children}
+
+ +
); diff --git a/waspc/data/Generator/templates/react-app/src/auth/pages/OAuthCallback.tsx b/waspc/data/Generator/templates/react-app/src/auth/pages/OAuthCallback.tsx index f723628c5..1fdeaf68f 100644 --- a/waspc/data/Generator/templates/react-app/src/auth/pages/OAuthCallback.tsx +++ b/waspc/data/Generator/templates/react-app/src/auth/pages/OAuthCallback.tsx @@ -1,7 +1,7 @@ {{={= =}=}} import { useEffect, useRef, useState } from "react"; import { type AxiosResponse } from "axios"; -import { Redirect, useLocation } from 'react-router-dom' +import { Navigate, useLocation } from 'react-router-dom' import { useAuth } from 'wasp/client/auth' import { api } from 'wasp/client/api' import { initSession } from 'wasp/auth/helpers/user' @@ -14,7 +14,7 @@ export function OAuthCallbackPage() { const { error, user } = useOAuthCallbackHandler(); if (user !== undefined && user !== null) { - return ; + return ; } diff --git a/waspc/data/Generator/templates/react-app/src/auth/pages/createAuthRequiredPage.jsx b/waspc/data/Generator/templates/react-app/src/auth/pages/createAuthRequiredPage.jsx index 52e69bf4d..5afb3991f 100644 --- a/waspc/data/Generator/templates/react-app/src/auth/pages/createAuthRequiredPage.jsx +++ b/waspc/data/Generator/templates/react-app/src/auth/pages/createAuthRequiredPage.jsx @@ -1,7 +1,7 @@ {{={= =}=}} import React from 'react' -import { Redirect } from 'react-router-dom' +import { Navigate } from 'react-router-dom' import { useAuth } from 'wasp/client/auth' import { Loader } from '../../components/Loader' @@ -17,7 +17,7 @@ const createAuthRequiredPage = (Page) => { if (user) { return } else { - return + return } case 'loading': return ( diff --git a/waspc/data/Generator/templates/react-app/src/components/DefaultRootErrorBoundary.tsx b/waspc/data/Generator/templates/react-app/src/components/DefaultRootErrorBoundary.tsx new file mode 100644 index 000000000..7af24e15d --- /dev/null +++ b/waspc/data/Generator/templates/react-app/src/components/DefaultRootErrorBoundary.tsx @@ -0,0 +1,13 @@ +import { useRouteError } from 'react-router-dom' + +import { FullPageWrapper } from './FullPageWrapper' + +export function DefaultRootErrorBoundary() { + const error = useRouteError() + console.error(error) + return ( + +
There was an error rendering this page. Check the browser console for more information.
+
+ ) +} diff --git a/waspc/data/Generator/templates/react-app/src/index.tsx b/waspc/data/Generator/templates/react-app/src/index.tsx index 9a7a3241e..076e97c7d 100644 --- a/waspc/data/Generator/templates/react-app/src/index.tsx +++ b/waspc/data/Generator/templates/react-app/src/index.tsx @@ -3,7 +3,7 @@ import React from 'react' import ReactDOM from 'react-dom/client' import { QueryClientProvider } from '@tanstack/react-query' -import router from './router' +import { router } from './router' import { initializeQueryClient, queryClientInitialized, diff --git a/waspc/data/Generator/templates/react-app/src/router.tsx b/waspc/data/Generator/templates/react-app/src/router.tsx index 35c0a7f8b..010a9d31a 100644 --- a/waspc/data/Generator/templates/react-app/src/router.tsx +++ b/waspc/data/Generator/templates/react-app/src/router.tsx @@ -1,6 +1,6 @@ {{={= =}=}} import React from 'react' -import { Route, Switch, BrowserRouter as Router } from 'react-router-dom' +import { createBrowserRouter, RouterProvider } from 'react-router-dom' {=# rootComponent.isDefined =} {=& rootComponent.importStatement =} {=/ rootComponent.isDefined =} @@ -17,6 +17,8 @@ import createAuthRequiredPage from "./auth/pages/createAuthRequiredPage" import { OAuthCallbackPage } from "./auth/pages/OAuthCallback" {=/ isExternalAuthEnabled =} +import { DefaultRootErrorBoundary } from './components/DefaultRootErrorBoundary' + import { routes } from 'wasp/client/router' export const routeNameToRouteComponent = { @@ -25,35 +27,31 @@ export const routeNameToRouteComponent = { {=/ routes =} } as const; -const router = ( - - {=# rootComponent.isDefined =} - <{= rootComponent.importIdentifier =}> - {=/ rootComponent.isDefined =} - - {=# isExternalAuthEnabled =} - {/* - Wasp specific routes *must* go first to prevent user - defined routes from overriding them. - Details in https://github.com/wasp-lang/wasp/issues/2029 - */} - - - - {=/ isExternalAuthEnabled =} - {Object.entries(routes).map(([routeKey, route]) => ( - - ))} - - {=# rootComponent.isDefined =} - - {=/ rootComponent.isDefined =} - -) +const waspDefinedRoutes = [ + {=# isExternalAuthEnabled =} + { + path: "{= oAuthCallbackPath =}", + Component: OAuthCallbackPage, + }, + {=/ isExternalAuthEnabled =} +] +const userDefinedRoutes = Object.entries(routes).map(([routeKey, route]) => { + return { + path: route.to, + Component: routeNameToRouteComponent[routeKey], + } +}) -export default router +const browserRouter = createBrowserRouter([{ + path: '/', + {=# rootComponent.isDefined =} + element: <{= rootComponent.importIdentifier =} />, + {=/ rootComponent.isDefined =} + ErrorBoundary: DefaultRootErrorBoundary, + children: [ + ...waspDefinedRoutes, + ...userDefinedRoutes, + ], +}]) + +export const router = diff --git a/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx index 97e2e8ac1..71970f86b 100644 --- a/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx +++ b/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx @@ -25,7 +25,7 @@ import * as SocialIcons from '../social/SocialIcons' import { SocialButton } from '../social/SocialButton' {=/ isSocialAuthEnabled =} {=# isAnyPasswordBasedAuthEnabled =} -import { useHistory } from 'react-router-dom' +import { useNavigate } from 'react-router-dom' {=/ isAnyPasswordBasedAuthEnabled =} {=# enabledProviders.isUsernameAndPasswordAuthEnabled =} import { useUsernameAndPassword } from '../usernameAndPassword/useUsernameAndPassword' @@ -147,7 +147,7 @@ export const LoginSignupForm = ({ const isLogin = state === 'login' const cta = isLogin ? 'Log in' : 'Sign up'; {=# isAnyPasswordBasedAuthEnabled =} - const history = useHistory(); + const navigate = useNavigate(); const onErrorHandler = (error) => { setErrorMessage({ title: error.message, description: error.data?.data?.message }) }; @@ -159,7 +159,7 @@ export const LoginSignupForm = ({ isLogin, onError: onErrorHandler, onSuccess() { - history.push('{= onAuthSucceededRedirectTo =}') + navigate('{= onAuthSucceededRedirectTo =}') }, }); {=/ enabledProviders.isUsernameAndPasswordAuthEnabled =} @@ -172,7 +172,7 @@ export const LoginSignupForm = ({ setSuccessMessage(`You've signed up successfully! Check your email for the confirmation link.`) }, onLoginSuccess() { - history.push('{= onAuthSucceededRedirectTo =}') + navigate('{= onAuthSucceededRedirectTo =}') }, }); {=/ enabledProviders.isEmailAuthEnabled =} diff --git a/waspc/data/Generator/templates/sdk/wasp/client/router/index.ts b/waspc/data/Generator/templates/sdk/wasp/client/router/index.ts index 91e2ccb95..6731bfc0c 100644 --- a/waspc/data/Generator/templates/sdk/wasp/client/router/index.ts +++ b/waspc/data/Generator/templates/sdk/wasp/client/router/index.ts @@ -4,6 +4,7 @@ import type { RouteDefinitionsToRoutes, OptionalRouteOptions, ParamValue, + ExpandRouteOnOptionalStaticSegments, } from './types' // PUBLIC API @@ -11,17 +12,35 @@ export const routes = { {=# routes =} {= name =}: { to: "{= urlPath =}", - {=# hasUrlParams =} + {=# hasUrlParams =} build: ( - options: { - params: {{=# urlParams =}{= name =}{=# isOptional =}?{=/ isOptional =}: ParamValue;{=/ urlParams =}} - } & OptionalRouteOptions, - ) => interpolatePath("{= urlPath =}", options.params, options?.search, options?.hash), + options: OptionalRouteOptions + & { params: {{=# urlParams =}"{= name =}"{=# isOptional =}?{=/ isOptional =}: ParamValue;{=/ urlParams =}}} + {=# hasOptionalStaticSegments =} + & { path: ExpandRouteOnOptionalStaticSegments<"{= urlPath =}"> } + {=/ hasOptionalStaticSegments =} + ) => interpolatePath( + {=# hasOptionalStaticSegments =}options.path,{=/ hasOptionalStaticSegments =} + {=^ hasOptionalStaticSegments =}"{= urlPath =}",{=/ hasOptionalStaticSegments =} + options.params, + options?.search, + options?.hash + ), {=/ hasUrlParams =} {=^ hasUrlParams =} build: ( - options?: OptionalRouteOptions, - ) => interpolatePath("{= urlPath =}", undefined, options?.search, options?.hash), + options?: + OptionalRouteOptions + {=# hasOptionalStaticSegments =} + & { path: ExpandRouteOnOptionalStaticSegments<"{= urlPath =}"> } + {=/ hasOptionalStaticSegments =} + ) => interpolatePath( + {=# hasOptionalStaticSegments =}options.path,{=/ hasOptionalStaticSegments =} + {=^ hasOptionalStaticSegments =}"{= urlPath =}",{=/ hasOptionalStaticSegments =} + undefined, + options?.search, + options?.hash + ), {=/ hasUrlParams =} }, {=/ routes =} diff --git a/waspc/data/Generator/templates/sdk/wasp/client/router/linkHelpers.ts b/waspc/data/Generator/templates/sdk/wasp/client/router/linkHelpers.ts index e10cba928..84dc58733 100644 --- a/waspc/data/Generator/templates/sdk/wasp/client/router/linkHelpers.ts +++ b/waspc/data/Generator/templates/sdk/wasp/client/router/linkHelpers.ts @@ -17,6 +17,9 @@ export function interpolatePath( function interpolatePathParams(path: string, params: Params) { function mapPathPart(part: string) { + if (part === '*') { + return params['*']; + } if (part.startsWith(":")) { const paramName = extractParamNameFromPathPart(part); return params[paramName]; diff --git a/waspc/data/Generator/templates/sdk/wasp/client/router/types.ts b/waspc/data/Generator/templates/sdk/wasp/client/router/types.ts index 71c6a3812..03e751be3 100644 --- a/waspc/data/Generator/templates/sdk/wasp/client/router/types.ts +++ b/waspc/data/Generator/templates/sdk/wasp/client/router/types.ts @@ -2,7 +2,7 @@ export type RouteDefinitionsToRoutes = RouteDefinitionsToRoutesObj[keyof RouteDefinitionsToRoutesObj] - // PRIVATE API +// PRIVATE API export type OptionalRouteOptions = { search?: Search hash?: string @@ -21,7 +21,7 @@ export type Search = type RouteDefinitionsToRoutesObj = { [K in keyof Routes]: { - to: Routes[K]['to'] + to: ExpandRouteOnOptionalStaticSegments } & ParamsFromBuildFn } @@ -39,3 +39,60 @@ type ParamsFromBuildFn = Parameters[0] extends { } ? { params: Params } : { params?: never } + +// PRIVATE API (sdk) +/** + * Optional static segments handling: expands routes with optional segments + * into multiple routes, one for each possible combination of optional segments. + * + * For example: /users/tasks?/:id? will be expanded into two routes: + * - /users/:id? + * - /users/tasks/:id? + */ +export type ExpandRouteOnOptionalStaticSegments = JoinPath< + ExpandOptionalSegments>>> +>; + +type ParseSegments = T extends [infer Head, ...infer Tail] + ? [_ParseSegment, ...ParseSegments] + : T; + +type _ParseSegment = T extends `:${infer P}` + ? // Param segment + { segment: T } + : T extends `${infer S}?` + ? // Optional segment + { optionalSegment: S } + : // Regular segment + { segment: T }; + +type Segment = { segment: string }; +type OptionalSegment = { optionalSegment: string }; + +type Elem = Segment | OptionalSegment; + +type ExpandOptionalSegments = T extends [] + ? [] + : T extends [infer First extends Elem, ...infer Rest extends Elem[]] + ? First extends Segment + ? [First["segment"], ...ExpandOptionalSegments] + : First extends OptionalSegment + ? [First["optionalSegment"], ...ExpandOptionalSegments] | ExpandOptionalSegments + : [] + : []; + +type SplitPath = S extends "/" + ? [""] + : S extends `${infer T}/${infer U}` + ? [T, ...SplitPath] + : [S]; + +type JoinPath = T extends [infer Only extends string] + ? Only extends "" + ? "/" + : Only + : T extends [infer First extends string, ...infer Rest extends string[]] + ? `${First}/${JoinPath}` + : never; + +type NonEmptyString = S extends "" ? never : S; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest b/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest index c9a5e57b6..1ef46f2f2 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest @@ -219,6 +219,7 @@ waspBuild/.wasp/build/web-app/public/.gitkeep waspBuild/.wasp/build/web-app/public/favicon.ico waspBuild/.wasp/build/web-app/public/manifest.json waspBuild/.wasp/build/web-app/scripts/validate-env.mjs +waspBuild/.wasp/build/web-app/src/components/DefaultRootErrorBoundary.tsx waspBuild/.wasp/build/web-app/src/components/FullPageWrapper.tsx waspBuild/.wasp/build/web-app/src/components/Loader.module.css waspBuild/.wasp/build/web-app/src/components/Loader.tsx diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums index e42e2076c..88029e194 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums @@ -116,21 +116,21 @@ "file", "../out/sdk/wasp/client/router/index.ts" ], - "6fe430c2956c25c3833d6893c695523a7b2a5f1cb9eceb0bed26429c2e33e6a0" + "ad12dae94c1c68a4f31f660dd942fc0b43d713b4ed37145faeb2f65d3e5bc392" ], [ [ "file", "../out/sdk/wasp/client/router/linkHelpers.ts" ], - "62e48c724070c59a95c837288112922326e1351ee1defa4759bdc47f7361ce9e" + "3b523ed6020fe18d71a108551de0a71cbfa23bdc4e3245b3491c5224251faa20" ], [ [ "file", "../out/sdk/wasp/client/router/types.ts" ], - "9bfaabe92126b641e6b939c26bac121dbbe1bb495392a5d40474ef4981432b5f" + "ffbce0f351b849dfe04f00421a31844836cbd5a80ab97445f6ed8859e6b94928" ], [ [ @@ -200,7 +200,7 @@ "file", "../out/sdk/wasp/package.json" ], - "866e8d016c5972a35983615a9ac0bc4b3c1b25f4155ed09b60300be71af975c7" + "c5dc0e880b6924c30799671f3204f15687c1e50e338144ba82e62916dba80c9d" ], [ [ @@ -536,7 +536,7 @@ "file", "web-app/package.json" ], - "c9ec6110684c2e6c76392fc93458756ca636fa30f2b6c23db1507c0cc910e8b8" + "b1d6de065bb861e6631ecc504632ebdf69c2e34bd7e5091f8f1879befcb90a68" ], [ [ @@ -566,6 +566,13 @@ ], "a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd" ], + [ + [ + "file", + "web-app/src/components/DefaultRootErrorBoundary.tsx" + ], + "4a141a28ca7aed9daddd75c156f7bae5eec50f3e5a85b6a43a28fa2648f34c44" + ], [ [ "file", @@ -599,7 +606,7 @@ "file", "web-app/src/index.tsx" ], - "ff83778b7f03a8f15116bc73adce607c2c13fc9cbd4228626980a530541aaeb2" + "61265d54c480ce94df81fdd0c65fa2e3c154e7d9fb9621c87a2d81e32ecd2adf" ], [ [ @@ -613,7 +620,7 @@ "file", "web-app/src/router.tsx" ], - "5641aec64e4771fde7aaedb217fbb726103c9859de65f2b6bdc51fbb2e970a3e" + "72f880dba47672ec9fb112a8b88cc8d831458cccddcc891b853a6dc9809a5752" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedNpmDepsLog.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedNpmDepsLog.json index e77826b40..dd987bba2 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedNpmDepsLog.json +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedNpmDepsLog.json @@ -1 +1 @@ -{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}} \ No newline at end of file +{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/index.ts index 90f93b35f..e8cfb7dd6 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/index.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/index.ts @@ -3,6 +3,7 @@ import type { RouteDefinitionsToRoutes, OptionalRouteOptions, ParamValue, + ExpandRouteOnOptionalStaticSegments, } from './types' // PUBLIC API @@ -10,8 +11,15 @@ export const routes = { RootRoute: { to: "/", build: ( - options?: OptionalRouteOptions, - ) => interpolatePath("/", undefined, options?.search, options?.hash), + options?: + OptionalRouteOptions + ) => interpolatePath( + + "/", + undefined, + options?.search, + options?.hash + ), }, } as const; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/linkHelpers.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/linkHelpers.ts index e10cba928..84dc58733 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/linkHelpers.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/linkHelpers.ts @@ -17,6 +17,9 @@ export function interpolatePath( function interpolatePathParams(path: string, params: Params) { function mapPathPart(part: string) { + if (part === '*') { + return params['*']; + } if (part.startsWith(":")) { const paramName = extractParamNameFromPathPart(part); return params[paramName]; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/types.ts index 71c6a3812..03e751be3 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/types.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/types.ts @@ -2,7 +2,7 @@ export type RouteDefinitionsToRoutes = RouteDefinitionsToRoutesObj[keyof RouteDefinitionsToRoutesObj] - // PRIVATE API +// PRIVATE API export type OptionalRouteOptions = { search?: Search hash?: string @@ -21,7 +21,7 @@ export type Search = type RouteDefinitionsToRoutesObj = { [K in keyof Routes]: { - to: Routes[K]['to'] + to: ExpandRouteOnOptionalStaticSegments } & ParamsFromBuildFn } @@ -39,3 +39,60 @@ type ParamsFromBuildFn = Parameters[0] extends { } ? { params: Params } : { params?: never } + +// PRIVATE API (sdk) +/** + * Optional static segments handling: expands routes with optional segments + * into multiple routes, one for each possible combination of optional segments. + * + * For example: /users/tasks?/:id? will be expanded into two routes: + * - /users/:id? + * - /users/tasks/:id? + */ +export type ExpandRouteOnOptionalStaticSegments = JoinPath< + ExpandOptionalSegments>>> +>; + +type ParseSegments = T extends [infer Head, ...infer Tail] + ? [_ParseSegment, ...ParseSegments] + : T; + +type _ParseSegment = T extends `:${infer P}` + ? // Param segment + { segment: T } + : T extends `${infer S}?` + ? // Optional segment + { optionalSegment: S } + : // Regular segment + { segment: T }; + +type Segment = { segment: string }; +type OptionalSegment = { optionalSegment: string }; + +type Elem = Segment | OptionalSegment; + +type ExpandOptionalSegments = T extends [] + ? [] + : T extends [infer First extends Elem, ...infer Rest extends Elem[]] + ? First extends Segment + ? [First["segment"], ...ExpandOptionalSegments] + : First extends OptionalSegment + ? [First["optionalSegment"], ...ExpandOptionalSegments] | ExpandOptionalSegments + : [] + : []; + +type SplitPath = S extends "/" + ? [""] + : S extends `${infer T}/${infer U}` + ? [T, ...SplitPath] + : [S]; + +type JoinPath = T extends [infer Only extends string] + ? Only extends "" + ? "/" + : Only + : T extends [infer First extends string, ...infer Rest extends string[]] + ? `${First}/${JoinPath}` + : never; + +type NonEmptyString = S extends "" ? never : S; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.js.map index 35eeff35e..1abf37c22 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAO/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OAA8B,EAC9B,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;KACrE;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAQ/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OACoB,EACpB,EAAE,CAAC,eAAe,CAEhB,GAAG,EACH,SAAS,EACT,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EACf,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CACd;KACJ;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js index 144c9efc7..f6e6c37c7 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js @@ -9,6 +9,9 @@ export function interpolatePath(path, params, search, hash) { } function interpolatePathParams(path, params) { function mapPathPart(part) { + if (part === '*') { + return params['*']; + } if (part.startsWith(":")) { const paramName = extractParamNameFromPathPart(part); return params[paramName]; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js.map index c532d39f5..0614b93b1 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js.map @@ -1 +1 @@ -{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file +{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.d.ts index d80cec9aa..9abd699cf 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.d.ts @@ -10,7 +10,7 @@ export type Params = { export type Search = string[][] | Record | string | URLSearchParams; type RouteDefinitionsToRoutesObj = { [K in keyof Routes]: { - to: Routes[K]['to']; + to: ExpandRouteOnOptionalStaticSegments; } & ParamsFromBuildFn; }; type RoutesDefinition = { @@ -27,4 +27,32 @@ type ParamsFromBuildFn = Parameters[0] extends { } : { params?: never; }; +/** + * Optional static segments handling: expands routes with optional segments + * into multiple routes, one for each possible combination of optional segments. + * + * For example: /users/tasks?/:id? will be expanded into two routes: + * - /users/:id? + * - /users/tasks/:id? + */ +export type ExpandRouteOnOptionalStaticSegments = JoinPath>>>>; +type ParseSegments = T extends [infer Head, ...infer Tail] ? [_ParseSegment, ...ParseSegments] : T; +type _ParseSegment = T extends `:${infer P}` ? { + segment: T; +} : T extends `${infer S}?` ? { + optionalSegment: S; +} : { + segment: T; +}; +type Segment = { + segment: string; +}; +type OptionalSegment = { + optionalSegment: string; +}; +type Elem = Segment | OptionalSegment; +type ExpandOptionalSegments = T extends [] ? [] : T extends [infer First extends Elem, ...infer Rest extends Elem[]] ? First extends Segment ? [First["segment"], ...ExpandOptionalSegments] : First extends OptionalSegment ? [First["optionalSegment"], ...ExpandOptionalSegments] | ExpandOptionalSegments : [] : []; +type SplitPath = S extends "/" ? [""] : S extends `${infer T}/${infer U}` ? [T, ...SplitPath] : [S]; +type JoinPath = T extends [infer Only extends string] ? Only extends "" ? "/" : Only : T extends [infer First extends string, ...infer Rest extends string[]] ? `${First}/${JoinPath}` : never; +type NonEmptyString = S extends "" ? never : S; export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/package.json index ea53aee6b..83a4dbab0 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/package.json +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/package.json @@ -4,8 +4,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "axios": "^1.4.0", "express": "~4.18.1", @@ -16,13 +14,14 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" }, "exports": { "./api/events": "./dist/api/events.js", diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json index 595007045..77db243ba 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json @@ -17,13 +17,12 @@ "mitt": "3.0.0", "react-dom": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2" }, "devDependencies": { "@tsconfig/vite-react": "^2.0.0", "@types/react-dom": "^18.0.11", - "@types/react-router-dom": "^5.3.3", "@vitejs/plugin-react": "^4.2.1", "dotenv": "^16.0.3" }, diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/components/DefaultRootErrorBoundary.tsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/components/DefaultRootErrorBoundary.tsx new file mode 100644 index 000000000..7af24e15d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/components/DefaultRootErrorBoundary.tsx @@ -0,0 +1,13 @@ +import { useRouteError } from 'react-router-dom' + +import { FullPageWrapper } from './FullPageWrapper' + +export function DefaultRootErrorBoundary() { + const error = useRouteError() + console.error(error) + return ( + +
There was an error rendering this page. Check the browser console for more information.
+
+ ) +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/index.tsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/index.tsx index 0b7f1d985..50044cc49 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/index.tsx +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/index.tsx @@ -2,7 +2,7 @@ import React from 'react' import ReactDOM from 'react-dom/client' import { QueryClientProvider } from '@tanstack/react-query' -import router from './router' +import { router } from './router' import { initializeQueryClient, queryClientInitialized, diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/router.tsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/router.tsx index 9ecd93cb0..9f1e1b46b 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/router.tsx +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/router.tsx @@ -1,29 +1,34 @@ import React from 'react' -import { Route, Switch, BrowserRouter as Router } from 'react-router-dom' +import { createBrowserRouter, RouterProvider } from 'react-router-dom' import { MainPage } from '../../../../src/MainPage' +import { DefaultRootErrorBoundary } from './components/DefaultRootErrorBoundary' + import { routes } from 'wasp/client/router' export const routeNameToRouteComponent = { RootRoute: MainPage, } as const; -const router = ( - - - {Object.entries(routes).map(([routeKey, route]) => ( - - ))} - - -) +const waspDefinedRoutes = [ +] +const userDefinedRoutes = Object.entries(routes).map(([routeKey, route]) => { + return { + path: route.to, + Component: routeNameToRouteComponent[routeKey], + } +}) -export default router +const browserRouter = createBrowserRouter([{ + path: '/', + ErrorBoundary: DefaultRootErrorBoundary, + children: [ + ...waspDefinedRoutes, + ...userDefinedRoutes, + ], +}]) + +export const router = diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/index.ts index 90f93b35f..e8cfb7dd6 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/index.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/index.ts @@ -3,6 +3,7 @@ import type { RouteDefinitionsToRoutes, OptionalRouteOptions, ParamValue, + ExpandRouteOnOptionalStaticSegments, } from './types' // PUBLIC API @@ -10,8 +11,15 @@ export const routes = { RootRoute: { to: "/", build: ( - options?: OptionalRouteOptions, - ) => interpolatePath("/", undefined, options?.search, options?.hash), + options?: + OptionalRouteOptions + ) => interpolatePath( + + "/", + undefined, + options?.search, + options?.hash + ), }, } as const; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/linkHelpers.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/linkHelpers.ts index e10cba928..84dc58733 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/linkHelpers.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/linkHelpers.ts @@ -17,6 +17,9 @@ export function interpolatePath( function interpolatePathParams(path: string, params: Params) { function mapPathPart(part: string) { + if (part === '*') { + return params['*']; + } if (part.startsWith(":")) { const paramName = extractParamNameFromPathPart(part); return params[paramName]; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/types.ts index 71c6a3812..03e751be3 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/types.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/types.ts @@ -2,7 +2,7 @@ export type RouteDefinitionsToRoutes = RouteDefinitionsToRoutesObj[keyof RouteDefinitionsToRoutesObj] - // PRIVATE API +// PRIVATE API export type OptionalRouteOptions = { search?: Search hash?: string @@ -21,7 +21,7 @@ export type Search = type RouteDefinitionsToRoutesObj = { [K in keyof Routes]: { - to: Routes[K]['to'] + to: ExpandRouteOnOptionalStaticSegments } & ParamsFromBuildFn } @@ -39,3 +39,60 @@ type ParamsFromBuildFn = Parameters[0] extends { } ? { params: Params } : { params?: never } + +// PRIVATE API (sdk) +/** + * Optional static segments handling: expands routes with optional segments + * into multiple routes, one for each possible combination of optional segments. + * + * For example: /users/tasks?/:id? will be expanded into two routes: + * - /users/:id? + * - /users/tasks/:id? + */ +export type ExpandRouteOnOptionalStaticSegments = JoinPath< + ExpandOptionalSegments>>> +>; + +type ParseSegments = T extends [infer Head, ...infer Tail] + ? [_ParseSegment, ...ParseSegments] + : T; + +type _ParseSegment = T extends `:${infer P}` + ? // Param segment + { segment: T } + : T extends `${infer S}?` + ? // Optional segment + { optionalSegment: S } + : // Regular segment + { segment: T }; + +type Segment = { segment: string }; +type OptionalSegment = { optionalSegment: string }; + +type Elem = Segment | OptionalSegment; + +type ExpandOptionalSegments = T extends [] + ? [] + : T extends [infer First extends Elem, ...infer Rest extends Elem[]] + ? First extends Segment + ? [First["segment"], ...ExpandOptionalSegments] + : First extends OptionalSegment + ? [First["optionalSegment"], ...ExpandOptionalSegments] | ExpandOptionalSegments + : [] + : []; + +type SplitPath = S extends "/" + ? [""] + : S extends `${infer T}/${infer U}` + ? [T, ...SplitPath] + : [S]; + +type JoinPath = T extends [infer Only extends string] + ? Only extends "" + ? "/" + : Only + : T extends [infer First extends string, ...infer Rest extends string[]] + ? `${First}/${JoinPath}` + : never; + +type NonEmptyString = S extends "" ? never : S; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/index.js.map index 35eeff35e..1abf37c22 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/index.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAO/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OAA8B,EAC9B,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;KACrE;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAQ/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OACoB,EACpB,EAAE,CAAC,eAAe,CAEhB,GAAG,EACH,SAAS,EACT,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EACf,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CACd;KACJ;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js index 144c9efc7..f6e6c37c7 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js @@ -9,6 +9,9 @@ export function interpolatePath(path, params, search, hash) { } function interpolatePathParams(path, params) { function mapPathPart(part) { + if (part === '*') { + return params['*']; + } if (part.startsWith(":")) { const paramName = extractParamNameFromPathPart(part); return params[paramName]; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map index c532d39f5..0614b93b1 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map @@ -1 +1 @@ -{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file +{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/types.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/types.d.ts index d80cec9aa..9abd699cf 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/types.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/types.d.ts @@ -10,7 +10,7 @@ export type Params = { export type Search = string[][] | Record | string | URLSearchParams; type RouteDefinitionsToRoutesObj = { [K in keyof Routes]: { - to: Routes[K]['to']; + to: ExpandRouteOnOptionalStaticSegments; } & ParamsFromBuildFn; }; type RoutesDefinition = { @@ -27,4 +27,32 @@ type ParamsFromBuildFn = Parameters[0] extends { } : { params?: never; }; +/** + * Optional static segments handling: expands routes with optional segments + * into multiple routes, one for each possible combination of optional segments. + * + * For example: /users/tasks?/:id? will be expanded into two routes: + * - /users/:id? + * - /users/tasks/:id? + */ +export type ExpandRouteOnOptionalStaticSegments = JoinPath>>>>; +type ParseSegments = T extends [infer Head, ...infer Tail] ? [_ParseSegment, ...ParseSegments] : T; +type _ParseSegment = T extends `:${infer P}` ? { + segment: T; +} : T extends `${infer S}?` ? { + optionalSegment: S; +} : { + segment: T; +}; +type Segment = { + segment: string; +}; +type OptionalSegment = { + optionalSegment: string; +}; +type Elem = Segment | OptionalSegment; +type ExpandOptionalSegments = T extends [] ? [] : T extends [infer First extends Elem, ...infer Rest extends Elem[]] ? First extends Segment ? [First["segment"], ...ExpandOptionalSegments] : First extends OptionalSegment ? [First["optionalSegment"], ...ExpandOptionalSegments] | ExpandOptionalSegments : [] : []; +type SplitPath = S extends "/" ? [""] : S extends `${infer T}/${infer U}` ? [T, ...SplitPath] : [S]; +type JoinPath = T extends [infer Only extends string] ? Only extends "" ? "/" : Only : T extends [infer First extends string, ...infer Rest extends string[]] ? `${First}/${JoinPath}` : never; +type NonEmptyString = S extends "" ? never : S; export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/package.json index ea53aee6b..83a4dbab0 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/package.json +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/package.json @@ -4,8 +4,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "axios": "^1.4.0", "express": "~4.18.1", @@ -16,13 +14,14 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" }, "exports": { "./api/events": "./dist/api/events.js", diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest b/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest index ec7c412b7..be6525f51 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest @@ -216,6 +216,7 @@ waspCompile/.wasp/out/web-app/public/.gitkeep waspCompile/.wasp/out/web-app/public/favicon.ico waspCompile/.wasp/out/web-app/public/manifest.json waspCompile/.wasp/out/web-app/scripts/validate-env.mjs +waspCompile/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx waspCompile/.wasp/out/web-app/src/components/FullPageWrapper.tsx waspCompile/.wasp/out/web-app/src/components/Loader.module.css waspCompile/.wasp/out/web-app/src/components/Loader.tsx diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums index a87f35a0c..eb921c7f0 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums @@ -116,21 +116,21 @@ "file", "../out/sdk/wasp/client/router/index.ts" ], - "6fe430c2956c25c3833d6893c695523a7b2a5f1cb9eceb0bed26429c2e33e6a0" + "ad12dae94c1c68a4f31f660dd942fc0b43d713b4ed37145faeb2f65d3e5bc392" ], [ [ "file", "../out/sdk/wasp/client/router/linkHelpers.ts" ], - "62e48c724070c59a95c837288112922326e1351ee1defa4759bdc47f7361ce9e" + "3b523ed6020fe18d71a108551de0a71cbfa23bdc4e3245b3491c5224251faa20" ], [ [ "file", "../out/sdk/wasp/client/router/types.ts" ], - "9bfaabe92126b641e6b939c26bac121dbbe1bb495392a5d40474ef4981432b5f" + "ffbce0f351b849dfe04f00421a31844836cbd5a80ab97445f6ed8859e6b94928" ], [ [ @@ -200,7 +200,7 @@ "file", "../out/sdk/wasp/package.json" ], - "866e8d016c5972a35983615a9ac0bc4b3c1b25f4155ed09b60300be71af975c7" + "c5dc0e880b6924c30799671f3204f15687c1e50e338144ba82e62916dba80c9d" ], [ [ @@ -550,7 +550,7 @@ "file", "web-app/package.json" ], - "58b50932dadb8d0eadd20132f39dc1871eb9dfc026978fe7db217be58eb73a51" + "8dabb1f0aa1f517bc272a7b6c9a13f8de348dbd064002dbcf0614c8d342f18e6" ], [ [ @@ -580,6 +580,13 @@ ], "a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd" ], + [ + [ + "file", + "web-app/src/components/DefaultRootErrorBoundary.tsx" + ], + "4a141a28ca7aed9daddd75c156f7bae5eec50f3e5a85b6a43a28fa2648f34c44" + ], [ [ "file", @@ -613,7 +620,7 @@ "file", "web-app/src/index.tsx" ], - "ff83778b7f03a8f15116bc73adce607c2c13fc9cbd4228626980a530541aaeb2" + "61265d54c480ce94df81fdd0c65fa2e3c154e7d9fb9621c87a2d81e32ecd2adf" ], [ [ @@ -627,7 +634,7 @@ "file", "web-app/src/router.tsx" ], - "5641aec64e4771fde7aaedb217fbb726103c9859de65f2b6bdc51fbb2e970a3e" + "72f880dba47672ec9fb112a8b88cc8d831458cccddcc891b853a6dc9809a5752" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedNpmDepsLog.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedNpmDepsLog.json index e77826b40..dd987bba2 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedNpmDepsLog.json +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedNpmDepsLog.json @@ -1 +1 @@ -{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}} \ No newline at end of file +{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/index.ts index 90f93b35f..e8cfb7dd6 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/index.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/index.ts @@ -3,6 +3,7 @@ import type { RouteDefinitionsToRoutes, OptionalRouteOptions, ParamValue, + ExpandRouteOnOptionalStaticSegments, } from './types' // PUBLIC API @@ -10,8 +11,15 @@ export const routes = { RootRoute: { to: "/", build: ( - options?: OptionalRouteOptions, - ) => interpolatePath("/", undefined, options?.search, options?.hash), + options?: + OptionalRouteOptions + ) => interpolatePath( + + "/", + undefined, + options?.search, + options?.hash + ), }, } as const; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/linkHelpers.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/linkHelpers.ts index e10cba928..84dc58733 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/linkHelpers.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/linkHelpers.ts @@ -17,6 +17,9 @@ export function interpolatePath( function interpolatePathParams(path: string, params: Params) { function mapPathPart(part: string) { + if (part === '*') { + return params['*']; + } if (part.startsWith(":")) { const paramName = extractParamNameFromPathPart(part); return params[paramName]; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/types.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/types.ts index 71c6a3812..03e751be3 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/types.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/types.ts @@ -2,7 +2,7 @@ export type RouteDefinitionsToRoutes = RouteDefinitionsToRoutesObj[keyof RouteDefinitionsToRoutesObj] - // PRIVATE API +// PRIVATE API export type OptionalRouteOptions = { search?: Search hash?: string @@ -21,7 +21,7 @@ export type Search = type RouteDefinitionsToRoutesObj = { [K in keyof Routes]: { - to: Routes[K]['to'] + to: ExpandRouteOnOptionalStaticSegments } & ParamsFromBuildFn } @@ -39,3 +39,60 @@ type ParamsFromBuildFn = Parameters[0] extends { } ? { params: Params } : { params?: never } + +// PRIVATE API (sdk) +/** + * Optional static segments handling: expands routes with optional segments + * into multiple routes, one for each possible combination of optional segments. + * + * For example: /users/tasks?/:id? will be expanded into two routes: + * - /users/:id? + * - /users/tasks/:id? + */ +export type ExpandRouteOnOptionalStaticSegments = JoinPath< + ExpandOptionalSegments>>> +>; + +type ParseSegments = T extends [infer Head, ...infer Tail] + ? [_ParseSegment, ...ParseSegments] + : T; + +type _ParseSegment = T extends `:${infer P}` + ? // Param segment + { segment: T } + : T extends `${infer S}?` + ? // Optional segment + { optionalSegment: S } + : // Regular segment + { segment: T }; + +type Segment = { segment: string }; +type OptionalSegment = { optionalSegment: string }; + +type Elem = Segment | OptionalSegment; + +type ExpandOptionalSegments = T extends [] + ? [] + : T extends [infer First extends Elem, ...infer Rest extends Elem[]] + ? First extends Segment + ? [First["segment"], ...ExpandOptionalSegments] + : First extends OptionalSegment + ? [First["optionalSegment"], ...ExpandOptionalSegments] | ExpandOptionalSegments + : [] + : []; + +type SplitPath = S extends "/" + ? [""] + : S extends `${infer T}/${infer U}` + ? [T, ...SplitPath] + : [S]; + +type JoinPath = T extends [infer Only extends string] + ? Only extends "" + ? "/" + : Only + : T extends [infer First extends string, ...infer Rest extends string[]] + ? `${First}/${JoinPath}` + : never; + +type NonEmptyString = S extends "" ? never : S; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.js.map index 35eeff35e..1abf37c22 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.js.map +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAO/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OAA8B,EAC9B,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;KACrE;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAQ/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OACoB,EACpB,EAAE,CAAC,eAAe,CAEhB,GAAG,EACH,SAAS,EACT,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EACf,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CACd;KACJ;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js index 144c9efc7..f6e6c37c7 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js @@ -9,6 +9,9 @@ export function interpolatePath(path, params, search, hash) { } function interpolatePathParams(path, params) { function mapPathPart(part) { + if (part === '*') { + return params['*']; + } if (part.startsWith(":")) { const paramName = extractParamNameFromPathPart(part); return params[paramName]; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map index c532d39f5..0614b93b1 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map @@ -1 +1 @@ -{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file +{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.d.ts index d80cec9aa..9abd699cf 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.d.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.d.ts @@ -10,7 +10,7 @@ export type Params = { export type Search = string[][] | Record | string | URLSearchParams; type RouteDefinitionsToRoutesObj = { [K in keyof Routes]: { - to: Routes[K]['to']; + to: ExpandRouteOnOptionalStaticSegments; } & ParamsFromBuildFn; }; type RoutesDefinition = { @@ -27,4 +27,32 @@ type ParamsFromBuildFn = Parameters[0] extends { } : { params?: never; }; +/** + * Optional static segments handling: expands routes with optional segments + * into multiple routes, one for each possible combination of optional segments. + * + * For example: /users/tasks?/:id? will be expanded into two routes: + * - /users/:id? + * - /users/tasks/:id? + */ +export type ExpandRouteOnOptionalStaticSegments = JoinPath>>>>; +type ParseSegments = T extends [infer Head, ...infer Tail] ? [_ParseSegment, ...ParseSegments] : T; +type _ParseSegment = T extends `:${infer P}` ? { + segment: T; +} : T extends `${infer S}?` ? { + optionalSegment: S; +} : { + segment: T; +}; +type Segment = { + segment: string; +}; +type OptionalSegment = { + optionalSegment: string; +}; +type Elem = Segment | OptionalSegment; +type ExpandOptionalSegments = T extends [] ? [] : T extends [infer First extends Elem, ...infer Rest extends Elem[]] ? First extends Segment ? [First["segment"], ...ExpandOptionalSegments] : First extends OptionalSegment ? [First["optionalSegment"], ...ExpandOptionalSegments] | ExpandOptionalSegments : [] : []; +type SplitPath = S extends "/" ? [""] : S extends `${infer T}/${infer U}` ? [T, ...SplitPath] : [S]; +type JoinPath = T extends [infer Only extends string] ? Only extends "" ? "/" : Only : T extends [infer First extends string, ...infer Rest extends string[]] ? `${First}/${JoinPath}` : never; +type NonEmptyString = S extends "" ? never : S; export {}; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/package.json index ea53aee6b..83a4dbab0 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/package.json +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/package.json @@ -4,8 +4,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "axios": "^1.4.0", "express": "~4.18.1", @@ -16,13 +14,14 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" }, "exports": { "./api/events": "./dist/api/events.js", diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/package.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/package.json index f177c3959..181b622dd 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/package.json +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/package.json @@ -17,13 +17,12 @@ "mitt": "3.0.0", "react-dom": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2" }, "devDependencies": { "@tsconfig/vite-react": "^2.0.0", "@types/react-dom": "^18.0.11", - "@types/react-router-dom": "^5.3.3", "@vitejs/plugin-react": "^4.2.1", "dotenv": "^16.0.3" }, diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx new file mode 100644 index 000000000..7af24e15d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx @@ -0,0 +1,13 @@ +import { useRouteError } from 'react-router-dom' + +import { FullPageWrapper } from './FullPageWrapper' + +export function DefaultRootErrorBoundary() { + const error = useRouteError() + console.error(error) + return ( + +
There was an error rendering this page. Check the browser console for more information.
+
+ ) +} diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/index.tsx b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/index.tsx index 0b7f1d985..50044cc49 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/index.tsx +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/index.tsx @@ -2,7 +2,7 @@ import React from 'react' import ReactDOM from 'react-dom/client' import { QueryClientProvider } from '@tanstack/react-query' -import router from './router' +import { router } from './router' import { initializeQueryClient, queryClientInitialized, diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router.tsx b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router.tsx index 9ecd93cb0..9f1e1b46b 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router.tsx +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router.tsx @@ -1,29 +1,34 @@ import React from 'react' -import { Route, Switch, BrowserRouter as Router } from 'react-router-dom' +import { createBrowserRouter, RouterProvider } from 'react-router-dom' import { MainPage } from '../../../../src/MainPage' +import { DefaultRootErrorBoundary } from './components/DefaultRootErrorBoundary' + import { routes } from 'wasp/client/router' export const routeNameToRouteComponent = { RootRoute: MainPage, } as const; -const router = ( - - - {Object.entries(routes).map(([routeKey, route]) => ( - - ))} - - -) +const waspDefinedRoutes = [ +] +const userDefinedRoutes = Object.entries(routes).map(([routeKey, route]) => { + return { + path: route.to, + Component: routeNameToRouteComponent[routeKey], + } +}) -export default router +const browserRouter = createBrowserRouter([{ + path: '/', + ErrorBoundary: DefaultRootErrorBoundary, + children: [ + ...waspDefinedRoutes, + ...userDefinedRoutes, + ], +}]) + +export const router = diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest b/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest index 6f80170dc..022dd0bf8 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest @@ -508,6 +508,7 @@ waspComplexTest/.wasp/out/web-app/public/manifest.json waspComplexTest/.wasp/out/web-app/scripts/validate-env.mjs waspComplexTest/.wasp/out/web-app/src/auth/pages/OAuthCallback.tsx waspComplexTest/.wasp/out/web-app/src/auth/pages/createAuthRequiredPage.jsx +waspComplexTest/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx waspComplexTest/.wasp/out/web-app/src/components/FullPageWrapper.tsx waspComplexTest/.wasp/out/web-app/src/components/Loader.module.css waspComplexTest/.wasp/out/web-app/src/components/Loader.tsx diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums index 65f8003b5..dc3efbbb6 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums @@ -319,21 +319,21 @@ "file", "../out/sdk/wasp/client/router/index.ts" ], - "6fe430c2956c25c3833d6893c695523a7b2a5f1cb9eceb0bed26429c2e33e6a0" + "ad12dae94c1c68a4f31f660dd942fc0b43d713b4ed37145faeb2f65d3e5bc392" ], [ [ "file", "../out/sdk/wasp/client/router/linkHelpers.ts" ], - "62e48c724070c59a95c837288112922326e1351ee1defa4759bdc47f7361ce9e" + "3b523ed6020fe18d71a108551de0a71cbfa23bdc4e3245b3491c5224251faa20" ], [ [ "file", "../out/sdk/wasp/client/router/types.ts" ], - "9bfaabe92126b641e6b939c26bac121dbbe1bb495392a5d40474ef4981432b5f" + "ffbce0f351b849dfe04f00421a31844836cbd5a80ab97445f6ed8859e6b94928" ], [ [ @@ -487,7 +487,7 @@ "file", "../out/sdk/wasp/package.json" ], - "a333b7881848511a13daf4220c5c96f447319660fad15d22f7e5272865dc2641" + "d018a4695d02879c54e6ed75d27e63acc6cc7b33386f1feeb853c5e10248b4f1" ], [ [ @@ -1180,7 +1180,7 @@ "file", "web-app/package.json" ], - "1b0855b401aae4ceb6eca959600a1fde84e9f7590beb8362a7d2fad40bcb6fef" + "b602a1d989b4e0950cf30fa1490d10bd5956aa4a5339acdd7358f44d00b534d0" ], [ [ @@ -1215,14 +1215,21 @@ "file", "web-app/src/auth/pages/OAuthCallback.tsx" ], - "f5f1214036b335cd000d49e89908d35bdffd1878887d15877b699a78154c7852" + "6414299e9cb46702b8daca23563991a46e70ef8e9ea985bc5d4fe48d2c646132" ], [ [ "file", "web-app/src/auth/pages/createAuthRequiredPage.jsx" ], - "011b5851a168fc4280b68a57a6ac2379fdbfb50d81f1fe0917be218ff9dba420" + "be2f872a6465690dec32a0d2a0c3b15d941846cc0059a9ec13d09650daccda7f" + ], + [ + [ + "file", + "web-app/src/components/DefaultRootErrorBoundary.tsx" + ], + "4a141a28ca7aed9daddd75c156f7bae5eec50f3e5a85b6a43a28fa2648f34c44" ], [ [ @@ -1257,7 +1264,7 @@ "file", "web-app/src/index.tsx" ], - "46b4cde819de4048b82feb249ae662fb60de2297c6a740f49da239011848458d" + "27e9b6e82ad360f481cc4883b4321e18871b7c6d9be5abbaa4613c0a6faebbcd" ], [ [ @@ -1271,7 +1278,7 @@ "file", "web-app/src/router.tsx" ], - "8dc5955b5a640cbae8836cc227e6ade562b8e7ba9eda5ce076436955807fe0fe" + "8160ffecec82dde31d889825cf0a2d605e2b729be555c650b8accca2252ed613" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedNpmDepsLog.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedNpmDepsLog.json index 322c1f701..348c8f375 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedNpmDepsLog.json +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedNpmDepsLog.json @@ -1 +1 @@ -{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@stitches/react","version":"^1.2.8"},{"name":"@node-rs/argon2","version":"^1.8.3"},{"name":"arctic","version":"^1.2.1"},{"name":"lucia","version":"^3.0.1"},{"name":"oslo","version":"^1.1.2"},{"name":"@lucia-auth/adapter-prisma","version":"^4.0.0"},{"name":"@sendgrid/mail","version":"^7.7.0"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"pg-boss","version":"^8.4.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}} \ No newline at end of file +{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"@stitches/react","version":"^1.2.8"},{"name":"@node-rs/argon2","version":"^1.8.3"},{"name":"arctic","version":"^1.2.1"},{"name":"lucia","version":"^3.0.1"},{"name":"oslo","version":"^1.1.2"},{"name":"@lucia-auth/adapter-prisma","version":"^4.0.0"},{"name":"@sendgrid/mail","version":"^7.7.0"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"pg-boss","version":"^8.4.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/router/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/router/index.ts index 90f93b35f..e8cfb7dd6 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/router/index.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/router/index.ts @@ -3,6 +3,7 @@ import type { RouteDefinitionsToRoutes, OptionalRouteOptions, ParamValue, + ExpandRouteOnOptionalStaticSegments, } from './types' // PUBLIC API @@ -10,8 +11,15 @@ export const routes = { RootRoute: { to: "/", build: ( - options?: OptionalRouteOptions, - ) => interpolatePath("/", undefined, options?.search, options?.hash), + options?: + OptionalRouteOptions + ) => interpolatePath( + + "/", + undefined, + options?.search, + options?.hash + ), }, } as const; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/router/linkHelpers.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/router/linkHelpers.ts index e10cba928..84dc58733 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/router/linkHelpers.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/router/linkHelpers.ts @@ -17,6 +17,9 @@ export function interpolatePath( function interpolatePathParams(path: string, params: Params) { function mapPathPart(part: string) { + if (part === '*') { + return params['*']; + } if (part.startsWith(":")) { const paramName = extractParamNameFromPathPart(part); return params[paramName]; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/router/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/router/types.ts index 71c6a3812..03e751be3 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/router/types.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/router/types.ts @@ -2,7 +2,7 @@ export type RouteDefinitionsToRoutes = RouteDefinitionsToRoutesObj[keyof RouteDefinitionsToRoutesObj] - // PRIVATE API +// PRIVATE API export type OptionalRouteOptions = { search?: Search hash?: string @@ -21,7 +21,7 @@ export type Search = type RouteDefinitionsToRoutesObj = { [K in keyof Routes]: { - to: Routes[K]['to'] + to: ExpandRouteOnOptionalStaticSegments } & ParamsFromBuildFn } @@ -39,3 +39,60 @@ type ParamsFromBuildFn = Parameters[0] extends { } ? { params: Params } : { params?: never } + +// PRIVATE API (sdk) +/** + * Optional static segments handling: expands routes with optional segments + * into multiple routes, one for each possible combination of optional segments. + * + * For example: /users/tasks?/:id? will be expanded into two routes: + * - /users/:id? + * - /users/tasks/:id? + */ +export type ExpandRouteOnOptionalStaticSegments = JoinPath< + ExpandOptionalSegments>>> +>; + +type ParseSegments = T extends [infer Head, ...infer Tail] + ? [_ParseSegment, ...ParseSegments] + : T; + +type _ParseSegment = T extends `:${infer P}` + ? // Param segment + { segment: T } + : T extends `${infer S}?` + ? // Optional segment + { optionalSegment: S } + : // Regular segment + { segment: T }; + +type Segment = { segment: string }; +type OptionalSegment = { optionalSegment: string }; + +type Elem = Segment | OptionalSegment; + +type ExpandOptionalSegments = T extends [] + ? [] + : T extends [infer First extends Elem, ...infer Rest extends Elem[]] + ? First extends Segment + ? [First["segment"], ...ExpandOptionalSegments] + : First extends OptionalSegment + ? [First["optionalSegment"], ...ExpandOptionalSegments] | ExpandOptionalSegments + : [] + : []; + +type SplitPath = S extends "/" + ? [""] + : S extends `${infer T}/${infer U}` + ? [T, ...SplitPath] + : [S]; + +type JoinPath = T extends [infer Only extends string] + ? Only extends "" + ? "/" + : Only + : T extends [infer First extends string, ...infer Rest extends string[]] + ? `${First}/${JoinPath}` + : never; + +type NonEmptyString = S extends "" ? never : S; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.js.map index 35eeff35e..1abf37c22 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAO/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OAA8B,EAC9B,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;KACrE;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAQ/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OACoB,EACpB,EAAE,CAAC,eAAe,CAEhB,GAAG,EACH,SAAS,EACT,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EACf,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CACd;KACJ;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js index 144c9efc7..f6e6c37c7 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js @@ -9,6 +9,9 @@ export function interpolatePath(path, params, search, hash) { } function interpolatePathParams(path, params) { function mapPathPart(part) { + if (part === '*') { + return params['*']; + } if (part.startsWith(":")) { const paramName = extractParamNameFromPathPart(part); return params[paramName]; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map index c532d39f5..0614b93b1 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map @@ -1 +1 @@ -{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file +{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.d.ts index d80cec9aa..9abd699cf 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.d.ts @@ -10,7 +10,7 @@ export type Params = { export type Search = string[][] | Record | string | URLSearchParams; type RouteDefinitionsToRoutesObj = { [K in keyof Routes]: { - to: Routes[K]['to']; + to: ExpandRouteOnOptionalStaticSegments; } & ParamsFromBuildFn; }; type RoutesDefinition = { @@ -27,4 +27,32 @@ type ParamsFromBuildFn = Parameters[0] extends { } : { params?: never; }; +/** + * Optional static segments handling: expands routes with optional segments + * into multiple routes, one for each possible combination of optional segments. + * + * For example: /users/tasks?/:id? will be expanded into two routes: + * - /users/:id? + * - /users/tasks/:id? + */ +export type ExpandRouteOnOptionalStaticSegments = JoinPath>>>>; +type ParseSegments = T extends [infer Head, ...infer Tail] ? [_ParseSegment, ...ParseSegments] : T; +type _ParseSegment = T extends `:${infer P}` ? { + segment: T; +} : T extends `${infer S}?` ? { + optionalSegment: S; +} : { + segment: T; +}; +type Segment = { + segment: string; +}; +type OptionalSegment = { + optionalSegment: string; +}; +type Elem = Segment | OptionalSegment; +type ExpandOptionalSegments = T extends [] ? [] : T extends [infer First extends Elem, ...infer Rest extends Elem[]] ? First extends Segment ? [First["segment"], ...ExpandOptionalSegments] : First extends OptionalSegment ? [First["optionalSegment"], ...ExpandOptionalSegments] | ExpandOptionalSegments : [] : []; +type SplitPath = S extends "/" ? [""] : S extends `${infer T}/${infer U}` ? [T, ...SplitPath] : [S]; +type JoinPath = T extends [infer Only extends string] ? Only extends "" ? "/" : Only : T extends [infer First extends string, ...infer Rest extends string[]] ? `${First}/${JoinPath}` : never; +type NonEmptyString = S extends "" ? never : S; export {}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/package.json index e2f4483e3..01460326f 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/package.json +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/package.json @@ -8,8 +8,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "arctic": "^1.2.1", "axios": "^1.4.0", @@ -24,13 +22,14 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" }, "exports": { "./api/events": "./dist/api/events.js", diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/package.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/package.json index 1b275ba8c..99801d15c 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/package.json +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/package.json @@ -17,13 +17,12 @@ "mitt": "3.0.0", "react-dom": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2" }, "devDependencies": { "@tsconfig/vite-react": "^2.0.0", "@types/react-dom": "^18.0.11", - "@types/react-router-dom": "^5.3.3", "@vitejs/plugin-react": "^4.2.1", "dotenv": "^16.0.3" }, diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/OAuthCallback.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/OAuthCallback.tsx index 79cd4117d..83e121f9e 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/OAuthCallback.tsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/OAuthCallback.tsx @@ -1,6 +1,6 @@ import { useEffect, useRef, useState } from "react"; import { type AxiosResponse } from "axios"; -import { Redirect, useLocation } from 'react-router-dom' +import { Navigate, useLocation } from 'react-router-dom' import { useAuth } from 'wasp/client/auth' import { api } from 'wasp/client/api' import { initSession } from 'wasp/auth/helpers/user' @@ -13,7 +13,7 @@ export function OAuthCallbackPage() { const { error, user } = useOAuthCallbackHandler(); if (user !== undefined && user !== null) { - return ; + return ; } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/createAuthRequiredPage.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/createAuthRequiredPage.jsx index 8136654fe..a4041992f 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/createAuthRequiredPage.jsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/createAuthRequiredPage.jsx @@ -1,6 +1,6 @@ import React from 'react' -import { Redirect } from 'react-router-dom' +import { Navigate } from 'react-router-dom' import { useAuth } from 'wasp/client/auth' import { Loader } from '../../components/Loader' @@ -16,7 +16,7 @@ const createAuthRequiredPage = (Page) => { if (user) { return } else { - return + return } case 'loading': return ( diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx new file mode 100644 index 000000000..7af24e15d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx @@ -0,0 +1,13 @@ +import { useRouteError } from 'react-router-dom' + +import { FullPageWrapper } from './FullPageWrapper' + +export function DefaultRootErrorBoundary() { + const error = useRouteError() + console.error(error) + return ( + +
There was an error rendering this page. Check the browser console for more information.
+
+ ) +} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/index.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/index.tsx index dceb89818..7814cd985 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/index.tsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/index.tsx @@ -2,7 +2,7 @@ import React from 'react' import ReactDOM from 'react-dom/client' import { QueryClientProvider } from '@tanstack/react-query' -import router from './router' +import { router } from './router' import { initializeQueryClient, queryClientInitialized, diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/router.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/router.tsx index 0b38010a2..820e47b75 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/router.tsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/router.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Route, Switch, BrowserRouter as Router } from 'react-router-dom' +import { createBrowserRouter, RouterProvider } from 'react-router-dom' import App from '../../../../src/client/App.jsx' import createAuthRequiredPage from "./auth/pages/createAuthRequiredPage" @@ -8,35 +8,35 @@ import { MainPage } from '../../../../src/MainPage' import { OAuthCallbackPage } from "./auth/pages/OAuthCallback" +import { DefaultRootErrorBoundary } from './components/DefaultRootErrorBoundary' + import { routes } from 'wasp/client/router' export const routeNameToRouteComponent = { RootRoute: MainPage, } as const; -const router = ( - - - - {/* - Wasp specific routes *must* go first to prevent user - defined routes from overriding them. - Details in https://github.com/wasp-lang/wasp/issues/2029 - */} - - - - {Object.entries(routes).map(([routeKey, route]) => ( - - ))} - - - -) +const waspDefinedRoutes = [ + { + path: "/oauth/callback", + Component: OAuthCallbackPage, + }, +] +const userDefinedRoutes = Object.entries(routes).map(([routeKey, route]) => { + return { + path: route.to, + Component: routeNameToRouteComponent[routeKey], + } +}) -export default router +const browserRouter = createBrowserRouter([{ + path: '/', + element: , + ErrorBoundary: DefaultRootErrorBoundary, + children: [ + ...waspDefinedRoutes, + ...userDefinedRoutes, + ], +}]) + +export const router = diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest b/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest index 414cb3516..7f7ab93db 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest @@ -251,6 +251,7 @@ waspJob/.wasp/out/web-app/public/.gitkeep waspJob/.wasp/out/web-app/public/favicon.ico waspJob/.wasp/out/web-app/public/manifest.json waspJob/.wasp/out/web-app/scripts/validate-env.mjs +waspJob/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx waspJob/.wasp/out/web-app/src/components/FullPageWrapper.tsx waspJob/.wasp/out/web-app/src/components/Loader.module.css waspJob/.wasp/out/web-app/src/components/Loader.tsx diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums index bc5d53f99..9a2e9e940 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums @@ -116,21 +116,21 @@ "file", "../out/sdk/wasp/client/router/index.ts" ], - "6fe430c2956c25c3833d6893c695523a7b2a5f1cb9eceb0bed26429c2e33e6a0" + "ad12dae94c1c68a4f31f660dd942fc0b43d713b4ed37145faeb2f65d3e5bc392" ], [ [ "file", "../out/sdk/wasp/client/router/linkHelpers.ts" ], - "62e48c724070c59a95c837288112922326e1351ee1defa4759bdc47f7361ce9e" + "3b523ed6020fe18d71a108551de0a71cbfa23bdc4e3245b3491c5224251faa20" ], [ [ "file", "../out/sdk/wasp/client/router/types.ts" ], - "9bfaabe92126b641e6b939c26bac121dbbe1bb495392a5d40474ef4981432b5f" + "ffbce0f351b849dfe04f00421a31844836cbd5a80ab97445f6ed8859e6b94928" ], [ [ @@ -207,7 +207,7 @@ "file", "../out/sdk/wasp/package.json" ], - "ac367dc5e1f727e5ee31fe9f9097392a09bfd7303b9fe35280a3cd60cb9fc50b" + "ea409ee729f8b19739d4d06aee14dae9fb1b3b745ea155a235d13f6c4aedda3c" ], [ [ @@ -620,7 +620,7 @@ "file", "web-app/package.json" ], - "018f64a891479362d528211d2e52a038fa8948d392dd61fb9532712202d2340b" + "224c574b8eea2c414fb618e7ec833d87c98b962288cdd8e0f65377dfe684bd8d" ], [ [ @@ -650,6 +650,13 @@ ], "a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd" ], + [ + [ + "file", + "web-app/src/components/DefaultRootErrorBoundary.tsx" + ], + "4a141a28ca7aed9daddd75c156f7bae5eec50f3e5a85b6a43a28fa2648f34c44" + ], [ [ "file", @@ -683,7 +690,7 @@ "file", "web-app/src/index.tsx" ], - "ff83778b7f03a8f15116bc73adce607c2c13fc9cbd4228626980a530541aaeb2" + "61265d54c480ce94df81fdd0c65fa2e3c154e7d9fb9621c87a2d81e32ecd2adf" ], [ [ @@ -697,7 +704,7 @@ "file", "web-app/src/router.tsx" ], - "5641aec64e4771fde7aaedb217fbb726103c9859de65f2b6bdc51fbb2e970a3e" + "72f880dba47672ec9fb112a8b88cc8d831458cccddcc891b853a6dc9809a5752" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedNpmDepsLog.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedNpmDepsLog.json index 4f5e0d2dd..94c828a3b 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedNpmDepsLog.json +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedNpmDepsLog.json @@ -1 +1 @@ -{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"pg-boss","version":"^8.4.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}} \ No newline at end of file +{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"pg-boss","version":"^8.4.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/index.ts index 90f93b35f..e8cfb7dd6 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/index.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/index.ts @@ -3,6 +3,7 @@ import type { RouteDefinitionsToRoutes, OptionalRouteOptions, ParamValue, + ExpandRouteOnOptionalStaticSegments, } from './types' // PUBLIC API @@ -10,8 +11,15 @@ export const routes = { RootRoute: { to: "/", build: ( - options?: OptionalRouteOptions, - ) => interpolatePath("/", undefined, options?.search, options?.hash), + options?: + OptionalRouteOptions + ) => interpolatePath( + + "/", + undefined, + options?.search, + options?.hash + ), }, } as const; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/linkHelpers.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/linkHelpers.ts index e10cba928..84dc58733 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/linkHelpers.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/linkHelpers.ts @@ -17,6 +17,9 @@ export function interpolatePath( function interpolatePathParams(path: string, params: Params) { function mapPathPart(part: string) { + if (part === '*') { + return params['*']; + } if (part.startsWith(":")) { const paramName = extractParamNameFromPathPart(part); return params[paramName]; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/types.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/types.ts index 71c6a3812..03e751be3 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/types.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/types.ts @@ -2,7 +2,7 @@ export type RouteDefinitionsToRoutes = RouteDefinitionsToRoutesObj[keyof RouteDefinitionsToRoutesObj] - // PRIVATE API +// PRIVATE API export type OptionalRouteOptions = { search?: Search hash?: string @@ -21,7 +21,7 @@ export type Search = type RouteDefinitionsToRoutesObj = { [K in keyof Routes]: { - to: Routes[K]['to'] + to: ExpandRouteOnOptionalStaticSegments } & ParamsFromBuildFn } @@ -39,3 +39,60 @@ type ParamsFromBuildFn = Parameters[0] extends { } ? { params: Params } : { params?: never } + +// PRIVATE API (sdk) +/** + * Optional static segments handling: expands routes with optional segments + * into multiple routes, one for each possible combination of optional segments. + * + * For example: /users/tasks?/:id? will be expanded into two routes: + * - /users/:id? + * - /users/tasks/:id? + */ +export type ExpandRouteOnOptionalStaticSegments = JoinPath< + ExpandOptionalSegments>>> +>; + +type ParseSegments = T extends [infer Head, ...infer Tail] + ? [_ParseSegment, ...ParseSegments] + : T; + +type _ParseSegment = T extends `:${infer P}` + ? // Param segment + { segment: T } + : T extends `${infer S}?` + ? // Optional segment + { optionalSegment: S } + : // Regular segment + { segment: T }; + +type Segment = { segment: string }; +type OptionalSegment = { optionalSegment: string }; + +type Elem = Segment | OptionalSegment; + +type ExpandOptionalSegments = T extends [] + ? [] + : T extends [infer First extends Elem, ...infer Rest extends Elem[]] + ? First extends Segment + ? [First["segment"], ...ExpandOptionalSegments] + : First extends OptionalSegment + ? [First["optionalSegment"], ...ExpandOptionalSegments] | ExpandOptionalSegments + : [] + : []; + +type SplitPath = S extends "/" + ? [""] + : S extends `${infer T}/${infer U}` + ? [T, ...SplitPath] + : [S]; + +type JoinPath = T extends [infer Only extends string] + ? Only extends "" + ? "/" + : Only + : T extends [infer First extends string, ...infer Rest extends string[]] + ? `${First}/${JoinPath}` + : never; + +type NonEmptyString = S extends "" ? never : S; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/index.js.map index 35eeff35e..1abf37c22 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/index.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAO/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OAA8B,EAC9B,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;KACrE;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAQ/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OACoB,EACpB,EAAE,CAAC,eAAe,CAEhB,GAAG,EACH,SAAS,EACT,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EACf,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CACd;KACJ;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js index 144c9efc7..f6e6c37c7 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js @@ -9,6 +9,9 @@ export function interpolatePath(path, params, search, hash) { } function interpolatePathParams(path, params) { function mapPathPart(part) { + if (part === '*') { + return params['*']; + } if (part.startsWith(":")) { const paramName = extractParamNameFromPathPart(part); return params[paramName]; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map index c532d39f5..0614b93b1 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map @@ -1 +1 @@ -{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file +{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/types.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/types.d.ts index d80cec9aa..9abd699cf 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/types.d.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/types.d.ts @@ -10,7 +10,7 @@ export type Params = { export type Search = string[][] | Record | string | URLSearchParams; type RouteDefinitionsToRoutesObj = { [K in keyof Routes]: { - to: Routes[K]['to']; + to: ExpandRouteOnOptionalStaticSegments; } & ParamsFromBuildFn; }; type RoutesDefinition = { @@ -27,4 +27,32 @@ type ParamsFromBuildFn = Parameters[0] extends { } : { params?: never; }; +/** + * Optional static segments handling: expands routes with optional segments + * into multiple routes, one for each possible combination of optional segments. + * + * For example: /users/tasks?/:id? will be expanded into two routes: + * - /users/:id? + * - /users/tasks/:id? + */ +export type ExpandRouteOnOptionalStaticSegments = JoinPath>>>>; +type ParseSegments = T extends [infer Head, ...infer Tail] ? [_ParseSegment, ...ParseSegments] : T; +type _ParseSegment = T extends `:${infer P}` ? { + segment: T; +} : T extends `${infer S}?` ? { + optionalSegment: S; +} : { + segment: T; +}; +type Segment = { + segment: string; +}; +type OptionalSegment = { + optionalSegment: string; +}; +type Elem = Segment | OptionalSegment; +type ExpandOptionalSegments = T extends [] ? [] : T extends [infer First extends Elem, ...infer Rest extends Elem[]] ? First extends Segment ? [First["segment"], ...ExpandOptionalSegments] : First extends OptionalSegment ? [First["optionalSegment"], ...ExpandOptionalSegments] | ExpandOptionalSegments : [] : []; +type SplitPath = S extends "/" ? [""] : S extends `${infer T}/${infer U}` ? [T, ...SplitPath] : [S]; +type JoinPath = T extends [infer Only extends string] ? Only extends "" ? "/" : Only : T extends [infer First extends string, ...infer Rest extends string[]] ? `${First}/${JoinPath}` : never; +type NonEmptyString = S extends "" ? never : S; export {}; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts index 5bfe012bf..f3b9836c2 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts @@ -16,7 +16,7 @@ export declare const mySpecialJob: { readonly pgBoss: { readonly cancel: () => ReturnType; readonly resume: () => ReturnType; - readonly details: () => Promise, "output" | "state"> & ({ + readonly details: () => Promise, "state" | "output"> & ({ data: JSONObject; } & ({ state: "failed"; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/package.json index 11e21f2c3..8a92c82e8 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/package.json +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/package.json @@ -4,8 +4,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "axios": "^1.4.0", "express": "~4.18.1", @@ -17,13 +15,14 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" }, "exports": { "./api/events": "./dist/api/events.js", diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/package.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/package.json index 5a226845a..588e41eb5 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/package.json +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/package.json @@ -17,13 +17,12 @@ "mitt": "3.0.0", "react-dom": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2" }, "devDependencies": { "@tsconfig/vite-react": "^2.0.0", "@types/react-dom": "^18.0.11", - "@types/react-router-dom": "^5.3.3", "@vitejs/plugin-react": "^4.2.1", "dotenv": "^16.0.3" }, diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx new file mode 100644 index 000000000..7af24e15d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx @@ -0,0 +1,13 @@ +import { useRouteError } from 'react-router-dom' + +import { FullPageWrapper } from './FullPageWrapper' + +export function DefaultRootErrorBoundary() { + const error = useRouteError() + console.error(error) + return ( + +
There was an error rendering this page. Check the browser console for more information.
+
+ ) +} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/index.tsx b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/index.tsx index 0b7f1d985..50044cc49 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/index.tsx +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/index.tsx @@ -2,7 +2,7 @@ import React from 'react' import ReactDOM from 'react-dom/client' import { QueryClientProvider } from '@tanstack/react-query' -import router from './router' +import { router } from './router' import { initializeQueryClient, queryClientInitialized, diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/router.tsx b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/router.tsx index 9ecd93cb0..9f1e1b46b 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/router.tsx +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/router.tsx @@ -1,29 +1,34 @@ import React from 'react' -import { Route, Switch, BrowserRouter as Router } from 'react-router-dom' +import { createBrowserRouter, RouterProvider } from 'react-router-dom' import { MainPage } from '../../../../src/MainPage' +import { DefaultRootErrorBoundary } from './components/DefaultRootErrorBoundary' + import { routes } from 'wasp/client/router' export const routeNameToRouteComponent = { RootRoute: MainPage, } as const; -const router = ( - - - {Object.entries(routes).map(([routeKey, route]) => ( - - ))} - - -) +const waspDefinedRoutes = [ +] +const userDefinedRoutes = Object.entries(routes).map(([routeKey, route]) => { + return { + path: route.to, + Component: routeNameToRouteComponent[routeKey], + } +}) -export default router +const browserRouter = createBrowserRouter([{ + path: '/', + ErrorBoundary: DefaultRootErrorBoundary, + children: [ + ...waspDefinedRoutes, + ...userDefinedRoutes, + ], +}]) + +export const router = diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest b/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest index d13ce87b9..5cd0312ec 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest @@ -220,6 +220,7 @@ waspMigrate/.wasp/out/web-app/public/.gitkeep waspMigrate/.wasp/out/web-app/public/favicon.ico waspMigrate/.wasp/out/web-app/public/manifest.json waspMigrate/.wasp/out/web-app/scripts/validate-env.mjs +waspMigrate/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx waspMigrate/.wasp/out/web-app/src/components/FullPageWrapper.tsx waspMigrate/.wasp/out/web-app/src/components/Loader.module.css waspMigrate/.wasp/out/web-app/src/components/Loader.tsx diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums index f5830e734..7d817cd20 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums @@ -116,21 +116,21 @@ "file", "../out/sdk/wasp/client/router/index.ts" ], - "6fe430c2956c25c3833d6893c695523a7b2a5f1cb9eceb0bed26429c2e33e6a0" + "ad12dae94c1c68a4f31f660dd942fc0b43d713b4ed37145faeb2f65d3e5bc392" ], [ [ "file", "../out/sdk/wasp/client/router/linkHelpers.ts" ], - "62e48c724070c59a95c837288112922326e1351ee1defa4759bdc47f7361ce9e" + "3b523ed6020fe18d71a108551de0a71cbfa23bdc4e3245b3491c5224251faa20" ], [ [ "file", "../out/sdk/wasp/client/router/types.ts" ], - "9bfaabe92126b641e6b939c26bac121dbbe1bb495392a5d40474ef4981432b5f" + "ffbce0f351b849dfe04f00421a31844836cbd5a80ab97445f6ed8859e6b94928" ], [ [ @@ -200,7 +200,7 @@ "file", "../out/sdk/wasp/package.json" ], - "866e8d016c5972a35983615a9ac0bc4b3c1b25f4155ed09b60300be71af975c7" + "c5dc0e880b6924c30799671f3204f15687c1e50e338144ba82e62916dba80c9d" ], [ [ @@ -550,7 +550,7 @@ "file", "web-app/package.json" ], - "19a5d3854b7614748db2af7b574afc66951d5b6eff128ca3eab36445b331686f" + "880c852ac4fc2f2b319f5e53c5743e6b1f99f149cb212844d32804bebc27ecfc" ], [ [ @@ -580,6 +580,13 @@ ], "a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd" ], + [ + [ + "file", + "web-app/src/components/DefaultRootErrorBoundary.tsx" + ], + "4a141a28ca7aed9daddd75c156f7bae5eec50f3e5a85b6a43a28fa2648f34c44" + ], [ [ "file", @@ -613,7 +620,7 @@ "file", "web-app/src/index.tsx" ], - "ff83778b7f03a8f15116bc73adce607c2c13fc9cbd4228626980a530541aaeb2" + "61265d54c480ce94df81fdd0c65fa2e3c154e7d9fb9621c87a2d81e32ecd2adf" ], [ [ @@ -627,7 +634,7 @@ "file", "web-app/src/router.tsx" ], - "5641aec64e4771fde7aaedb217fbb726103c9859de65f2b6bdc51fbb2e970a3e" + "72f880dba47672ec9fb112a8b88cc8d831458cccddcc891b853a6dc9809a5752" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedNpmDepsLog.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedNpmDepsLog.json index e77826b40..dd987bba2 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedNpmDepsLog.json +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedNpmDepsLog.json @@ -1 +1 @@ -{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}} \ No newline at end of file +{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/index.ts index 90f93b35f..e8cfb7dd6 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/index.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/index.ts @@ -3,6 +3,7 @@ import type { RouteDefinitionsToRoutes, OptionalRouteOptions, ParamValue, + ExpandRouteOnOptionalStaticSegments, } from './types' // PUBLIC API @@ -10,8 +11,15 @@ export const routes = { RootRoute: { to: "/", build: ( - options?: OptionalRouteOptions, - ) => interpolatePath("/", undefined, options?.search, options?.hash), + options?: + OptionalRouteOptions + ) => interpolatePath( + + "/", + undefined, + options?.search, + options?.hash + ), }, } as const; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/linkHelpers.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/linkHelpers.ts index e10cba928..84dc58733 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/linkHelpers.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/linkHelpers.ts @@ -17,6 +17,9 @@ export function interpolatePath( function interpolatePathParams(path: string, params: Params) { function mapPathPart(part: string) { + if (part === '*') { + return params['*']; + } if (part.startsWith(":")) { const paramName = extractParamNameFromPathPart(part); return params[paramName]; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/types.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/types.ts index 71c6a3812..03e751be3 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/types.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/types.ts @@ -2,7 +2,7 @@ export type RouteDefinitionsToRoutes = RouteDefinitionsToRoutesObj[keyof RouteDefinitionsToRoutesObj] - // PRIVATE API +// PRIVATE API export type OptionalRouteOptions = { search?: Search hash?: string @@ -21,7 +21,7 @@ export type Search = type RouteDefinitionsToRoutesObj = { [K in keyof Routes]: { - to: Routes[K]['to'] + to: ExpandRouteOnOptionalStaticSegments } & ParamsFromBuildFn } @@ -39,3 +39,60 @@ type ParamsFromBuildFn = Parameters[0] extends { } ? { params: Params } : { params?: never } + +// PRIVATE API (sdk) +/** + * Optional static segments handling: expands routes with optional segments + * into multiple routes, one for each possible combination of optional segments. + * + * For example: /users/tasks?/:id? will be expanded into two routes: + * - /users/:id? + * - /users/tasks/:id? + */ +export type ExpandRouteOnOptionalStaticSegments = JoinPath< + ExpandOptionalSegments>>> +>; + +type ParseSegments = T extends [infer Head, ...infer Tail] + ? [_ParseSegment, ...ParseSegments] + : T; + +type _ParseSegment = T extends `:${infer P}` + ? // Param segment + { segment: T } + : T extends `${infer S}?` + ? // Optional segment + { optionalSegment: S } + : // Regular segment + { segment: T }; + +type Segment = { segment: string }; +type OptionalSegment = { optionalSegment: string }; + +type Elem = Segment | OptionalSegment; + +type ExpandOptionalSegments = T extends [] + ? [] + : T extends [infer First extends Elem, ...infer Rest extends Elem[]] + ? First extends Segment + ? [First["segment"], ...ExpandOptionalSegments] + : First extends OptionalSegment + ? [First["optionalSegment"], ...ExpandOptionalSegments] | ExpandOptionalSegments + : [] + : []; + +type SplitPath = S extends "/" + ? [""] + : S extends `${infer T}/${infer U}` + ? [T, ...SplitPath] + : [S]; + +type JoinPath = T extends [infer Only extends string] + ? Only extends "" + ? "/" + : Only + : T extends [infer First extends string, ...infer Rest extends string[]] + ? `${First}/${JoinPath}` + : never; + +type NonEmptyString = S extends "" ? never : S; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.js.map index 35eeff35e..1abf37c22 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.js.map +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAO/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OAA8B,EAC9B,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;KACrE;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAQ/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OACoB,EACpB,EAAE,CAAC,eAAe,CAEhB,GAAG,EACH,SAAS,EACT,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EACf,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CACd;KACJ;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js index 144c9efc7..f6e6c37c7 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js @@ -9,6 +9,9 @@ export function interpolatePath(path, params, search, hash) { } function interpolatePathParams(path, params) { function mapPathPart(part) { + if (part === '*') { + return params['*']; + } if (part.startsWith(":")) { const paramName = extractParamNameFromPathPart(part); return params[paramName]; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map index c532d39f5..0614b93b1 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map @@ -1 +1 @@ -{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file +{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.d.ts index d80cec9aa..9abd699cf 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.d.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.d.ts @@ -10,7 +10,7 @@ export type Params = { export type Search = string[][] | Record | string | URLSearchParams; type RouteDefinitionsToRoutesObj = { [K in keyof Routes]: { - to: Routes[K]['to']; + to: ExpandRouteOnOptionalStaticSegments; } & ParamsFromBuildFn; }; type RoutesDefinition = { @@ -27,4 +27,32 @@ type ParamsFromBuildFn = Parameters[0] extends { } : { params?: never; }; +/** + * Optional static segments handling: expands routes with optional segments + * into multiple routes, one for each possible combination of optional segments. + * + * For example: /users/tasks?/:id? will be expanded into two routes: + * - /users/:id? + * - /users/tasks/:id? + */ +export type ExpandRouteOnOptionalStaticSegments = JoinPath>>>>; +type ParseSegments = T extends [infer Head, ...infer Tail] ? [_ParseSegment, ...ParseSegments] : T; +type _ParseSegment = T extends `:${infer P}` ? { + segment: T; +} : T extends `${infer S}?` ? { + optionalSegment: S; +} : { + segment: T; +}; +type Segment = { + segment: string; +}; +type OptionalSegment = { + optionalSegment: string; +}; +type Elem = Segment | OptionalSegment; +type ExpandOptionalSegments = T extends [] ? [] : T extends [infer First extends Elem, ...infer Rest extends Elem[]] ? First extends Segment ? [First["segment"], ...ExpandOptionalSegments] : First extends OptionalSegment ? [First["optionalSegment"], ...ExpandOptionalSegments] | ExpandOptionalSegments : [] : []; +type SplitPath = S extends "/" ? [""] : S extends `${infer T}/${infer U}` ? [T, ...SplitPath] : [S]; +type JoinPath = T extends [infer Only extends string] ? Only extends "" ? "/" : Only : T extends [infer First extends string, ...infer Rest extends string[]] ? `${First}/${JoinPath}` : never; +type NonEmptyString = S extends "" ? never : S; export {}; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/package.json index ea53aee6b..83a4dbab0 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/package.json +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/package.json @@ -4,8 +4,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "axios": "^1.4.0", "express": "~4.18.1", @@ -16,13 +14,14 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" }, "exports": { "./api/events": "./dist/api/events.js", diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/package.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/package.json index b21fe30bf..850279be8 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/package.json +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/package.json @@ -17,13 +17,12 @@ "mitt": "3.0.0", "react-dom": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2" }, "devDependencies": { "@tsconfig/vite-react": "^2.0.0", "@types/react-dom": "^18.0.11", - "@types/react-router-dom": "^5.3.3", "@vitejs/plugin-react": "^4.2.1", "dotenv": "^16.0.3" }, diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx new file mode 100644 index 000000000..7af24e15d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx @@ -0,0 +1,13 @@ +import { useRouteError } from 'react-router-dom' + +import { FullPageWrapper } from './FullPageWrapper' + +export function DefaultRootErrorBoundary() { + const error = useRouteError() + console.error(error) + return ( + +
There was an error rendering this page. Check the browser console for more information.
+
+ ) +} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/index.tsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/index.tsx index 0b7f1d985..50044cc49 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/index.tsx +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/index.tsx @@ -2,7 +2,7 @@ import React from 'react' import ReactDOM from 'react-dom/client' import { QueryClientProvider } from '@tanstack/react-query' -import router from './router' +import { router } from './router' import { initializeQueryClient, queryClientInitialized, diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router.tsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router.tsx index 9ecd93cb0..9f1e1b46b 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router.tsx +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router.tsx @@ -1,29 +1,34 @@ import React from 'react' -import { Route, Switch, BrowserRouter as Router } from 'react-router-dom' +import { createBrowserRouter, RouterProvider } from 'react-router-dom' import { MainPage } from '../../../../src/MainPage' +import { DefaultRootErrorBoundary } from './components/DefaultRootErrorBoundary' + import { routes } from 'wasp/client/router' export const routeNameToRouteComponent = { RootRoute: MainPage, } as const; -const router = ( - - - {Object.entries(routes).map(([routeKey, route]) => ( - - ))} - - -) +const waspDefinedRoutes = [ +] +const userDefinedRoutes = Object.entries(routes).map(([routeKey, route]) => { + return { + path: route.to, + Component: routeNameToRouteComponent[routeKey], + } +}) -export default router +const browserRouter = createBrowserRouter([{ + path: '/', + ErrorBoundary: DefaultRootErrorBoundary, + children: [ + ...waspDefinedRoutes, + ...userDefinedRoutes, + ], +}]) + +export const router = diff --git a/waspc/examples/crud-testing/package-lock.json b/waspc/examples/crud-testing/package-lock.json index 6b21af5c3..bfd8a6f09 100644 --- a/waspc/examples/crud-testing/package-lock.json +++ b/waspc/examples/crud-testing/package-lock.json @@ -28,8 +28,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "axios": "^1.4.0", "express": "~4.18.1", @@ -43,13 +41,14 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" } }, ".wasp/out/sdk/wasp/node_modules/@emnapi/core": { @@ -1558,6 +1557,14 @@ "@prisma/debug": "5.19.1" } }, + "node_modules/@remix-run/router": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz", + "integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.13.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.0.tgz", @@ -1919,6 +1926,7 @@ "version": "4.17.43", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -1926,11 +1934,6 @@ "@types/send": "*" } }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, "node_modules/@types/js-levenshtein": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz", @@ -1939,7 +1942,8 @@ "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true }, "node_modules/@types/ms": { "version": "0.7.34", @@ -1962,12 +1966,14 @@ "node_modules/@types/qs": { "version": "6.9.12", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.12.tgz", - "integrity": "sha512-bZcOkJ6uWrL0Qb2NAWKa7TBU+mJHPzhx9jjLL1KHF+XpzEcR7EXHvjbHlGtR/IsP1vyPrehuS6XqkmaePy//mg==" + "integrity": "sha512-bZcOkJ6uWrL0Qb2NAWKa7TBU+mJHPzhx9jjLL1KHF+XpzEcR7EXHvjbHlGtR/IsP1vyPrehuS6XqkmaePy//mg==", + "dev": true }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true }, "node_modules/@types/react": { "version": "18.2.67", @@ -1987,25 +1993,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, "node_modules/@types/scheduler": { "version": "0.16.8", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", @@ -2015,6 +2002,7 @@ "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -3607,32 +3595,6 @@ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz", "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==" }, - "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -5151,14 +5113,6 @@ "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==" }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object-inspect": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", @@ -5608,21 +5562,6 @@ "fsevents": "2.3.3" } }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -5758,59 +5697,35 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, "node_modules/react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz", + "integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz", + "integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2", + "react-router": "6.26.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8", + "react-dom": ">=16.8" } }, - "node_modules/react-router/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/react-router/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/react-router/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -5882,11 +5797,6 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -6338,16 +6248,6 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, - "node_modules/tiny-invariant": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", - "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==" - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, "node_modules/tinybench": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", @@ -6561,11 +6461,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/waspc/examples/pg-vector-example/package-lock.json b/waspc/examples/pg-vector-example/package-lock.json index 2626bd9b5..7f6d81a22 100644 --- a/waspc/examples/pg-vector-example/package-lock.json +++ b/waspc/examples/pg-vector-example/package-lock.json @@ -32,8 +32,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "autoprefixer": "^10.4.13", "axios": "^1.4.0", @@ -46,14 +44,15 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "superjson": "^1.12.2", "tailwindcss": "^3.2.7", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" } }, "node_modules/@adobe/css-tools": { @@ -3200,6 +3199,14 @@ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0" } }, + "node_modules/@remix-run/router": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz", + "integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.13.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.0.tgz", @@ -3566,6 +3573,7 @@ "version": "4.17.43", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -3581,11 +3589,6 @@ "@types/unist": "^2" } }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, "node_modules/@types/js-levenshtein": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz", @@ -3602,7 +3605,8 @@ "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true }, "node_modules/@types/ms": { "version": "0.7.34", @@ -3632,14 +3636,16 @@ "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" }, "node_modules/@types/qs": { - "version": "6.9.12", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.12.tgz", - "integrity": "sha512-bZcOkJ6uWrL0Qb2NAWKa7TBU+mJHPzhx9jjLL1KHF+XpzEcR7EXHvjbHlGtR/IsP1vyPrehuS6XqkmaePy//mg==" + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", + "license": "MIT" }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true }, "node_modules/@types/react": { "version": "18.2.67", @@ -3659,25 +3665,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, "node_modules/@types/scheduler": { "version": "0.16.8", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", @@ -3687,6 +3674,7 @@ "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -4114,11 +4102,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "node_modules/base-64": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz", - "integrity": "sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==" - }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -4391,14 +4374,6 @@ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, - "node_modules/charenc": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", - "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", - "engines": { - "node": "*" - } - }, "node_modules/check-error": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", @@ -4740,14 +4715,6 @@ "node": ">= 8" } }, - "node_modules/crypt": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", - "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", - "engines": { - "node": "*" - } - }, "node_modules/css-select": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", @@ -5040,15 +5007,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/digest-fetch": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/digest-fetch/-/digest-fetch-1.3.0.tgz", - "integrity": "sha512-CGJuv6iKNM7QyZlM2T3sPAdZWd/p9zQiRNS9G+9COUCwzWFTs0Xp8NF5iePx7wtvhDykReiRRrSeNb4oMmB8lA==", - "dependencies": { - "base-64": "^0.1.0", - "md5": "^2.3.0" - } - }, "node_modules/dlv": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", @@ -5923,32 +5881,6 @@ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz", "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==" }, - "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -6298,11 +6230,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -6881,16 +6808,6 @@ "node": ">=12" } }, - "node_modules/md5": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", - "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", - "dependencies": { - "charenc": "0.0.2", - "crypt": "0.0.2", - "is-buffer": "~1.1.6" - } - }, "node_modules/mdast-util-definitions": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-5.1.2.tgz", @@ -7847,22 +7764,31 @@ } }, "node_modules/openai": { - "version": "4.29.1", - "resolved": "https://registry.npmjs.org/openai/-/openai-4.29.1.tgz", - "integrity": "sha512-vvKRIgB4/7w48PGVbeR8OceH/PT6fRo4sTIjRC7+y7WoK7by1R0cXs2SZRx4KsEh0ZB8J0eqdVIdRgs8XzeoEg==", + "version": "4.57.3", + "resolved": "https://registry.npmjs.org/openai/-/openai-4.57.3.tgz", + "integrity": "sha512-mTz5/SmulkkeSpqbSr6WNLRU6krkyhnbfRUC8XfaXbj1T6xUorKEELjZvbRSzI714JLOk1MeFkqYS9H4WHhqDQ==", + "license": "Apache-2.0", "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", + "@types/qs": "^6.9.15", "abort-controller": "^3.0.0", "agentkeepalive": "^4.2.1", - "digest-fetch": "^1.3.0", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", "node-fetch": "^2.6.7", - "web-streams-polyfill": "^3.2.1" + "qs": "^6.10.3" }, "bin": { "openai": "bin/cli" + }, + "peerDependencies": { + "zod": "^3.23.8" + }, + "peerDependenciesMeta": { + "zod": { + "optional": true + } } }, "node_modules/ora": { @@ -8528,59 +8454,35 @@ } }, "node_modules/react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz", + "integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz", + "integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2", + "react-router": "6.26.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8", + "react-dom": ">=16.8" } }, - "node_modules/react-router/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/react-router/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/react-router/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/react-style-singleton": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.1.tgz", @@ -8743,11 +8645,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -9409,16 +9306,6 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, - "node_modules/tiny-invariant": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", - "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==" - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, "node_modules/tinybench": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", @@ -9885,11 +9772,6 @@ "node": ">=8" } }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -11026,14 +10908,6 @@ "@zxing/text-encoding": "0.9.0" } }, - "node_modules/web-streams-polyfill": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", - "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", - "engines": { - "node": ">= 8" - } - }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", diff --git a/waspc/examples/pg-vector-example/src/Layout.tsx b/waspc/examples/pg-vector-example/src/Layout.tsx index dc5e3c294..67b0c63cf 100644 --- a/waspc/examples/pg-vector-example/src/Layout.tsx +++ b/waspc/examples/pg-vector-example/src/Layout.tsx @@ -1,11 +1,12 @@ import { NextUIProvider } from "@nextui-org/react"; import "./Main.css"; +import { Outlet } from "react-router-dom"; -export function Layout({ children }: React.PropsWithChildren<{}>) { +export function Layout() { return (
- {children} +
); diff --git a/waspc/examples/todo-typescript/package-lock.json b/waspc/examples/todo-typescript/package-lock.json index 94008137a..0454c851d 100644 --- a/waspc/examples/todo-typescript/package-lock.json +++ b/waspc/examples/todo-typescript/package-lock.json @@ -31,8 +31,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "autoprefixer": "^10.4.13", "axios": "^1.4.0", @@ -48,7 +46,7 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "socket.io": "^4.6.1", "socket.io-client": "^4.6.1", "superjson": "^1.12.2", @@ -56,7 +54,8 @@ "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" } }, ".wasp/out/sdk/wasp/node_modules/@emnapi/core": { @@ -1675,6 +1674,14 @@ "@prisma/debug": "5.19.1" } }, + "node_modules/@remix-run/router": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz", + "integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.14.2", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.2.tgz", @@ -2104,6 +2111,7 @@ "version": "4.19.0", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.0.tgz", "integrity": "sha512-bGyep3JqPCRry1wq+O5n7oiBgGWmeIJXPjXXCo8EK0u8duZGSYar7cGqd3ML2JUsLGeB7fmc06KYo9fLGWqPvQ==", + "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -2111,11 +2119,6 @@ "@types/send": "*" } }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, "node_modules/@types/http-errors": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", @@ -2130,7 +2133,8 @@ "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true }, "node_modules/@types/ms": { "version": "0.7.34", @@ -2153,12 +2157,14 @@ "node_modules/@types/qs": { "version": "6.9.14", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.14.tgz", - "integrity": "sha512-5khscbd3SwWMhFqylJBLQ0zIu7c1K6Vz0uBIt915BI3zV0q1nfjRQD3RqSBcPaO6PHEF4ov/t9y89fSiyThlPA==" + "integrity": "sha512-5khscbd3SwWMhFqylJBLQ0zIu7c1K6Vz0uBIt915BI3zV0q1nfjRQD3RqSBcPaO6PHEF4ov/t9y89fSiyThlPA==", + "dev": true }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true }, "node_modules/@types/react": { "version": "18.2.78", @@ -2177,29 +2183,11 @@ "@types/react": "*" } }, - "node_modules/@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, "node_modules/@types/send": { "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -4165,32 +4153,6 @@ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz", "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==" }, - "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -6419,21 +6381,6 @@ "fsevents": "2.3.3" } }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -6569,59 +6516,35 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, "node_modules/react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz", + "integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz", + "integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2", + "react-router": "6.26.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8", + "react-dom": ">=16.8" } }, - "node_modules/react-router/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/react-router/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/react-router/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -6717,11 +6640,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -7463,16 +7381,6 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, - "node_modules/tiny-invariant": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", - "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==" - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, "node_modules/tinybench": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.7.0.tgz", @@ -7720,11 +7628,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/waspc/examples/todoApp/package-lock.json b/waspc/examples/todoApp/package-lock.json index aba879bfa..864213753 100644 --- a/waspc/examples/todoApp/package-lock.json +++ b/waspc/examples/todoApp/package-lock.json @@ -32,8 +32,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "arctic": "^1.2.1", "autoprefixer": "^10.4.13", @@ -51,7 +49,7 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.2", "socket.io": "^4.6.1", "socket.io-client": "^4.6.1", "superjson": "^1.12.2", @@ -59,7 +57,8 @@ "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" } }, ".wasp/out/sdk/wasp/node_modules/@napi-rs/wasm-runtime": { @@ -2158,6 +2157,14 @@ "@prisma/debug": "5.19.1" } }, + "node_modules/@remix-run/router": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz", + "integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", @@ -2602,6 +2609,7 @@ "version": "4.17.43", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -2609,11 +2617,6 @@ "@types/send": "*" } }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, "node_modules/@types/http-errors": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", @@ -2628,7 +2631,8 @@ "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true }, "node_modules/@types/ms": { "version": "0.7.34", @@ -2651,12 +2655,14 @@ "node_modules/@types/qs": { "version": "6.9.11", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", - "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==" + "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==", + "dev": true }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true }, "node_modules/@types/react": { "version": "18.2.56", @@ -2676,25 +2682,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, "node_modules/@types/scheduler": { "version": "0.16.8", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", @@ -2704,6 +2691,7 @@ "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -5784,32 +5772,6 @@ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz", "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==" }, - "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -7724,21 +7686,6 @@ "fsevents": "2.3.3" } }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -7874,59 +7821,35 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, "node_modules/react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz", + "integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz", + "integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.2", + "react-router": "6.26.2" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8", + "react-dom": ">=16.8" } }, - "node_modules/react-router/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/react-router/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/react-router/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -8022,11 +7945,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -8800,16 +8718,6 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, - "node_modules/tiny-invariant": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz", - "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==" - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, "node_modules/tinybench": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", @@ -9076,11 +8984,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/waspc/examples/todoApp/src/App.tsx b/waspc/examples/todoApp/src/App.tsx index a7f5b7f26..e7f0fbb3b 100644 --- a/waspc/examples/todoApp/src/App.tsx +++ b/waspc/examples/todoApp/src/App.tsx @@ -1,3 +1,4 @@ +import { Outlet } from 'react-router-dom' import { useSocket } from 'wasp/client/webSocket' import { Link } from 'wasp/client/router' import { logout, useAuth } from 'wasp/client/auth' @@ -8,7 +9,7 @@ import { getName } from './user' // Necessary to trigger type tests. import './testTypes/operations/client' -export function App({ children }: any) { +export function App() { const { data: user } = useAuth() const { data: date } = useQuery(getDate) const { isConnected } = useSocket() @@ -41,7 +42,9 @@ export function App({ children }: any) { )} -
{children}
+
+ +
Created with Wasp
) diff --git a/waspc/examples/todoApp/src/Todo.test.tsx b/waspc/examples/todoApp/src/Todo.test.tsx index 4d5c7cad2..64b5c0fb5 100644 --- a/waspc/examples/todoApp/src/Todo.test.tsx +++ b/waspc/examples/todoApp/src/Todo.test.tsx @@ -8,6 +8,8 @@ import Todo, { areThereAnyTasks } from './Todo' import { App } from './App' import { getMe } from 'wasp/client/auth' +import { Routes, Route } from 'react-router-dom' + test('areThereAnyTasks', () => { expect(areThereAnyTasks([])).toBe(false) }) @@ -49,9 +51,11 @@ test('handles multiple mock data sources', async () => { mockQuery(getTasks, mockTasks) renderInContext( - - - + + + + + ) await screen.findByText('elon@tesla.com') diff --git a/waspc/examples/todoApp/src/pages/Task.tsx b/waspc/examples/todoApp/src/pages/Task.tsx index c066ca088..047081669 100644 --- a/waspc/examples/todoApp/src/pages/Task.tsx +++ b/waspc/examples/todoApp/src/pages/Task.tsx @@ -11,11 +11,13 @@ import { } from 'wasp/client/operations' import React from 'react' +import { useParams } from 'react-router-dom' type TaskPayload = Pick -const Todo = (props: any) => { - const taskId = parseInt(props.match.params.id) +const Todo = () => { + const { id } = useParams() + const taskId = parseInt(id!) const { data: task, diff --git a/waspc/headless-test/examples/todoApp/package-lock.json b/waspc/headless-test/examples/todoApp/package-lock.json index 3596213af..0ade148f1 100644 --- a/waspc/headless-test/examples/todoApp/package-lock.json +++ b/waspc/headless-test/examples/todoApp/package-lock.json @@ -31,8 +31,6 @@ "@tanstack/react-query": "^4.29.0", "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^14.1.2", - "@types/express-serve-static-core": "^4.17.13", - "@types/react-router-dom": "^5.3.3", "@vitest/ui": "^1.2.1", "arctic": "^1.2.1", "autoprefixer": "^10.4.13", @@ -50,14 +48,15 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^5.3.3", + "react-router-dom": "^6.26.1", "superjson": "^1.12.2", "tailwindcss": "^3.2.7", "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { - "@tsconfig/node18": "latest" + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" } }, ".wasp/out/sdk/wasp/node_modules/@napi-rs/wasm-runtime": { @@ -2121,6 +2120,14 @@ "@prisma/debug": "5.19.1" } }, + "node_modules/@remix-run/router": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.1.tgz", + "integrity": "sha512-S45oynt/WH19bHbIXjtli6QmwNYvaz+vtnubvNpNDvUOoA/OWh6j1OikIP3G+v5GHdxyC6EXoChG3HgYGEUfcg==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.10.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.10.0.tgz", @@ -2561,6 +2568,7 @@ "version": "4.17.43", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -2568,11 +2576,6 @@ "@types/send": "*" } }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, "node_modules/@types/http-errors": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", @@ -2587,7 +2590,8 @@ "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true }, "node_modules/@types/ms": { "version": "0.7.34", @@ -2610,12 +2614,14 @@ "node_modules/@types/qs": { "version": "6.9.11", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", - "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==" + "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==", + "dev": true }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true }, "node_modules/@types/react": { "version": "18.2.55", @@ -2635,25 +2641,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, "node_modules/@types/scheduler": { "version": "0.16.8", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", @@ -2663,6 +2650,7 @@ "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -5068,32 +5056,6 @@ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz", "integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==" }, - "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -6993,21 +6955,6 @@ "fsevents": "2.3.3" } }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -7143,59 +7090,35 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, "node_modules/react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.1.tgz", + "integrity": "sha512-kIwJveZNwp7teQRI5QmwWo39A5bXRyqpH0COKKmPnyD2vBvDwgFXSqDUYtt1h+FEyfnE8eXr7oe0MxRzVwCcvQ==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.1" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.1.tgz", + "integrity": "sha512-veut7m41S1fLql4pLhxeSW3jlqs+4MtjRLj0xvuCEXsxusJCbs6I8yn9BxzzDX2XDgafrccY6hwjmd/bL54tFw==", "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.19.1", + "react-router": "6.26.1" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8", + "react-dom": ">=16.8" } }, - "node_modules/react-router/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/react-router/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/react-router/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -7291,11 +7214,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -7915,16 +7833,6 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, - "node_modules/tiny-invariant": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz", - "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==" - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, "node_modules/tinybench": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", @@ -8172,11 +8080,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/waspc/headless-test/examples/todoApp/src/client/App.tsx b/waspc/headless-test/examples/todoApp/src/client/App.tsx index eaaea2a65..1c0e690c4 100644 --- a/waspc/headless-test/examples/todoApp/src/client/App.tsx +++ b/waspc/headless-test/examples/todoApp/src/client/App.tsx @@ -1,3 +1,5 @@ +import { Outlet } from 'react-router-dom' + import { Link } from 'wasp/client/router' import { logout, useAuth } from 'wasp/client/auth' import { useQuery, getDate } from 'wasp/client/operations' @@ -5,7 +7,7 @@ import { useQuery, getDate } from 'wasp/client/operations' import './Main.css' import { getName } from './user' -export function App({ children }: { children: React.ReactNode }) { +export function App() { const { data: user } = useAuth() const { data: date } = useQuery(getDate) @@ -31,7 +33,9 @@ export function App({ children }: { children: React.ReactNode }) { )} -
{children}
+
+ +
Created with Wasp
) diff --git a/waspc/headless-test/examples/todoApp/src/client/pages/Task.tsx b/waspc/headless-test/examples/todoApp/src/client/pages/Task.tsx index f7b0c24ca..2f3910240 100644 --- a/waspc/headless-test/examples/todoApp/src/client/pages/Task.tsx +++ b/waspc/headless-test/examples/todoApp/src/client/pages/Task.tsx @@ -1,4 +1,5 @@ import React from 'react' +import { useParams } from 'react-router-dom' import { Link } from 'wasp/client/router' import { type Task } from 'wasp/entities' @@ -14,8 +15,9 @@ import { type TaskPayload = Pick -const Todo = (props: any) => { - const taskId = parseInt(props.match.params.id) +const Todo = () => { + const { id } = useParams() + const taskId = parseInt(id!) const { data: task, isFetching, error } = useQuery(getTask, { id: taskId }) diff --git a/waspc/headless-test/tests/simple.spec.ts b/waspc/headless-test/tests/simple.spec.ts index ad0188257..637310fff 100644 --- a/waspc/headless-test/tests/simple.spec.ts +++ b/waspc/headless-test/tests/simple.spec.ts @@ -53,6 +53,7 @@ test.describe("signup and login", () => { await page.goto("/"); + // Create a new task const randomTask = `New Task ${Math.random().toString(36).substring(7)}`; await page.locator("input[type='text']").fill(randomTask); await page.getByText("Create new task").click(); @@ -61,5 +62,10 @@ test.describe("signup and login", () => { await page.waitForSelector(`text=${fullTaskText}`); await expect(page.locator("body")).toContainText(fullTaskText); + + // Navigate to task page + await page.locator(`text=${fullTaskText}`).click(); + const taskPageText = `description: ${randomTask}`; + await page.waitForSelector(`text=${taskPageText}`); }); }); diff --git a/waspc/src/Wasp/Generator/SdkGenerator.hs b/waspc/src/Wasp/Generator/SdkGenerator.hs index 3d9bf5669..920a687d0 100644 --- a/waspc/src/Wasp/Generator/SdkGenerator.hs +++ b/waspc/src/Wasp/Generator/SdkGenerator.hs @@ -188,11 +188,7 @@ npmDepsForSdk spec = ("lodash.merge", "^4.6.2"), ("react-router-dom", show reactRouterVersion), ("react-hook-form", "^7.45.4"), - ("superjson", "^1.12.2"), - -- Todo: why is this in dependencies, should it be in dev dependencies? - -- Should it go into their package.json - ("@types/express-serve-static-core", "^4.17.13"), - ("@types/react-router-dom", show reactRouterVersion) + ("superjson", "^1.12.2") ] ++ depsRequiredForAuth spec ++ depsRequiredByOAuth spec @@ -214,7 +210,9 @@ npmDepsForSdk spec = ++ depsRequiredByTailwind spec, N.devDependencies = AS.Dependency.fromList - [ ("@tsconfig/node" <> majorNodeVersionStr, "latest") + [ ("@tsconfig/node" <> majorNodeVersionStr, "latest"), + -- Should @types/* go into their package.json? + ("@types/express-serve-static-core", "^4.17.13") ] } where diff --git a/waspc/src/Wasp/Generator/SdkGenerator/Client/RouterGenerator.hs b/waspc/src/Wasp/Generator/SdkGenerator/Client/RouterGenerator.hs index 57875a355..a6fa5c283 100644 --- a/waspc/src/Wasp/Generator/SdkGenerator/Client/RouterGenerator.hs +++ b/waspc/src/Wasp/Generator/SdkGenerator/Client/RouterGenerator.hs @@ -12,12 +12,12 @@ import qualified Wasp.AppSpec.Route as AS.Route import Wasp.Generator.FileDraft (FileDraft) import Wasp.Generator.Monad (Generator) import qualified Wasp.Generator.SdkGenerator.Common as C -import Wasp.Util.WebRouterPath (Param (Optional, Required), extractPathParams) +import qualified Wasp.Util.WebRouterPath as WebRouterPath genNewClientRouterApi :: AppSpec -> Generator [FileDraft] genNewClientRouterApi spec = sequence - [ genRouterTsx spec, + [ genIndexTs spec, genFileCopy [relfile|client/router/types.ts|], genFileCopy [relfile|client/router/linkHelpers.ts|], genFileCopy [relfile|client/router/Link.tsx|] @@ -25,8 +25,8 @@ genNewClientRouterApi spec = where genFileCopy = return . C.mkTmplFd -genRouterTsx :: AppSpec -> Generator FileDraft -genRouterTsx spec = return $ C.mkTmplFdWithData [relfile|client/router/index.ts|] tmplData +genIndexTs :: AppSpec -> Generator FileDraft +genIndexTs spec = return $ C.mkTmplFdWithData [relfile|client/router/index.ts|] tmplData where tmplData = object ["routes" .= map createRouteTemplateData (AS.getRoutes spec)] @@ -37,13 +37,16 @@ createRouteTemplateData (name, route) = [ "name" .= name, "urlPath" .= path, "urlParams" .= map mapPathParamToJson urlParams, - "hasUrlParams" .= (not . null $ urlParams) + "hasUrlParams" .= (not . null $ urlParams), + "hasOptionalStaticSegments" .= (not . null $ optionalStaticSegments) ] where path = AS.Route.path route - urlParams = extractPathParams path + routeSegments = WebRouterPath.getRouteSegments path + urlParams = [param | WebRouterPath.ParamSegment param <- routeSegments] + optionalStaticSegments = [segment | (WebRouterPath.StaticSegment (WebRouterPath.OptionalStaticSegment segment)) <- routeSegments] - mapPathParamToJson :: Param -> Aeson.Value - mapPathParamToJson (Required paramName) = object ["name" .= paramName, "isOptional" .= False] - mapPathParamToJson (Optional paramName) = object ["name" .= paramName, "isOptional" .= True] + mapPathParamToJson :: WebRouterPath.ParamSegment -> Aeson.Value + mapPathParamToJson (WebRouterPath.RequiredParamSegment paramName) = object ["name" .= paramName, "isOptional" .= False] + mapPathParamToJson (WebRouterPath.OptionalParamSegment paramName) = object ["name" .= paramName, "isOptional" .= True] diff --git a/waspc/src/Wasp/Generator/WebAppGenerator.hs b/waspc/src/Wasp/Generator/WebAppGenerator.hs index 7721304d2..928565ce3 100644 --- a/waspc/src/Wasp/Generator/WebAppGenerator.hs +++ b/waspc/src/Wasp/Generator/WebAppGenerator.hs @@ -133,7 +133,6 @@ npmDepsForWasp _spec = ("typescript", "^5.1.0"), ("@types/react", "^18.0.37"), ("@types/react-dom", "^18.0.11"), - ("@types/react-router-dom", show reactRouterVersion), ("@vitejs/plugin-react", "^4.2.1"), ("dotenv", "^16.0.3"), -- NOTE: Make sure to bump the version of the tsconfig @@ -197,6 +196,7 @@ genSrcDir spec = genFileCopy [relfile|components/Loader.tsx|], genFileCopy [relfile|components/Loader.module.css|], genFileCopy [relfile|components/FullPageWrapper.tsx|], + genFileCopy [relfile|components/DefaultRootErrorBoundary.tsx|], getIndexTs spec ] <++> genAuth spec diff --git a/waspc/src/Wasp/Generator/WebAppGenerator/Common.hs b/waspc/src/Wasp/Generator/WebAppGenerator/Common.hs index ff58b0667..1d9b6af8a 100644 --- a/waspc/src/Wasp/Generator/WebAppGenerator/Common.hs +++ b/waspc/src/Wasp/Generator/WebAppGenerator/Common.hs @@ -154,4 +154,4 @@ getDefaultDevClientUrl :: AppSpec -> String getDefaultDevClientUrl spec = "http://localhost:" ++ show defaultClientPort ++ SP.fromAbsDirP (getBaseDir spec) reactRouterVersion :: SV.ComparatorSet -reactRouterVersion = SV.backwardsCompatibleWith $ SV.Version 5 3 3 +reactRouterVersion = SV.backwardsCompatibleWith $ SV.Version 6 26 2 diff --git a/waspc/src/Wasp/Util/WebRouterPath.hs b/waspc/src/Wasp/Util/WebRouterPath.hs index 2cec64f93..7c68a8bd5 100644 --- a/waspc/src/Wasp/Util/WebRouterPath.hs +++ b/waspc/src/Wasp/Util/WebRouterPath.hs @@ -1,18 +1,47 @@ -module Wasp.Util.WebRouterPath where +module Wasp.Util.WebRouterPath + ( Segment (StaticSegment, ParamSegment), + StaticSegment (RequiredStaticSegment, OptionalStaticSegment), + ParamSegment (RequiredParamSegment, OptionalParamSegment), + getRouteSegments, + ) +where import Data.List (isSuffixOf) import Data.List.Split (splitOn) -import Data.Maybe (mapMaybe) -data Param = Optional String | Required String deriving (Show, Eq) +data Segment + = StaticSegment StaticSegment + | ParamSegment ParamSegment + deriving (Show, Eq) -extractPathParams :: String -> [Param] -extractPathParams = mapMaybe parseParam . splitOn "/" +data StaticSegment + = RequiredStaticSegment StaticSegmentValue + | OptionalStaticSegment StaticSegmentValue + deriving (Show, Eq) + +data ParamSegment + = RequiredParamSegment ParamName + | OptionalParamSegment ParamName + deriving (Show, Eq) + +type StaticSegmentValue = String + +type ParamName = String + +getRouteSegments :: String -> [Segment] +getRouteSegments = map parseSegment . splitOn "/" where - parseParam :: String -> Maybe Param - parseParam (':' : xs) = - Just $ - if "?" `isSuffixOf` xs - then Optional (take (length xs - 1) xs) - else Required xs - parseParam _ = Nothing + parseSegment :: String -> Segment + parseSegment "*" = ParamSegment $ RequiredParamSegment "*" + parseSegment (':' : paramName) = + ParamSegment $ + if isSegmentOptional paramName + then OptionalParamSegment $ init paramName + else RequiredParamSegment paramName + parseSegment segmentValue = + StaticSegment $ + if isSegmentOptional segmentValue + then OptionalStaticSegment segmentValue + else RequiredStaticSegment segmentValue + + isSegmentOptional = isSuffixOf "?" diff --git a/web/docs/advanced/links.md b/web/docs/advanced/links.md index 165b9cb18..a2cf00ff2 100644 --- a/web/docs/advanced/links.md +++ b/web/docs/advanced/links.md @@ -40,6 +40,44 @@ export const TaskList = () => { } ``` +### Catch-all Routes + +If a route path ends with a `/*` pattern (also known as [splat](https://reactrouter.com/en/main/route/route#splats)), you can use the `Link` component like this: + +```wasp title="main.wasp" +route CatchAllRoute { path: "/pages/*", to: CatchAllPage } +page CatchAllPage { ... } +``` + +```jsx title="TaskList.tsx" + + About + +``` + +This will result in a link like this: `/pages/about`. + +### Optional Static Segments + +If a route contains optional static segments, you'll need to specify one of the possible paths: + +```wasp title="main.wasp" +route OptionalRoute { path: "/task/:id/details?", to: OptionalPage } +page OptionalPage { ... } +``` + +```jsx title="TaskList.tsx" +/* You can include ... */ + + Task 1 + + +/* ... or exclude the optional segment */ + + Task 1 + +``` + ### Using Search Query & Hash You can also pass `search` and `hash` props to the `Link` component: @@ -69,18 +107,36 @@ const linkToTask = routes.TaskRoute.build({ params: { id: 1 } }) This will result in a link like this: `/task/1`. -You can also pass `search` and `hash` props to the `build` function. Check out the [API Reference](#routes-object) for more details. +### Optional Static Segments +If a route contains optional static segments, you'll need to specify one of the possible paths: + +```wasp title="main.wasp" +route OptionalRoute { path: "/task/:id/details?", to: OptionalPage } +page OptionalPage { ... } +``` + +```tsx title="TaskList.tsx" +const linkToOptional = routes.OptionalRoute.build({ + path: '/task/:id/details', // or '/task/:id' + params: { id: 1 }, +}) +``` + +You can also pass `search` and `hash` props to the `build` function. Check out the [API Reference](#routes-object) for more details. ## API Reference ### `Link` Component The `Link` component accepts the following props: + - `to` - A valid Wasp Route path from your `main.wasp` file. + In the case of optional static segments, you must provide one of the possible paths which include or exclude the optional segment. For example, if the path is `/task/:id/details?`, you must provide either `/task/:id/details` or `/task/:id`. + - `params: { [name: string]: string | number }` (if the path contains params) - An object with keys and values for each param in the path. @@ -92,8 +148,7 @@ The `Link` component accepts the following props: - For example, the object `{ sortBy: 'date' }` becomes `?sortBy=date`. - `hash: string` -- all other props that the `react-router-dom`'s [Link](https://v5.reactrouter.com/web/api/Link) component accepts - +- all other props that the `react-router-dom`'s [Link](https://reactrouter.com/en/6.26.1/components/link) component accepts ### `routes` Object @@ -109,16 +164,39 @@ export const routes = { }) => // ... }, - // DetailRoute has a path like "/task/:id/:something?" + // DetailRoute has a path like "/task/:id/:userId?" DetailRoute: { build: ( options: { - params: { id: ParamValue; something?: ParamValue; }, + params: { id: ParamValue; userId?: ParamValue; }, search?: string[][] | Record | string | URLSearchParams hash?: string } ) => // ... - } + }, + + // OptionalRoute has a path like "/task/:id/details?" + OptionalRoute: { + build: ( + options: { + path: '/task/:id/details' | '/task/:id', + params: { id: ParamValue }, + search?: string[][] | Record | string | URLSearchParams + hash?: string + } + ) => // ... + }, + + // CatchAllRoute has a path like "/pages/*" + CatchAllRoute: { + build: ( + options: { + params: { '*': ParamValue }, + search?: string[][] | Record | string | URLSearchParams + hash?: string + } + ) => // ... + }, } ``` @@ -131,4 +209,11 @@ import { routes } from 'wasp/client/router' const linkToRoot = routes.RootRoute.build() const linkToTask = routes.DetailRoute.build({ params: { id: 1 } }) +const linkToOptional = routes.DetailRoute.build({ + path: '/task/:id/details', + params: { id: 1 }, +}) +const linkToCatchAll = routes.CatchAllRoute.build({ + params: { '*': 'about' }, +}) ``` diff --git a/web/docs/auth/social-auth/overview.md b/web/docs/auth/social-auth/overview.md index 35987b1d6..7abdac288 100644 --- a/web/docs/auth/social-auth/overview.md +++ b/web/docs/auth/social-auth/overview.md @@ -228,13 +228,13 @@ For example: ```jsx title=src/HomePage.jsx import { useAuth } from 'wasp/client/auth' -import { Redirect } from 'react-router-dom' +import { Navigate } from 'react-router-dom' export function HomePage() { const { data: user } = useAuth() if (user.isSignupComplete === false) { - return + return } // ... @@ -246,13 +246,13 @@ export function HomePage() { ```tsx title=src/HomePage.tsx import { useAuth } from 'wasp/client/auth' -import { Redirect } from 'react-router-dom' +import { Navigate } from 'react-router-dom' export function HomePage() { const { data: user } = useAuth() if (user.isSignupComplete === false) { - return + return } // ... @@ -348,4 +348,4 @@ For more information on: Check the provider-specific API References: - \ No newline at end of file + diff --git a/web/docs/auth/username-and-pass.md b/web/docs/auth/username-and-pass.md index 5418f66e1..d53044093 100644 --- a/web/docs/auth/username-and-pass.md +++ b/web/docs/auth/username-and-pass.md @@ -15,6 +15,7 @@ Wasp supports username & password authentication out of the box with login and s ## Setting Up Username & Password Authentication To set up username authentication we need to: + 1. Enable username authentication in the Wasp file 1. Add the `User` entity 1. Add the auth routes and pages @@ -58,6 +59,7 @@ app myApp { } } ``` + @@ -78,6 +80,7 @@ app myApp { } } ``` + @@ -99,6 +102,7 @@ model User { // ... } ``` + @@ -111,6 +115,7 @@ model User { // ... } ``` + @@ -136,6 +141,7 @@ page SignupPage { component: import { Signup } from "@src/pages/auth.jsx" } ``` + @@ -150,6 +156,7 @@ page SignupPage { component: import { Signup } from "@src/pages/auth.tsx" } ``` + @@ -179,7 +186,7 @@ export function Login() { Don't have an account yet? go to signup. - ); + ) } export function Signup() { @@ -191,22 +198,23 @@ export function Signup() { I already have an account (go to login). - ); + ) } // A layout component to center the content export function Layout({ children }) { return ( -
-
-
+
+
+
{children}
- ); + ) } ``` + @@ -223,7 +231,7 @@ export function Login() { Don't have an account yet? go to signup. - ); + ) } export function Signup() { @@ -235,22 +243,23 @@ export function Signup() { I already have an account (go to login). - ); + ) } // A layout component to center the content export function Layout({ children }: { children: React.ReactNode }) { return ( -
-
-
+
+
+
{children}
- ); + ) } ``` + @@ -271,23 +280,25 @@ The login and signup flows are pretty standard: they allow the user to sign up a Read more about the default username and password validation rules in the [auth overview docs](../auth/overview#default-validations). If you require more control in your authentication flow, you can achieve that in the following ways: + 1. Create your UI and use `signup` and `login` actions. 1. Create your custom sign-up action which uses the lower-level API, along with your custom code. ### 1. Using the `signup` and `login` actions #### `login()` + An action for logging in the user. It takes two arguments: - - `username: string` +- `username: string` - Username of the user logging in. +Username of the user logging in. - - `password: string` +- `password: string` - Password of the user logging in. +Password of the user logging in. You can use it like this: @@ -298,31 +309,28 @@ You can use it like this: import { login } from 'wasp/client/auth' import { useState } from 'react' -import { useHistory, Link } from 'react-router-dom' +import { useNavigate, Link } from 'react-router-dom' export function LoginPage() { const [username, setUsername] = useState('') const [password, setPassword] = useState('') const [error, setError] = useState(null) - const history = useHistory() + const navigate = useNavigate() async function handleSubmit(event) { event.preventDefault() try { await login(username, password) - history.push('/') + navigate('/') } catch (error) { setError(error) } } - return ( -
- {/* ... */} -
- ); + return
{/* ... */}
} ``` + @@ -330,31 +338,28 @@ export function LoginPage() { import { login } from 'wasp/client/auth' import { useState } from 'react' -import { useHistory, Link } from 'react-router-dom' +import { useNavigate, Link } from 'react-router-dom' export function LoginPage() { const [username, setUsername] = useState('') const [password, setPassword] = useState('') const [error, setError] = useState(null) - const history = useHistory() + const navigate = useNavigate() async function handleSubmit(event: React.FormEvent) { event.preventDefault() try { await login(username, password) - history.push('/') + navigate('/') } catch (error: unknown) { setError(error as Error) } } - return ( -
- {/* ... */} -
- ); + return
{/* ... */}
} ``` +
@@ -363,12 +368,15 @@ When using the exposed `login()` function, make sure to implement your redirect ::: #### `signup()` + An action for signing up the user. This action does not log in the user, you still need to call `login()`. It takes one argument: + - `userFields: object` It has the following fields: + - `username: string` - `password: string` @@ -386,14 +394,13 @@ You can use it like this: import { signup, login } from 'wasp/client/auth' import { useState } from 'react' -import { useHistory } from 'react-router-dom' -import { Link } from 'react-router-dom' +import { useNavigate, Link } from 'react-router-dom' export function Signup() { const [username, setUsername] = useState('') const [password, setPassword] = useState('') const [error, setError] = useState(null) - const history = useHistory() + const navigate = useNavigate() async function handleSubmit(event) { event.preventDefault() @@ -403,19 +410,16 @@ export function Signup() { password, }) await login(username, password) - history.push("/") + navigate('/') } catch (error) { setError(error) } } - return ( -
- {/* ... */} -
- ); + return
{/* ... */}
} ``` + @@ -423,14 +427,13 @@ export function Signup() { import { signup, login } from 'wasp/client/auth' import { useState } from 'react' -import { useHistory } from 'react-router-dom' -import { Link } from 'react-router-dom' +import { useNavigate, Link } from 'react-router-dom' export function Signup() { const [username, setUsername] = useState('') const [password, setPassword] = useState('') const [error, setError] = useState(null) - const history = useHistory() + const navigate = useNavigate() async function handleSubmit(event: React.FormEvent) { event.preventDefault() @@ -440,19 +443,16 @@ export function Signup() { password, }) await login(username, password) - history.push("/") + navigate('/') } catch (error: unknown) { setError(error as Error) } } - return ( -
- {/* ... */} -
- ); + return
{/* ... */}
} ``` +
@@ -471,7 +471,6 @@ action customSignup { } ``` - ```js title="src/auth/signup.js" import { ensurePasswordIsPresent, @@ -497,7 +496,7 @@ export const signup = async (args, _context) => { providerId, providerData, // Any additional data you want to store on the User entity - {}, + {} ) } catch (e) { return { @@ -515,6 +514,7 @@ export const signup = async (args, _context) => { } } ``` + @@ -564,7 +564,7 @@ export const signup: CustomSignup< providerId, providerData, // Any additional data you want to store on the User entity - {}, + {} ) } catch (e) { return { @@ -582,6 +582,7 @@ export const signup: CustomSignup< } } ``` + @@ -603,7 +604,7 @@ We suggest using the built-in field validators for your authentication flow. You Checks if the password is valid and throws an error if it's not. Read more about the validation rules [here](../auth/overview#default-validations). -## Using Auth +## Using Auth To read more about how to set up the logout button and how to get access to the logged-in user in our client and server code, read the [auth overview docs](../auth/overview). @@ -641,6 +642,7 @@ model User { id Int @id @default(autoincrement()) } ``` + @@ -665,6 +667,7 @@ model User { id Int @id @default(autoincrement()) } ``` + @@ -693,6 +696,7 @@ app myApp { } // ... ``` + @@ -714,6 +718,7 @@ app myApp { } // ... ``` + diff --git a/web/docs/project/client-config.md b/web/docs/project/client-config.md index c138d1298..728eb3226 100644 --- a/web/docs/project/client-config.md +++ b/web/docs/project/client-config.md @@ -2,7 +2,7 @@ title: Client Config --- -import BaseDirEnvNote from './_baseDirEnvNote.md' +import BaseDirEnvNote from './\_baseDirEnvNote.md' import { ShowForTs, ShowForJs } from '@site/src/components/TsJsHelpers' @@ -66,13 +66,16 @@ app MyApp { ``` ```jsx title="src/Root.jsx" -export default function Root({ children }) { +import { Outlet } from 'react-router-dom' + +export default function Root() { return (

My App

- {children} + // highlight-next-line +

My App footer

@@ -95,13 +98,16 @@ app MyApp { ``` ```tsx title="src/Root.tsx" -export default function Root({ children }: { children: React.ReactNode }) { +import { Outlet } from 'react-router-dom' + +export default function Root() { return (

My App

- {children} + // highlight-next-line +

My App footer

@@ -113,6 +119,8 @@ export default function Root({ children }: { children: React.ReactNode }) { +You need to import the [`Outlet`](https://reactrouter.com/en/main/components/outlet#outlet) component from `react-router-dom` and put it where you want the current page to be rendered. + ### Setting up a Provider This is how to set up various providers that your application needs: @@ -131,11 +139,16 @@ app MyApp { ``` ```jsx title="src/Root.jsx" +import { Outlet } from 'react-router-dom' import store from './store' import { Provider } from 'react-redux' -export default function Root({ children }) { - return {children} +export default function Root() { + return ( + + + + ) } ``` @@ -153,19 +166,23 @@ app MyApp { ``` ```tsx title="src/Root.tsx" +import { Outlet } from 'react-router-dom' import store from './store' import { Provider } from 'react-redux' -export default function Root({ children }: { children: React.ReactNode }) { - return {children} +export default function Root() { + return ( + + + + ) } ``` -As long as you render the children, you can do whatever you want in your root -component. +As long as you render the `Outlet` component, you can put what ever you want in the root component. Read more about the root component in the [API Reference](#rootcomponent-extimport). @@ -326,8 +343,10 @@ Client has the following options: - #### `rootComponent: ExtImport` `rootComponent` defines the root component of your client application. It is - expected to be a React component, and Wasp will use it to wrap your entire app. - It must render its children, which are the actual pages of your application. + expected to be a React component, and Wasp will use it as the root of the + client application. + It must render the `Outlet` component from `react-router-dom` to render the + current page. Here's an example of a root component that both sets up a provider and renders a custom layout: @@ -336,24 +355,26 @@ Client has the following options: ```jsx title="src/Root.jsx" + import { Outlet } from 'react-router-dom' import store from './store' import { Provider } from 'react-redux' - export default function Root({ children }) { + export default function Root() { return ( - {children} + ) } - function Layout({ children }) { + function Layout() { return (

My App

- {children} + // highlight-next-line +

My App footer

@@ -366,24 +387,26 @@ Client has the following options: ```tsx title="src/Root.tsx" + import { Outlet } from 'react-router-dom' import store from './store' import { Provider } from 'react-redux' - export default function Root({ children }: { children: React.ReactNode }) { + export default function Root() { return ( - {children} + ) } - function Layout({ children }: { children: React.ReactNode }) { + function Layout() { return (

My App

- {children} + // highlight-next-line +

My App footer

diff --git a/web/docs/tutorial/03-pages.md b/web/docs/tutorial/03-pages.md index bfea88d2e..f6fa2fa47 100644 --- a/web/docs/tutorial/03-pages.md +++ b/web/docs/tutorial/03-pages.md @@ -4,8 +4,8 @@ title: 3. Pages & Routes import useBaseUrl from '@docusaurus/useBaseUrl'; import { ShowForTs } from '@site/src/components/TsJsHelpers'; -import WaspStartNote from '../_WaspStartNote.md' -import TypescriptServerNote from '../_TypescriptServerNote.md' +import WaspStartNote from '../\_WaspStartNote.md' +import TypescriptServerNote from '../\_TypescriptServerNote.md' In the default `main.wasp` file created by `wasp new`, there is a **page** and a **route** declaration: @@ -15,7 +15,7 @@ In the default `main.wasp` file created by `wasp new`, there is a **page** and a ```wasp title="main.wasp" route RootRoute { path: "/", to: MainPage } page MainPage { - // We specify that the React implementation of the page is exported from + // We specify that the React implementation of the page is exported from // `src/MainPage.jsx`. This statement uses standard JS import syntax. // Use `@src` to reference files inside the `src` folder. component: import { MainPage } from "@src/MainPage" @@ -83,7 +83,7 @@ That is all the code you need! Wasp takes care of everything else necessary to d ## Adding a Second Page -To add more pages, you can create another set of **page** and **route** declarations. You can even add parameters to the URL path, using the same syntax as [React Router](https://reactrouter.com/web/). Let's test this out by adding a new page: +To add more pages, you can create another set of **page** and **route** declarations. You can even add parameters to the URL path, using the same syntax as [React Router](https://reactrouter.com/en/6.26.1). Let's test this out by adding a new page: @@ -108,28 +108,29 @@ page HelloPage { -When a user visits `/hello/their-name`, Wasp will render the component exported from `src/HelloPage.{jsx,tsx}` and pass the URL parameter the same way as in React Router: +When a user visits `/hello/their-name`, Wasp renders the component exported from `src/HelloPage.{jsx,tsx}` and you can use the `useParams` hook from `react-router-dom` to access the `name` parameter: ```jsx title="src/HelloPage.jsx" -export const HelloPage = (props) => { - return
Here's {props.match.params.name}!
+import { useParams } from 'react-router-dom' + +export const HelloPage = () => { + const { name } = useParams() + return
Here's {name}!
} ```
- ```tsx title="src/HelloPage.tsx" -import { RouteComponentProps } from 'react-router-dom' +import { useParams } from 'react-router-dom' -export const HelloPage = ( - props: RouteComponentProps<{ name: string }> -) => { - return
Here's {props.match.params.name}!
+export const HelloPage = () => { + const { name } = useParams<'name'>() + return
Here's {name}!
} ``` @@ -181,7 +182,6 @@ src={useBaseUrl('img/todo-app-hello-world.png')} style={{ border: "1px solid black" }} /> - You can now delete redundant files: `src/Main.css`, `src/waspLogo.png`, and `src/HelloPage.{jsx,tsx}` (we won't need this page for the rest of the tutorial). Since `src/HelloPage.{jsx,tsx}` no longer exists, remove its `route` and `page` declarations from the `main.wasp` file.