{"_id":"@fleur/froute","_rev":"83-ec3d3cdde0fcce13753135c8e60e82dc","name":"@fleur/froute","dist-tags":{"latest":"1.0.9","beta":"1.0.0-beta.12","dev":"1.0.8"},"versions":{"0.1.0-pre.1":{"name":"@fleur/froute","version":"0.1.0-pre.1","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build:commonjs":"tsc -m commonjs --outDir ./dist","build":"yarn build:declarations && yarn build:esm && yarn build:commonjs","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.10","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.0.2"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.1.0-pre.1","dist":{"shasum":"c93d833f9ccd0a6b863aebcd4147507a64801c38","integrity":"sha512-ugpQZ7U2qqtbyQSk0iTHiwHM78bsG383uM8pccDGAoVZO1Cuk0c7HKnWlB9IyyWPO6Rt9Tuel6XWqvTbhjhRuQ==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.1.0-pre.1.tgz","fileCount":37,"unpackedSize":31639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf21lpCRA9TVsSAnZWagAAsN0P/RmlRUgjpNP6wM0X+xlB\nmy1DMzEaJ4Nm+Lh2N5dUUonM3aU7/Q6tzSettSqYguefjZd2J5mDMxqXCtK9\nB+ieqJxgTQUAioSyYrWXQEFkZeSNNcd0YX27hOYYIBiC0c0hUIxiaqJyLf1/\nXUCqF8cuYdtzGGKw7oB2u+pHAlvZ6kGdyJ/M5c2weHLL7b3cojCg93p6+lPD\nHzN0b3Yk42RvBkEhFlc5XQoOmMh9p2lMbuv5MS2Rk5bbEurEhz+ULevDAXxJ\nrv09TrtLNjNZXPbuZUPIPW7o/DNp3AVeYaUf1w0WKpq6hW5L9LnggQZrqyGc\nsAKu0BQyYeAUI7+DasoRKWZpvPNfNwJSVdt7731/c/QNvk+YJZDGEr2kwc+Z\nBnsV5LxSBZcl+RbCTDG7+k8Txb11D5i/nP5qUU93TiaiaznsTD5eliiqoDFi\n/7OtYNICLPbjI+sBpDrTAPqLDyF4NOZoJ7B30O5Ze0pZzPUbTN3ijTMUdHwm\nE5WERRpxDV+drf29h3P5LFStNX5HNAleprAWdC0Rqh4TvLfLG2luLj5I9Ngd\nxlDopQYmY47EXbn5EPu0CqZ/CJfzAFRtmgNEq3lHxQ9zfYx+xXOY+V6Z0Y0z\nxgKPr92WSLkmLau69wtwzVf8Fk+o50sdADu/5KeB9cCIJE5VARtJTN00x3Xs\nMPOH\r\n=BmnU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+FM3/gIKDNJ5Ul8J4BLxJ1A/OWYnk2636/XPFklOUfAIgeWnrwE7CPU5ZjjIGW+WjtuJpacw2t2+kFNGW9+wmimE="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.1.0-pre.1_1608210793013_0.7868177905874709"},"_hasShrinkwrap":false},"0.1.0-pre.2":{"name":"@fleur/froute","version":"0.1.0-pre.2","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build:commonjs":"tsc -m commonjs --outDir ./dist","build":"yarn build:declarations && yarn build:esm && yarn build:commonjs","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.10","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.0.2"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.1.0-pre.2","dist":{"shasum":"00528cb5f19c6328deb3cf75093543cd18b9ebd2","integrity":"sha512-PvGxBprsPL1tTxUm15ZdlgIcdlWK1vyZZSkOkFIDBw8POS+xwDGV7XvEaLqjuhAZ/nL2lFOJIXlI691WAWCyEQ==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.1.0-pre.2.tgz","fileCount":25,"unpackedSize":45453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf21p4CRA9TVsSAnZWagAAGdUP/iPmz/T+XJPz+qn1ZqzI\nlcVLAOtz4zWUcWT0wBlyd60IbbmElY+xQzPhipHJUGF35o6ncn3BqQow3IMY\nio9OX80y1FmFyRq+F8nRe6hSLU+ymkQ+Yn+nMQDfRj6+PHKxdC54gnlJC7pB\n98R5qInIDHWhqqbdesUTUg2cIUKTw4L5h0ZAtUqPwgj1dFq+k0dF4jpTuRVh\nLzp2FdQsQy4h637iGfM4M4rJ7cQJg0PzFWByplWWngod0uke/BkYAkd+AzXd\nkMZu4ZNnZwTv6gr/n3v5ia4tk8R9jcc2QAAICKZ9mKNctdQhMV1LNRHfm3sH\nV9wrW5vFQ+nVE0rgVvVqAS0iEMnoXaq6cyrH6egJcgITNNpyGNlkd9lA1/IJ\nRJhWfBKUmFz+g/pvl/0lwBqTDzAVq3WHuaO7xUE79EC76GK37BKs01zGPjjN\nBqkVrN41zJaJs95hU4/fboP+4EfeAaQnNaoBPgcveNi0fFLV20SS6ihpM/CR\nkypsxrUCc0S0w8Nx9SajzPsE/0W5ra2X81gu0gbkvc3dDi8jukutxQ5Ad4r4\n7X2vKX4rW1871Ezo+eSXTSA0FFVtAS/BcGNm9maMivlgxxxSaGGW29iz3Z0M\n8x/POl6ihk09IV4F5RmZtDvAAdvflUu+1w4/R46IW6p9aMstlVL4bs+Z8rR4\nvtWg\r\n=zNf7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpT2z2B1A+yrzF/hW+mHmfIpjTgiMXdHDz6sJN1c8N8AIhAIjsDtLjcbGJKoqvCIZopNBI58tDhd7KOH/6MVyCqXTP"}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.1.0-pre.2_1608211064603_0.7879915211599924"},"_hasShrinkwrap":false},"0.1.0-pre.3":{"name":"@fleur/froute","version":"0.1.0-pre.3","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.10","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.0.2"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.1.0-pre.3","dist":{"shasum":"50a2afc7aff4c99316501c1649f005a1c356a95b","integrity":"sha512-KjY1r3+PCgKc0ga8M0f77OibQiKX2zBkhqRYr8/N9yYaC3PARHMYsBbl2MVa/iGWQDutaK2Tt0XittRcEOicdg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.1.0-pre.3.tgz","fileCount":20,"unpackedSize":44154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf21s1CRA9TVsSAnZWagAAGr4P/Rfq7rS+slqNG53mhvzm\n9ZtUbH+ULtFQEZka88xljyPIixwTdEEaj/JJfsfK76YAh4X4ld5l8lCdEd32\n5TjIZ455RTZXPSAkXAE11bLX8rig0uB+LBYgmOza0vZQ/RLmToCB8Jpr2yMC\n1N3kwzwFOvrP+d8/0xADF+HdZ/AFzY5ETadHWQnFZZ/Z2Voz+mzAZKIAEKxg\nOUu4tMr0tPe5c3MB2CU4yLdeU1FCAOimlbMJPDBtW8cYsIv816wih0JAs/P8\nXWK185p7UW+Qv4mrluL11CHA9icADV9+7nQ7KYaXjuGLG1qS3ENrRn+pUU5a\nozBtgHtDmABYJxM37yWaoBMBpVkOvQxvmZOQbt3vsikYUAFxy4IlZ0iowEec\n6QOBa6+S4+5ywo7mDOYMwYj3BnpLXKJZlTU/VsmWNC04dkH0rRTekwNEDMN5\nY+NbKTNy6fMZbcShFcxj/lHZ5OdiCQXoQqrARLK5PrkcPuaomCIJsECmscEr\nIqnfQz+u/GnYpXrG0UWjBFO7QTRPckFZ4pwEbiOPuluCJKkUo6Ps1fyCcg5p\nUBdabKs9kYMB4Dulvt5PPuUEwYxJ9BLXGYFqNsYa5dnuRdodj0omF+2zshLP\n8WTywARme+5hBUGXnit5xBtBMkSIqLJE0ZTMPJXuUAf4R8pxID0oHSl2LOnS\nT6Y5\r\n=tAX/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNE58RfCoM7KJhIUtynyBMAJ+nFqZjCOgKk2FBWUWuLQIhANXUKIPejmEDc/3DNnevwybYMhEe3RgfxaR3Y4viRo5B"}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.1.0-pre.3_1608211253422_0.2726962986180268"},"_hasShrinkwrap":false},"0.1.0-pre.4":{"name":"@fleur/froute","version":"0.1.0-pre.4","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.10","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.0.2"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.1.0-pre.4","dist":{"shasum":"1cefa88d025cb926a99d89cbbb286e0536d356cc","integrity":"sha512-REutceVPcwjTXiUuhEfKn5IBUWB6BwwodkdR773QCtovUjL0xPGhN6+LpRdhiXjy9Af6C0MpDZTK4Y2tWCd0rg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.1.0-pre.4.tgz","fileCount":20,"unpackedSize":44388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf217XCRA9TVsSAnZWagAA+y0P/jGotLSY0Ju8pP4CfgSo\nH4+2OE/NxG5WAG4vW3QDRHNvP3OwNIDhXQhyU8djlJaK6QVXIllqhMthzFq3\nzNlJ+zUH5cGiC++7e3UaseiHLa4BrI4RH1vJz74pyzlcayJpaIujqRRRdfPR\nAVDJ+h7MntDMWKXG59sDyUuGslBYRk5UAhhtNKfDnZnYVKGUxfJheb0kz8sy\nLQvbBrOzKxHdYrLX3xc3vqOnIQd5rOWImlWeis6EmtG8qVE7WBOgCtHLRjQh\nRchxjOf2N+Xnh51n8waDLjGGCVt7uMaOCo/9iNDIZEvQKmBgSK3cBJtLr388\neP2LrRvwdbpJa9EBPrh/L2J+hrLg4HX2AX4bHE5hQkbjTj3KuErLpU2OKSG0\nMxU5jLibsV3hYsA9n4dFTdzc6UDIVxG6NZGTuo1UvJc1J1hLvIaM5vBq2bRa\nClETR/3lDukquI08ejliL3jc+4tO0Asa0dpHIlQh5huhqGkl/48NJVr9aHQq\nqZaWC/i0xsQuuOfBrHUUcKP5suK24RAsGgWcLxmJhvj9pIgVvuLHxG+nlRrY\ne6dvOQg32nfJ/A0iLUbzbz3TCHCxDZyHVteG13vafE6MfPMphZGyivNlQYK5\nbYXfgIdlSPgvX01yQSBER0raNKrt15ljFlUeejhM3G1441jNVSJ3Y/xGn6ds\nUtZz\r\n=XFPE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0UxYSk5LxF2nMnEZfmyJU1AZu0bDjALEw0ny10ODY3gIgEzBo2VQita5iW67EAK/jaEEoIvwvH7nquXPPy6G5LT0="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.1.0-pre.4_1608212183260_0.9984934785359392"},"_hasShrinkwrap":false},"0.1.0-pre.6":{"name":"@fleur/froute","version":"0.1.0-pre.6","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.10","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.0.2"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.1.0-pre.6","dist":{"shasum":"e9c03fed087f716fed6a510ad42bb0c184ccc55c","integrity":"sha512-qiAEEEpUF3sQOxxjoUd5Y1FZ6Pq3+kcIS9ZSkAITLscMosFMNw1my/HRi/P1YkwQgXb7DNKHO741LsJ3IfkIag==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.1.0-pre.6.tgz","fileCount":20,"unpackedSize":49942,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf22U0CRA9TVsSAnZWagAAK30P/RgFyGg4OiPsZX6ovUur\nMR7IDipkORHUUrSvFl006GjmFp+Tb8xshLVVw0exDiKPM+wPfgvaE1iSLwHZ\nWN2ANOizXcbgTaoE+weC+eA9rp9rKf+FQeYhk+5ANbeEBJ+JzpPuyIRrkgXe\nwlm2Tac+wkyl20BP9ZSGYmn6ZGTZxMxCzZ41lw6JDASyh5ZK8BDbfwJYC6nZ\nvvUZ1gulCcYswNCTl9UfEl7z4z6OHRPRN61TGzBqe6g8IlcDrri/qEMyPZ0M\nQ1b4Vud5fLBArwEibUR+0oSY3lb1McIAdmUtbnXdJm6xU0YkBVpq3IV9Vfs+\nMv7kMGPQyXTtQPKhHEOQdmptwIqoqVcIaenu5geRlRJK59BE/dljdBne4r4Z\nS1B3Uc7iNcW82LRRapUL1aFaI8Et2eW15jEMpnpJkVoInSj3aR4VQ3GBWgz2\njfdVoeU3nkbzCgqMb0pDlzMnJPfMavzO9UUFCe2Fz7AuqZjdHhtikJ6LlDXr\nJwHsSNzx1RG4fCIhG8sYTFbTn8XgEKdApM8SkLi2CYzR/ViZG9o3dHTwDWjc\nxPlqlqh+Gvdm8JjsRsCKZfTsyKt701zaP9bPodTrTbipefyoS/dx6ct/D0Ai\nbkZfimsLlAwmgmoCMMIdGEeuczn4MUJuELedgHccE1fTJrLFRv2uCRxbvJIm\nsuKR\r\n=K7Wm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAHyhHJKZSLNSzi5Mo6y/CNClRif2WcAASW2e/sLQZNZAiACqXztHt7Ujzg5l0UF4rP7MIApz/Uf89JdL3VAFY+fFQ=="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.1.0-pre.6_1608213811656_0.2903480730031269"},"_hasShrinkwrap":false},"0.1.0-pre.7":{"name":"@fleur/froute","version":"0.1.0-pre.7","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.10","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.0.2"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.1.0-pre.7","dist":{"shasum":"1ecd704c750bd0e0ad1f75f6f9f18bc41cba900b","integrity":"sha512-H9lgHKw+zcOWBM3oj+1Lwau21kiqRp+HA4TrHQ6kKDlqvbEfxWH/D9iVWvzCB/u+di14PS3JYyqQUWJc/TGIZA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.1.0-pre.7.tgz","fileCount":20,"unpackedSize":49971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf22vVCRA9TVsSAnZWagAAaZAP/Ath+5n2XOVqe7O3bcOj\nak6qfw7CZprlPLo84sY4Vh4fkjS8EjTPceKHW0wbYAhcgD5RrpA44IjkFra4\nWM2gZdLtE+V1HanVEsIt3TKzEW8IAfEFPzKuGtEBbYsY+szvv6U9c2YRGk5b\nFfF1FQipmdTZ8YCtoN9h39MX+BplcXVqnOFViIEnfz4GGlIXNjs0AR75mcTW\n40KM1U4+HztbZ/ZrW/2ha0b/olD1QHAWdKL80kfCDkwPTgYvueVX1D4TLw0f\nBfgF9CDXP7qAtPfw5dWE9FgeMYxZ/M2s92lY5et5t9iLRsjJz0Pnx2XlS5cb\naNv7OyVZyXkFtL9fGZ53aCfWRvHybFQLtd+hD13Du9eNrVTTYHKzovfMadru\nEAJE5OZjXyFv1RDUYe+BMvyiMxAZD/+5PNmVK0FGnadU3JoK1M/Z6tX5k0Ql\nx8lay88msm+/BP7+fRk/0nAaEkOpZ2yK8VvYoWUmaxrL3NblqDARWGCOgRHh\nbpnis++IdFYPPWK4WCF+D3fJjzpk0CV5KYmuvAnslVOrYe+efwqZzGfqXfqU\nXgC0FPa9FOO64kBTzIFoqPm6GFdJxGOR+CYsX/4wNgqSFYdkQKB/xL7XmPoH\nmIKTbEIx6x2FMRJq2El7hekzWaQom7RDlbdC8ZXNXPJYujnMFUwPkURpuAeW\nORea\r\n=XHTx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIDPWYYlxbtlCckxlF4lVA0DXfvZdJwp34lvnrhzDkGgIgTzlOaPLZRvG/DD40SrkQeUojRBW+gzKxbbcCuw6ApK4="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.1.0-pre.7_1608215509406_0.6755552379249061"},"_hasShrinkwrap":false},"0.1.0-pre.8":{"name":"@fleur/froute","version":"0.1.0-pre.8","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.10","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.0.2"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.1.0-pre.8","dist":{"shasum":"b3cc307dc60858929e36cab0037b73dc038fe11b","integrity":"sha512-2Fs+j2cn0aTVGcFwFWRnW2NTxQ0yBvMQfUkqm0ML7Tg+8qSHtFr4++C9uHV2njlgc4P0dPzQ2Ik0N9tjg1E26A==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.1.0-pre.8.tgz","fileCount":20,"unpackedSize":50390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf23V0CRA9TVsSAnZWagAA244P/j6nlspMl/x0w+WFZvV5\nX6T8bAGhnpIvY5egOhdBbbHrQbTiGxzgYdl+B+E41i8ykV+UqMO1PJ9QRg7X\n3ia9/1cjJyeya6beqUafFX3EvZxB+TKI+0pufPy/iN+bfXKpu/RucwZ0OudO\nsPPpJ90UVqHko+HgeJyefjWxE30vxgy55jkBBvj3+xVwbIq2ETiWxmN3qLUg\nYtYDpdzfRpJqGg2k5TUBFaUbJEfY53xcFu20vzTtmsT8mXknzxOt2Z26fgV9\nWs3OWGAf+U0a6K7QA0G4p1QapoQZJ82UBBs+J+cLK2nHNHiTwesXmCwB4/Ay\ndsneeD/Cv4HBp4iO0BO6fHJqlvUMovhNR+pqHw7FhhM6yw0ZxlvcRQVARj1i\nZr48s0leBkS+C0BK30tziIYs3MBp7YgcSgTSBCnKaPzNmXB2SorEHpAmPazB\nETj1nr9xcxeZc7WItlqb+VXMXOq8woGbzs+DYo2o0bjgIwOeet5dlYMGuHsj\nVlDt/8h3x0H0TitHpyvUbinxPw5iRvWb3CA7/nQfl2ocHEbkbJ99PTt/tiR/\n98w70oap/2MCQkkOvHeBc2f/fRF69qEO3cYoNxkXItmKkMsKVinFeSIbaVZo\nTWSh/GBeGEJZ4F4uH+ssZwAvOnQwsX/LJQdpDFpC+RdRPO4hUTIhRE7w/UWr\nX+uD\r\n=MJVh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBhnwRHaOckiuHwekqY+51IzZrRggVUrla5pRhTBdzbmAiACVPWuJKizF43J2m+YEmY/zovgpgGyfMkmmC2Fq+bWfg=="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.1.0-pre.8_1608217972452_0.5841601559100871"},"_hasShrinkwrap":false},"0.1.0-pre.9":{"name":"@fleur/froute","version":"0.1.0-pre.9","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.10","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.0.2"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.1.0-pre.9","dist":{"shasum":"7f916225b1e2c90480038465569ce14419138ef2","integrity":"sha512-5q/2kKZleq/BCT7NTGe6HNC1kKvT2QJlU8CriOsG/FNlKw2e5Vm9hLQemTVuChQcKWDfhvXBp+ItW3ssVqKHkg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.1.0-pre.9.tgz","fileCount":24,"unpackedSize":55811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3GzCCRA9TVsSAnZWagAApjgP/1bZJZbfgAaxNDvJbtUc\nDzSNo8ugOgQ51qqPawQR3EtVNhkCpNY6FclzgH8PENzfi/GRgDzzb0RbXH0w\nSLWaIlFWVzNtnrxE3MtHm2monVZO3vHrX4XSAVrlgCa3IKHois2eYuV8bQhc\nGs72j/96mG93sALmsy6AuLthdtqqJRBQWdkubqNQ33b7x2YYuYBqQHuXnphq\nYKZc0IZcW8ZQ5Vx1HVJtv3jMEJ6VvgPXo6y/PMZbwiJCCShl60fcXeVeSV+O\nI79RlG1L4fQEBTeyATKIR0YIljHp6HB3yaosctCX74HxskicJc9JghUWj+9m\n8Fa8KFM/nhC7Gjrrn4pVs5MqkrlD2DjncpQqajgdRkKUyvFklBJ078B3KpR6\nTB9FWXmDyxi1N3YKsMjN9WgeDtJJDIdOvEst5yxeXdAe+IOTawwxSqMJY4Cj\nojQztS7buKh3I6tZ/bG73XCJRHDwi3ROuScOX4M2uzOfvmJDXWEC+X2eNu6i\nnREuVXg5UQPxZhZB6PnANA6zPl20DSHJ169lQVKcOzDWtaPlUNodeVJDDyY4\nF47AgUbqI7437l6J1q1ijZk4xnapRo7rZXGEGgwCHL9y2/sdyG8Mha7I8k1z\n9UIicB4JzCfsKygCol+6g140Cp2SOSTiQNxLDBGXgq50C9Hj43z4Oyd9pcny\nu/EX\r\n=QSnD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRVsVHWQiQTS3rzKaIiZRwcTIAAVppHilzRZeP3rt1ggIgKDsBeCjvH+gHv52o6bSEyxPEk6qKCusb/RQvhomguiI="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.1.0-pre.9_1608281281845_0.6693294682737496"},"_hasShrinkwrap":false},"0.1.0-pre.10":{"name":"@fleur/froute","version":"0.1.0-pre.10","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.10","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.0.2"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.1.0-pre.10","dist":{"shasum":"aa8238d73f1d2131222884486f00e5da1c16c42f","integrity":"sha512-XbSMKt0QwfH7IbqkX6DNVgRZMljLa01vz2FevKYHADQ39v2F0vEWOGSgtAK6mMRXxF0Vyle7zmVHpOrNnAn0MQ==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.1.0-pre.10.tgz","fileCount":7,"unpackedSize":24302,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3G0kCRA9TVsSAnZWagAAmS0P/R7AP6IQ7XBl3tqzp+k0\n4CQqhz0eGKau0DNIp6lZmHm2OjRBFREYigSglZ6AkUVSoTsYpX9oFHgETB3Q\nTxikUNqHLjKFoUSu3WokAZBUFb/qfpBOw3FcV6VvYNwpWJKveTj9o2zpAqoe\neqhM0sC9KOxYZxRmBeFLPspAfgdazljGl7Cd7Qx8FFm1lCFwAvH5Yc4G5StQ\nxZRXVyly7x8SyAYyfwsV8AVK8BcxZHk41AV2/p/3ExseDdgSzcMjVedgNuNB\nGrcfNP/OWCVocAPtujP/emVbihM3N1IvTQ/xTd9jSwq8yjtRGi1vbNvZw/l3\n4cz06ZyUwd7977No4VFGtxOjlAlNPKRwzHAKlZlqWTJCnxv5Sm+K386gqjHf\nCCG4gFwOTB3IKBQUDrGz3s1RRX+Xo5lVeYZGz7M88R4rXohsz9a+4Vv1eV+E\nC4gCn9RU+PXtZrVktxBwGAonSMbIf7PvLAsQOU78M1P41dlcBoBjqVPAGV3d\nFU897d64cMm4lp7+aZxe5/dkJkQaKsWZ84qg/D1lhDcqd3pzN0mAN7JoCsMg\noyBURzNbjc2+JLBG9+zuwyUyo48rKV8dmvBDOAb/p7EgBukYQ4/o8a1U4ycd\nZLhC/YAqAxQTg5h0ZFSumfiEAbG6Ywo7cgcwDo1v14G7P97jdKUcLKt8dpHe\nYy5K\r\n=Xjzw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICd7fIPNIj9+FpXmaJ1liXAxqNWZEV6xgCMVQKWlGzcWAiEAuMn9azxzJMkTSWhxtLpBG0XRdKnuEpoi0WZ9svylMf8="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.1.0-pre.10_1608281380278_0.09725662462777884"},"_hasShrinkwrap":false},"0.1.0-pre.11":{"name":"@fleur/froute","version":"0.1.0-pre.11","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.10","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.0.2"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.1.0-pre.11","dist":{"shasum":"1a2200042413c77ead6284c7c902eb8953d33208","integrity":"sha512-jE/8JSyAKRfm0yEX9cpMgpNSvH8/4a3hngKUDPvf8Dd6mbzWhXbTYCbyaDqsnGtqqCMH2wyvrF/XX7Qx19CAFg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.1.0-pre.11.tgz","fileCount":16,"unpackedSize":53476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3G2QCRA9TVsSAnZWagAArfwP/3IKXgO1JFf6tjAtzkTw\n96EY4UDLUYCUKy5NQOhZjOffndbrSWid75GXD6fM4onkwnvuja9uOChGhI3h\n6mnUnzs614HGAIflHj2621farb9UB1fkEb/jLh5tnQq9Ia94WeonjWlMEyoJ\nPYtOtk5PFOg2FHXSysll6vB0YwUxte5fOoj/OHWAAl3wIpz+i1jIRs6F3Sf3\nL0YXBllX7YBEGUClLNzIgiuV+utcSFQaeJ0DMhEuTrfbMjNwfhjqtoizpFhu\nxfpL06/EcovLOgeYrOFAhko2uOPTvPIOdGU2+FJlhQZZnO+uB1tLawdshqUN\nZ4G0n9U3K0w30adv2WbkMsOD17rpOV3CnAzOXMDe4hhrHH9sDUEfqEB99D/T\nywk+M++67SHF9paj2e3QB2DJdgJLsf7OlUO8JJQVEZoovYrpMID0HWfEIZTl\nDH9jvfC06NOGKU9BER0mlke/gJZq1D8Nvp25CiHvoU1g0DiRzC9gS+0GRGqI\npebc/5mbzlis4RLZlKEb7TdRMD+uynKAl9jxzRhWgHHTpQstFVfRJqlo/SOL\n7kZceLfSg9v3pvNri0xHa8u5q84ga9csVSPOwHA/hwh9DIeUIW9EVTUaFUje\nUMTZ1QedaS5FDGw/+ot2nS/pgbhP449LvXBMEjz6JWkKBz75tj7+/Gec8NbF\nTWmy\r\n=VaHF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA8/5QVq4IhKYgUwZBqki44wuZkdnu1bre8QYahKJh1eAiEA6Ty15ChmrTLiLeHt1/0Nmv0cWX/LjA6EOwSTrCF7wE8="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.1.0-pre.11_1608281487798_0.405933565343076"},"_hasShrinkwrap":false},"0.1.0-pre.12":{"name":"@fleur/froute","version":"0.1.0-pre.12","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.10","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.0.2"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.1.0-pre.12","dist":{"shasum":"3cf3aa22aced17369b4c3e4b2ac9753703c1c323","integrity":"sha512-+Rko/MKEKx+66O58w8xyQQPtcJqxQc4eX6vIEF6eIdmrgtm0IryeWPyJBhJ1eCVXKgCd2wisYZbDEr1slOMpQA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.1.0-pre.12.tgz","fileCount":16,"unpackedSize":53668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3G/7CRA9TVsSAnZWagAAjVEP/0g0A8VUZcMqxVg7cy/q\nDJafkQOpyvE0Hmk/mU00146uycoKr3wMONS0K+qDq3u4dn9gtAHztCxzavKM\n58R+c0X3oW8wdX1g7HcELMTssjtRXzC6owddQYZKP1FGJ6mFEJVS6XxAF70l\noX26nnqMHXxbKg4vYai8k/5wq/dA1CjQ01JiyBY+BZriFdVJOoxJzrLhnG0d\nupy0/t4zD/25wi4y+/oSGBH69M8DS6PwqmyVBI+hvgVG6Gy7B2KnTQcnyakN\niD/OTYT6Iw81Hljwl10cAoDXF7Jqhfq8NbSLRFNsHYC2m7zP0HomzSccYfbd\n/npcDbOjcz/VQpifPY9+gMLGdefpY+vOP3c4cIqPKqee6pAikzakbazNIqRu\n3oednJQhrYlvQO7yD8IguOLxmCnOvSR+kGz2bSLtMeKFGf6rsKaXnxzo3zPm\nvHcw7gFKd2xazVkeV7lq6RIhoEoIp0BZTmDa0dssTvE15fMNVa4dMHBs3t0q\nTg/D+KNVRJ4NWK298GrH317UvIPfoDZ0hisCbPtbHCDzRMmn5tBXMlaAfPHl\nybWZywmf3w14SabG7MZl4kJfEltQw2jvvW1YkkmG7/Vr1ltPgmIx0m4smsZp\nOuuLoON0t2HPnlgEwSiJo7/2lbZNLVvq03XuDHD38uMqYzbXH+suovaDmqZz\nZjHe\r\n=k6C4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHqGOTGtzfrJxSvn3/BxINFBxCOinig4M/RgkkruyqMIAiBDY7MogjoAosbtbrnN8cDdZwX0+m2t29o1rTWFmHZc0Q=="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.1.0-pre.12_1608282107291_0.7685450241671616"},"_hasShrinkwrap":false},"0.1.0":{"name":"@fleur/froute","version":"0.1.0","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.10","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.0.2"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.1.0","dist":{"shasum":"8ea084cbf0dd8695526e199c0509cf0846cb62e6","integrity":"sha512-bybSI3HPUq4nmi18w3qyHEGDK1/86CnXMDqbsvbGAibikYoxkxCG0T6DWNGTtG3SOX70/boltZ707JNJCMaP2A==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.1.0.tgz","fileCount":16,"unpackedSize":53661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3HGJCRA9TVsSAnZWagAAr/4QAKOlnZ7YW7Bc+V0AlxDb\nclGcgyH91rD7+JlN4zga8vDZcE73aU17T+KdgCOpbur/fpHgQynqHVptN8RA\ntS+CjLm8bFTKmqgAEoRJWhRkx04+vjp7eI+s1melCa3bhLm6dDhkDxz31P/6\n2oJbRRj+LU3A71vnn84Itq3UjGZopOt1vbMVOGTaUNRyPgApu0q88B+wSbLT\n/ckosjOhzTk7OCPUVB3Cs0KqYGUHCmPQ2+sBIUIDetyhGwdQGzZwGRopZ9iw\nOyk5Kz7Tj/vlZJGJF+gzLYpRHp+tA4uh9+Us/lzkqxjC+oFVWISN2FP6h1CM\nHHaXtxHQzhSPL5pii3gGN1BfHk5k9s24XYa3YAYYUWaMwujA2paHrZX36EhW\nDWdKEzd6bdgffXInfxxY3m+iBD0C4nz6Gao+THmB28Uk0UpzBLQdFle0vKtX\nHDGQmDYeR4fn/bRqDr+OOoFrokj6EwmovQ7EPunSG5QCq+rLiyYZ3H9ahDg+\nFoQ25R1BF8wQbUsikaPUDcmDPhlZmyhdunHqej3zjqNQKyXjqCNF2mE9UVTg\nrfafNx0DAJrQAN88a1VCfNp167OE+wlWLavRy/VCjsaOLYsRpsfXW9YbgicT\n4r1aK7HgUq9se8oUoVBVGCsuBmGAa5ZDm+asmB2xWcZ3uWtrYmPShXgGIimk\nX8Bg\r\n=SxDj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8gd5Ubu6BC2a+abnxD1pqPZ37IKEeLZO8TiasuDsQYAIgO3p8WW7pBdf6q0bEctmx7lX1Cj6lgLb/LLOVePOeR0A="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.1.0_1608282505435_0.21496748429353474"},"_hasShrinkwrap":false},"0.2.0-pre.1":{"name":"@fleur/froute","version":"0.2.0-pre.1","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","punycode":"^2.1.1","querystring":"^0.2.0","url":"^0.11.0"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-pre.1","dist":{"shasum":"21c2c1a0650373b3fd45191a6d34df413cbedea8","integrity":"sha512-Rt8/8vYFyK3CYkkU+3OxfuAcqxBGVF67osNfy7nkAdNTp6cCNfiiKPEljjZV5Y3aX2yWnSaK+YLate3sU+PwkQ==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-pre.1.tgz","fileCount":29,"unpackedSize":121212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5FO7CRA9TVsSAnZWagAAq1AQAIcG2BIw5bZSeQvdKW2o\nEWi6huQ1fgj9u+PurroUMAyZvObSFxcSQ6TPo7vzwxvwc084ykAQAo0n5eBI\nerW7YNAivhXPKkGtP91CAYRWzBP9Twc9F54FlJ1vUrwELwHOMywCUhJ7zpHJ\nTgd19vJD3dGCMEP+Zv8OWGDLdMaVIOynj1u5LuRvWEqCIm3Dts7UIqMPunjT\nJ10/9hN5xeEzzlgrSWcDv57Qk+goWvgmpHN4JC+CUy2LzLDhOl4WxTtUrH2r\nsQvfHgNbSOSM8+qgfP2sUqyDAq4tvcVaiOeU3jbwsvdfMct4fGbYxj53gW2e\nc3bqDdHMd2M3yOzFhWhcec23Uurl/e+O9jnqj79V3w/S40a4nBiAFmgxfKm/\n4Xe5CDadHADQyepu8Iuyom+sgpUGQNKIUXTu3peri0BZvOBXa5IFHuw0u8xk\nr2S4pK/uPm9PqoX1hPH3TrRTYpb+584+PygC0/GF58YZERNq5ynxrBuUEygQ\nKBGjAl5yCHouv/6A5U9EX4kg7pNeHRZeJTWDrzSdCW+4G+Sp/nBetBuiA3kQ\n2z+KrDDehpuCLORAg0F66F69GskK9IxUWvjjfQz+Qar/V+Jpp314XCJemh41\nzHV/z2WqtHYL5ZO6HMUO7W9DSliQ4YQSssXLWgPjCiyRvofIZRLd8+8i/yS2\n+Oth\r\n=upKx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQp0R4Xg7X27mEKCenAnYBZbCuHEwZoizwaryfRUTuwwIhALY7UmkFyZb0Smg2tgZivbIUZBMA0ZVrExkKaqe2LetK"}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-pre.1_1608799163197_0.6288189855579884"},"_hasShrinkwrap":false},"0.2.0-pre.2":{"name":"@fleur/froute","version":"0.2.0-pre.2","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-pre.2","dist":{"shasum":"9f0d2595fc971a01e515ecd1264346699d9a3722","integrity":"sha512-ET5oo8R8FBcsWcqfD1HyX4PX+PLtDHPl9Bn8n4ygaAEjLPeQirgi9PHqAlf9/vTzbpEWRF4ndVCmYqBV2kF6fA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-pre.2.tgz","fileCount":29,"unpackedSize":71999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5H31CRA9TVsSAnZWagAADzsP/0QO99U6hOhuzx+LGi/l\n50r7v4SQG4pFVz2+sw6UTO2B7hnDvYvZ+fWpnhLkPwkoJJmDCOob10YaNOa3\neWBwBtJdzdzO7Q8knVJNgt2OhOIk/R9fDhiPUZVk2HyU1rLb5JXZmrzNoIwP\nTTfhDw85fYqYGaowahPzQC/oyN/FBH1dY+HHUbE/ul9CH5QdRfyYjsj09ATO\noPjYXIGTgqJmGzaDrYQzHXC2AxReBjySIXxiHXJconrCp1wm6uyTEAFNEc5x\n89cyLK6mseUEsBpOh5FU2JWYW1dEIhy/VKAHpqLNZ8Wf1yERaWLKcmFI2gbb\nt+A8jMr5OxNU6ON/8HQTO2qIvkiSQRThVwRorSvXfgJuKBeu5OV37VncPHfM\nb0UNGf3supXBjkWGD3ncpLYdSf1RSarJGnzX+xrZkWRItzrG6FMA/YLq13jW\nrYQxQuw3MIsmly30bm9tDDwHwejqbt/FYJBlcMv2riAbBkUHmdE8elBtxxV6\nR/iTBlJqgBvke2skQ+0clZaZqNbSr14mfjpcGLkIxajJ7vLnsviPFPTJyAy4\nZlREzwMuqv48I08Aruc0Puj2P6dAEIYOvyPVr/qmKwWKH7/dgo1WEHL9ga/Z\nDZz3iIDb39u7XzR1/xAYnHauzBc9nS8WR6HuRbyaobeLMX3NL9nrHv751NYM\nbd1o\r\n=uwkb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA6IUzyiamie4avA7rn45sPsYJABOl1PlFcRMdV9UkkdAiAtnN4+6bzecKc28kAtVIOGk3rnPgVz6ko7OZKhYjI6fQ=="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-pre.2_1608809972490_0.6456381630079939"},"_hasShrinkwrap":false},"0.2.0-pre.3":{"name":"@fleur/froute","version":"0.2.0-pre.3","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-pre.3","dist":{"shasum":"adc75fc59f1c80e724c92c0f6c0af86c31bfdba2","integrity":"sha512-9OFO9WdogvElE+vdof64U1QVrNZhCv7JVpZ1yogekxfbfoVgoBPYdC+hVXDQemcXJrm7/q8AWhZBJ1GvaghGqg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-pre.3.tgz","fileCount":29,"unpackedSize":72436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5IeVCRA9TVsSAnZWagAAVUcQAJNaqJoewbvHLWCpDERH\nL9QuWngy0YjgXFBqfLqeW5xKfGiDWzNyl0LRUE0PLT7fbsWkalmTf/VvGzcM\n+/rw8V1wYI0yU5ugmUuf+dIsw6MmPx8UO83d+NthOIzdWx8wfh47oT37KDqC\nSKly9LgSSpEA4JM4Z7cxBq6rwHqQhvVEb7Juw7OF0Upm+jOjbVTouTKuhZ8n\n/0WyNaEdwaclj5Q61FuV9UrxzYjvUV5fIVoiQer/yg1nwLqd4SayfdZdkWZA\nCxKYVe8fvCRZ7H921NwdCwJfCTthRZ60T5KK2Ws1+DfIROoWT++A3RPZ2jEO\nRysOlVtUlv9Xru8/EIIMSSm5qXl0ZYV5onNwDjXNX/vEsRl71IjYL6Nz4+6X\nz5EGwai1083f81kiPa2vytNH5Jo8dALIBSUhdFrd4sXyJWzGo/BvNGlCkgN3\n2F5WDoyHxh9OS5J0JjL08ADRGxbExppBNwdVnr6lP/CXWkt7C8yCLWLC6Qlf\nwUpFvHcwsSjzeY+0YXzf3fgs5882bieSARCnDUcWHSUdeHVsQZBOT/inyzVZ\nX+dXoFruDIV8Epyyi+LJLZpL/GRp5jUe1MSSMnSXkWemFOc0tvBTDV8TgW7X\nqC6ZSAo1+V8rt8JXDHMt7Xchp35JrUf844uz3h4TSo3y3WSDu4RgOB5Xug1C\neiAN\r\n=XOJl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCP8dCguKEjUoLNHFJvCN2P76MtM3PgnWTZe81ng2W4swIhAK8Vyb9NrsMJdS/kXXaj5OSm5J0w+cg5oVNcLt8y8Np/"}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-pre.3_1608812436683_0.31555144830937576"},"_hasShrinkwrap":false},"0.2.0-pre.4":{"name":"@fleur/froute","version":"0.2.0-pre.4","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-pre.4","dist":{"shasum":"f08e96b8a4ff2494b42102c56153d7a8f8f97de4","integrity":"sha512-yHv0xWzwIuCYR7FZfgwLmuUpT7Ecih3Z+kFdsT5RUxhp/8lcdROEh0mOHKcO4aLkhI7JFf9DYyRrO0TKkpq82Q==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-pre.4.tgz","fileCount":29,"unpackedSize":72376,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5IjnCRA9TVsSAnZWagAAdvIP/3snQrGXlgRHWvEvK2JU\nT0qWPKtdkL88dEN5KRNID5mFm2ADC2YvMnvaYSe18bngDSdsVhEzsZc+3L31\nklVeOa4EoX8h7YMV4BK/xaMbmnVr3Jcn3GyfhoCRVc7L48P/JVtlImRF0Z97\nvvuIqJe8W3nFE7JMfLo2nkvwnhv2Rqea24s3iFx6plyvC3bhoPhpx0rZFLzM\ndZUliximrGAaps9ZZZVF4zcvHIKaYsbKDIoc0dCrr7eJtlWBx8TP5nc0pSnS\n/2TVUa3DZbMhxdfiUMhmzHJo8IBa5ekglrCBRXqg0DxwyJs2SOOLnTv6y003\nGHx2BWFiAJZp6qjiNkPGFHWCq3U3mSXm+3fK0XIAXadk396PIEwvLOoGJAz4\n3/s3Pngk59zGKWsbL8AMm05m41cDG3kiWKO75fS8XXenUsELaL63BTcZ7Hx7\nj+k/pb9qIiIVjXbke3EjuJQZuCq46KQI8Ew/CQGivCVF0hZ51hKZegrImCmC\nSSe5wsmmYd9nYIawyBFADF+wXsafdDlphnCsvWOOvy5WtqNorV7Q1dmSWwVT\nWnMSlXGnhbh8Ad9LICm6bJYwUN15YKWC17YFKENKXNf30Frow9LxmdctP7yk\nzHNoAt5c3FGC1zPX2upAZ/sph41B0DQNQS2dl2YcbdKxIEIWbcoCXpeV/ROF\n06B/\r\n=0Wo/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB3l+Euf2D4gonv/x+OzL9kutb+hlqE27Qq/xFJfNH9qAiEAuuhiGAJFMBgWgQ1pi/HjcvsO/BeUENHROJGwpZ5j59M="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-pre.4_1608812775065_0.26888713053236946"},"_hasShrinkwrap":false},"0.2.0-pre.5":{"name":"@fleur/froute","version":"0.2.0-pre.5","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-pre.5","dist":{"shasum":"1b044d493d6b357bdbf3bd5902979833d324105b","integrity":"sha512-cIR3IUpLzJDfGHtVIGO/wUAS12CJPpQHumX3TZHnWi30UeCnRD8WFLfVon98wbIzxDo8330ciyx+ENzowTR7Dg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-pre.5.tgz","fileCount":30,"unpackedSize":80540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5g7GCRA9TVsSAnZWagAAOdQP/1qnUFI44wExw2VvJB6A\nmffP0q5I7c4J0IIcgClClzlGBw0fa9OMPCB3lg49Wb3b4kwcYnLA6o70yQI5\nbKvZq92MuYlhT99YpBHBqAA14Cm6a4YPJwdc9vt2UKAWkTDiO/mrc8TL+2ym\nvUOB9A3Q8lvJsJVZmQqAgd5FeOsprqp5BX3imypB1T/ENTD0R4sT71Fs9QUR\nXmj3QvX4ciGoEN+2LhNBFYG2iIGog1Z9C1L2aVbImihN8VYcSeCGoePoh7I1\nV/ocneHH1RpNrJtVEwclAHUFFBea+xXqvKmZGmkyukclC9W52iOUKwLpBFBe\nbRP0Gy+YoqPOZgxcvHUgcEtPh3byXfP45PXWwKYp9aMzrKjrZPPPQLXIbTbp\nvJxtzL1DPazxOsgyiLi7KufbhmrLWYfxsYGZTZ2cYW3MvmK4mOCPdleKJV6y\n1pWs7M/oKvGbtJsl66hBYt8ksdH1A3bLM7tq5c6TPs7wpVzes/wy2le5Fzno\ntCYrq4pJV28tNiqUhBILVMY83RErY7yHfkV/DSDOxmS0k24984ItEj4c8/Oi\nPv/LPZD1ibAo9d+U8kd0B9N0Kj22XwhX9KqMsiQ60IyC2/u+H0ty+CHpLsHr\nkgZCMggYEw107uEqezq8D0eJcu758ro//6H5LvKFNkAJusllF3J75nsPWeRT\nBkpg\r\n=Nb2+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHWpuAhlrquicpSzRiWzGIa4CoAQGHsmyo5HGht1a89/AiARw7YO16zac8qFsLO8awOTOxVQ+rk4YOmLhw40wINHeA=="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-pre.5_1608912582102_0.5527145675014196"},"_hasShrinkwrap":false},"0.2.0-pre.6":{"name":"@fleur/froute","version":"0.2.0-pre.6","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-pre.6","dist":{"shasum":"07da0611ba22ad4b1adfb9b2913c8021d2611d92","integrity":"sha512-lvmU0W/BaAq7PVJAIB5ndMidqaSaHNHQIbw31FNrjqwduLWDM4sVeJ182jbnzVwYhG2ZPTfYHzBxbvf6UkCV5A==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-pre.6.tgz","fileCount":30,"unpackedSize":81379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5hQXCRA9TVsSAnZWagAA0BkQAKJtOV960VkC892io3Qq\n2DdkqPt49bzTPkxiMA86bUMrLdjLQX9lM90VEzERnN39nCX3QL/BfeitPZTc\nadexm/f7kk4BfnHNDhTQcshd7nStPh25jdrbf8gRasxerDrgVz9+sgXRKQOO\nQRWR8YrMI5yMHqGLRQkVhqn9QCbjhVwCUnWr58tggYmhqyK6lbGHt1gwB6/N\nZmxjn0TNvfHmWxekzZAzPwbpJJCKQ8ODySzDlYTne6dAY3JPgixg+bpltmW+\nzpyYPVJ1v7aHazh7uX8JJm5vqoAfQFNqw2puNsBjHO1busXIMukvjpE92wz3\nDwkLy1dpJtQikcsm150Tr9wIk7E0s8JAXqGgUPkq28X9PMvwl4EPPP/sDyvI\nmUtCUiDCrS/h/7c0Q6e7h4b3XKsKbTGp3dFsTUTACmSFculOUWnYpp01nuyN\nnCycV8JGrQWB98Wx+ajKTM5DoSjCbTxGnkUo4sX2BeV99d126N1zCgaxX/eE\n7lzVRYZvk+B0UcZ1Q7D5KV0Mvw+fgfmHq+G2DX1adl7p5kHorfvbbMKbKnyY\n2v6Xe/QtmTFdUpDHuHKD4xx6hLqa1Q++s11iXQLGON3UkhAZyjdX3Oe2h3yc\nulEgICa0Pucjsq9B5oUCvO5xGNFpTcACVZpl4yxtSSjKzDJGqoThhJS1SbrS\nZaGE\r\n=i/zp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDk9nl2bX0Wo+oRNFmQXe1MZCupuvrFrody1EahY4e3QwIhAKb9Gyr4yLeetnyJ0zTMzMWQiIJk8YicfdRyi263eyU1"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-pre.6_1608913942582_0.8539367094643882"},"_hasShrinkwrap":false},"0.2.0-pre.7":{"name":"@fleur/froute","version":"0.2.0-pre.7","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-pre.7","dist":{"shasum":"908281ac231bb8ec840b5cf10aafcf62ee512bb3","integrity":"sha512-omN+uSfKqPfGSByTIP8yI4AnjeOP+b5kiZZyt+uYLrWNbqV6kI4DTIdX2+Z5UHJ0v9IKkb0L//lY/K3WJZ+WqA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-pre.7.tgz","fileCount":30,"unpackedSize":81379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5hZ+CRA9TVsSAnZWagAALYgP/RMFGnaqDxM/E7Q94HdE\n7u1YWuiZVNwTb2MNq8DuTdiO7pM0iCU6Njq3h5LPPG3KRsqj4vim65uViQvX\nhje6gWe74XdxTfRiFkMEjAAkCaGBHJs98e3qo4Do+o+nk4jIMCcmKJ47O+h9\nuAj++TOjxHcEls24zi1VxePDSAaVacPvQq1v3HGx0m3Kcr8YsQcUZrnKk5hp\nX9X3+ojEtxwE2/4pPuCWn9FpZ80k6Dho+rUw2496muOSB18bIeGA+ar4xKlW\n0gl4fgIqh5WJUM5Lyi6lPSxn3R4G3WD6GLQB01isAo8KLrBBH9A2FINmS5uI\nOaTKgItcSy8CosuV3b+ARzXaf/vCTVwGXfE0KT0XWd0fFLWj9S0UwmrtbOpW\nQz2OKj8eIGNaVSYYCXlIS6J+PwS+c/Vz7j6S7XPwPehJ0eVR3unt16GcAYqV\nyDEl1WrSo2zJ0gIFaNRSVItfGl0Ics13s72lEn86s4ZmBgTWdLYiSbjlnZHS\nPeRp59/WLoSth4946yMwQ9miXgdVwDreHmd96DrGqy+NrgGwzQ9n1/FdfmbT\ngtPfdQnOndcFk8MQtetY3vyGHMLx4FiK5IdDYfPldrtQ11dS9MYRA6EgMNPA\nBwH/F8kV+5OHg8PzOvwELZM7ijPl+mxj2MjjYssP04+BnfceH1pAK9PY8aJC\nsX8w\r\n=VZN8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHrS7GD6PUkAcexUjzjOJC9BL0P66fhogCd/H/TUPfyAIgWHhiGWGg+qz4VinIeQshFg8EIwCFsw1SdFjBA9GVzE8="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-pre.7_1608914558028_0.9025323994505996"},"_hasShrinkwrap":false},"0.2.0-dev.8":{"name":"@fleur/froute","version":"0.2.0-dev.8","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-dev.8","dist":{"shasum":"0f5bdae69ff7124857eba09a5ccd1f2280a2e3f9","integrity":"sha512-CXROsp84Yo8jFy2AB6VYtdkAnv/5jIA5R5pmBw7hblDB8h9rw8zUcAaGsi93QzhIR0mMLw0ttLPwjWYZOTJBFQ==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-dev.8.tgz","fileCount":30,"unpackedSize":81379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5hvvCRA9TVsSAnZWagAA0mMQAI4bz9fcoxdOOw/UKcet\nMoEQzedKFRkachT9fIu8D7bESC+tNwXoovsDuIl5AbACgDRQyoU4cr+EqQAt\nuUCGR6f4/pQ2E7s8LxceO3ZseNdp8HtB9Om7dosvMXq3vEhLJZbCgfTIk7CQ\nQ6+T2z4Wm7l02js/zFUvg1s2qO3Ywj1Zqf42gsdwq9/fApNcsKfjNWuTZv37\nDS0Su20UFZhmf0FFFf2j5cM+WSeWKiXNe1M4iWjPwsPvCPVzVznTIBCErv89\n9zFVX43OqsOzRtw72rfyIphj2HO3FJxpy3a+AINHovB+XEjoWnoJC57W6Hca\nxHd8C9/0gA/ehvzoQJJEdiEpAnz1lO7z5Q6S/EFGuf0ro2Dl31Z0Nx6qifue\nRLKU+e9cmT9nJ0GoXu9DBoussaAlsSq3k4R/qGFwhPF2UtwIUcont82GUNp1\ntMbu3Z7JH2q43TdZ969QFobPUCyyianDEJFuFBMJx/JzKrWU3NBL1mXx5TWd\nE/POA7US+U5q3sZa/0ciCcJGCQ2MjtqTjISt4bMBNfOH3W7PybKsPmIMlrQI\n9RCHSMZmAa5k1q4ROFXIYk64zU8Ej7SWjZkRgdmTJhDRbwxZkvZmTr99wHD9\nen9l+5ddhwYdcBm/lJ/pCKNuq3ArzD0IjT6a4AK2OTUHikIeszOdSipryLaN\nskU5\r\n=Fta3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBcHh02sXDh0TfqA3pMY3W7sa0XhaDiCHCK80suTqMgWAiANrvVDhbJQBZZ3+rPgV3Elv+FdH4NgQrcpZ7pjvNy3xg=="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-dev.8_1608915951032_0.25820680967401843"},"_hasShrinkwrap":false},"0.2.0-dev.9":{"name":"@fleur/froute","version":"0.2.0-dev.9","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","start:example":"cd examples && yarn start"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.\nCan use with both Fleur / Redux (redux-thunk).\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n### Hooks\n\n- useLocation\n- useNavigation\n- useParams\n- useRouteComponent\n- useUrlBuilder\n\n### Components\n\n- Link\n- ResponseCode\n- Redirect\n\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeBy('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeBy('/users').param('userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, param) => Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { userId } = useParams(/* optional */ routes.user)\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (!user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouterContext } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouterContext(routes, {\n    preloadContext: store\n  })\n\n  router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouterContext, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouterContext(routes, {\n    preloadContext: store,\n  });\n\n  route.navigate(location.href)\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-dev.9","dist":{"shasum":"8d3fac4dfb9567e0425c4cbb87170e980d9542b0","integrity":"sha512-qtZTRxQ/M51ThFKvcHyA8DRF9I59tInKnAzL8aOJVjhu/5nIQG7+WlzUV4q46ZT4/OBBO/pTuLa20k0/9v4z9A==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-dev.9.tgz","fileCount":30,"unpackedSize":83079,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6ZzcCRA9TVsSAnZWagAAY9gP/iJ3dyIFArq33/zrqx3E\noDVbDqTvT6ZpQcvWPAWjhbiUFfnSuF9IOaTD3Ij8ZA3q6C/gPwotXmkbbO8r\nskyR7aOnwWknM4c6q4/4eGoqQPUwrbPVHOQ9XJ4x8WvSErCBz4nBgeUBHYgi\nMnQjZ3ZxSnDfX2BePV/x92dtqDeo41mGG8A2HWdxtUXUZnoS69+0Sl6E5+JM\nZRr3j+LJhcWlrMZ5acPwibMpMOsewDxP/TXqeYsqoFvYEyItPBBgqBYH+zoc\nsIgFf8LBSU2s2wo9oD/YjuKIjwuv1hifJACmUPoqq24uPTEyQdCOdApJnXsb\nXfoNCuQhoQQqmHrrbz8VGqMHe6Ioax13KZkzUCPKzw2pONaz2jTHYPVjEW66\ncPEdPCadIRHqc3+xMWEcJWS8HBEtVxr+8uWkhwbxmLpEEHFagV5jMJtIf8PU\nTFFPoypAnPfiQrwLdQru7t2YQFuATjvUhwJvFsL1kq9ywgmmJaRJb0XXw+6X\nrTEoNOuCl5caHOALUEBwj38voncazavAWDYVwcjy3qYvJtOf7TWOMtv+uRsI\nvBan55z4Ly01Yfcam9U3NS5PjzbgMV0pUE5DoFecJ1lq4Aifw7ezF/alpQ2L\nvYnYvN07ZEai0eesj1MW8T9Nect15NbglnOb0spHP8gpJ2rBspg79kVWHhjt\nHbfa\r\n=vtA+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBmW7apGz3aZY3w0Lv/xHurRmJJuaXob4zxlc9OWgCjIAiEAmn7OmJ1uH2K94LXmrNsUalv+RAOpuzw/oj4RAtjqZ5w="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-dev.9_1609145563851_0.8403904982307511"},"_hasShrinkwrap":false},"0.2.0-dev.11":{"name":"@fleur/froute","version":"0.2.0-dev.11","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.\nCan use with both Fleur / Redux (redux-thunk).\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n### Hooks\n\n- useRouteComponent\n- useLocation\n- useNavigation\n- useParams\n- useUrlBuilder(routeDefinition, params, query?): string\n- useBeforeRouteChange(listener: () => Promise&lt;boolean | void&gt; | boolean | void )\n\n### Components\n\n- Link\n- ResponseCode\n- Redirect\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeBy('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeBy('/users').param('userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, param) => Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { userId } = useParams(/* optional */ routes.user)\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (!user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouterContext } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouterContext(routes, {\n    preloadContext: store\n  })\n\n  router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouterContext, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouterContext(routes, {\n    preloadContext: store,\n  });\n\n  route.navigate(location.href)\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-dev.11","dist":{"shasum":"a145d2804c16144e0e93586ed4c46aeef74e34a5","integrity":"sha512-ToUrK1rR+Yr4I6EiKVxGjVZzA9cuimMUOMrzlweo4T2no9XIYFSfCE+nAOcWd+1eavVCSyp5dmqO9RkMLl9bvA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-dev.11.tgz","fileCount":30,"unpackedSize":86539,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6u6jCRA9TVsSAnZWagAA4nMP/2aawFtGTLMcBbvNo4n5\nKKB69gezwtEXgB3Go31uczg8ceodDLgwNK5bH8MPfw+cvWcbsqHWFakhUp8F\nLevuUfViy8bhLIdaUOZEH+xu/Xcljcu2cARcvDLhnDe6iU/BrQMXQNwP14Y0\nmH7NgtMFcm0xvTsk13wAeAFSGVGez0HspgA3xE4EpH44R7nu/CpGzQzU9kHJ\nD08jNpX4WIAUPbMHCFKFprLlcv3YBCB1zCQlnvMxIX36cY7tSHP9L3A5fvKA\nIJZLlPYEaUl4qSKCLfPMqwi0RKljkNlJx2/MrOf5q59ocLWcqI/Srs+i2R9K\nhTxY3pTD3HRbaXqRjpPNhf6n/hTxg3wol735nBOIVDtL85Emc1O29IZXyhKf\njLFU7yxmvAFFPwibfYPtHTWesK1nOmDMUKlusgKD9mkW8Dzsxg5bgmJD8anl\n3k2VE+/5BSyctEHxK8sXrxHTuczG28LiryhZSAp6NqqE7CCIOcgudnk3GoN+\nRRiFhWCIlXyxwqqbxe4+kHcZ4Umu4br6iD1BF4om7lRFxWK5XJS+pNMyMi7P\nACmfZlz5PSnnKIrMU9TJNKQnE9uoSVv4hcYbocytHp+DLHRmRHu3mdY37/Z/\nsFo1RIl4eYj57gGaDcCUbpo9xLnhB3KBkI3Ipc33k98wGPOkpHy99875InGT\nKoYm\r\n=NKG+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEs4Yl6JjPQTeVzkc7jBnFjyvlboVPBwMcvVU91U6mEiAiEA4YwxtWeMj7Nxq1Vl/rTiJn84CQZVU9kxn0RgKdRIzaA="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-dev.11_1609232034781_0.0759880542435174"},"_hasShrinkwrap":false},"0.2.0-dev.12":{"name":"@fleur/froute","version":"0.2.0-dev.12","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.\nCan use with both Fleur / Redux (redux-thunk).\n\n- [Features](#features)\n- [Next.js compat status](#next-js-compat-status)\n- API Overview\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n### Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### Hooks\n\n- useRouteComponent\n- useLocation\n- useNavigation\n- useParams\n- useUrlBuilder(routeDefinition, params, query?): string\n- useBeforeRouteChange(listener: () => Promise&lt;boolean | void&gt; | boolean | void )\n  - It can prevent routing\n\n### Components\n\n- Link\n- ResponseCode\n- Redirect\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeBy('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeBy('/users').param('userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, param) => Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (!user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouterContext } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouterContext(routes, {\n    preloadContext: store\n  })\n\n  router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouterContext, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouterContext(routes, {\n    preloadContext: store,\n  });\n\n  route.navigate(location.href)\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-dev.12","dist":{"shasum":"b82ed766fd04c31eb7239eca562c441f98c06442","integrity":"sha512-YeQAJntf/AGj0vRXWuzPBVgOtc2B97FnGl/Kmmk0MVw9T75ndWDezKDPDXL7wAFEWIYycHuCOD7iBN9UDadMyg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-dev.12.tgz","fileCount":30,"unpackedSize":91883,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6wOmCRA9TVsSAnZWagAAKaYP/3mQzMnxZ9fhWqg/+v1L\n6hBCHMfUEOz1XTIV+8O3oV5XPElAWL3Q0UoflksJUn4F54j1XV5scyEhb1uy\n0skWn6+CGTEjj17VPHTXjzGbQV8Ry/mhUaJlkr5D/Qhdnp4bbfXX++nKtxHC\ni4TAGtk4QCefXS+JskQWDeAkNNxPTvzaAiWI5ppQoO+p9qJO/kOUm70RgjHW\nmOlA8WdgqpKOoFQOHweECAhIscDwAZBe0bCDidn2iMNsgZsFQ0AcY0HZmRn3\nkq4ZboWOQneCwdv+0Tw/fN5guOLEPnAw6pCCy6ZOVtUnFBVEt/9C1Gcp3AlF\ndM4RP4prXe+RCwYEDnYQhtinBKBlo0dwhSLCKYlPLbu0iFFqjaJ7vJ1EkmAa\nhvj31XRQtl+oTHVdcnQw8uyUIQUS+rDwQo0BUJ0EKQSZoDmJP8LM7f6aZca1\nEoyg3wJoa47IUqPaDiAR9EK0C+9K2EN9JvTk71j+1KNcjAUpRYha2Yju5SAr\n5lSYQq/R/e7KfSa8KdbIlLF9VubtdSY7e+bPx8g2iv8RCKpDw+Xfr7f1Y+ob\nRh9BisEJhuYHbZp39wUBigT3XjjFHIKvkGZ8InSrrZ4mUGoRMHVLxhC1xzCx\nV6EjV/IEYdZa24IWb2w6cZfHSyDbb25RP/AsRNyeCiXiplJ9HSN19T2H7Enw\nhPCk\r\n=vdzf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC12cR9us5izng8xF9YRGNau/nBB8DKD0l2tH4PmNqQBAiAJIwbmwp2rsyhq3oAgPFVSlgH3IX96F043pe+8rSPLsA=="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-dev.12_1609237414184_0.4520501345278902"},"_hasShrinkwrap":false},"0.2.0-dev.13":{"name":"@fleur/froute","version":"0.2.0-dev.13","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","engines":{"tsc":">= 4.1.x"},"scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.\nCan use with both Fleur / Redux (redux-thunk).\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (!user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouterContext } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouterContext(routes, {\n    preloadContext: store\n  })\n\n  router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouterContext, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouterContext(routes, {\n    preloadContext: store,\n  });\n\n  router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-dev.13","dist":{"shasum":"267a4fae9e5cae4e72c75c7c7558d90b2b6db252","integrity":"sha512-bUz35r28kMJ8M8htnXyN9QAumTIfoSSSSSuEF7UhGQfVWucX9fCJFlzuMznchkdhdep9ope9J9xMbUo2gxe1wQ==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-dev.13.tgz","fileCount":30,"unpackedSize":93208,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6xKVCRA9TVsSAnZWagAAe0EQAI97An/ypc/xEIadZbZ5\n3nEl2kukbPyXBPB3Y7NgVE/zRmxInLfb7cCfVbgU6KD95czqU9hey7+jkChn\nwlgnkzADWRNvdvcVrrjRZjR4LEQS+/CwZKpRS6m3DSB/LiTTE+U9HY1zinz+\nxKAqNUZB+FhB6xMhtCt6sdwSSzCfi51pZzsACyc0eR/EFZEt8E8iPM37E7+8\nqtdHswkTqLQjf5pKl5doZstT4BQ3TbOXa/xjbyxMq0rrhMLsw6F6ZPiZ3yOp\n0Zt96C1ZL06GySFNMnc5zkHJZLXFFxyr9tvrcU0FJ1LoLcJRcyn9iz8RzCn2\nXkusUGCipH62FTsitSjV2kIBoTILJ064gDQmNzoiEo0ntgmXrRgBPD5ZbLaC\nPBA5c8qNqYPCp4S0qpaPh22pxCbmbXl7K5qzlT+TcDVRhVY8831NcYxduR68\nI4f1CrLtEPl5ErzTA92YdcanFMWMklKVSxer8Wnut8YRLfsblfI8w9bGqPlh\nbXEmpTVyni0v0RJC7fkYusPkhXuLL2wiLhn0ixmtDRLGHRRjDqWDNzjivcBr\nD8XXOsfuOQjOI9YXIXo2r8u4xbR6k4H8i8oniD/ez6MZlNc03C4UHj57nTSb\n1+yfc1O+sqSBWcgYteiNrAUzWIAKHfEZueUn/cET+3lKMUO1i1SJEdP/Bsq5\nQ88X\r\n=xrgS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDP7t2faQFCpp8tfIAlRzLrXzp0YnJz9S8ZbsvyCro6QQIhAMJQ0jXHFID9yKRIR5PcI279N3iN8Zh7XmGgY+P5rh06"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-dev.13_1609241236588_0.5714738486617279"},"_hasShrinkwrap":false},"0.2.0-dev.14":{"name":"@fleur/froute","version":"0.2.0-dev.14","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","engines":{"tsc":"^4.1.0"},"scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.\nCan use with both Fleur / Redux (redux-thunk).\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (!user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouterContext } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouterContext(routes, {\n    preloadContext: store\n  })\n\n  router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouterContext, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouterContext(routes, {\n    preloadContext: store,\n  });\n\n  router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-dev.14","dist":{"shasum":"c8618de3f588a5b0449e57591911153eb4fca787","integrity":"sha512-HNLHaLqWnggsWfxvnBQK0hHuP/0P4usKDQgt/LklS3tf/shwSpSofqWts1CzQOfapJu7RASBN/yIUPzfPWVWDg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-dev.14.tgz","fileCount":30,"unpackedSize":93292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6xWiCRA9TVsSAnZWagAAkHkQAJP/qbafSSWmcGMWWgqs\nJe6w6QedVbwPOQdWVUn50ECUTSvS2Pkj8zm8hOq/q+3Mka6DBZJT0cZ8uqAd\nI5gzrdAALCCy/TCXcPn6y3BNaZLfxJTtIXGGebPp+AjdMgSrYpAMFqUm/Gna\nFK8OD72ROCaMei4yBu+6UuDXH7XdgTIy9kjfJM5vrgzEcuBZTPU70AQ9toGU\nGc06E3lfYS4X3aUKQKYLMAGDEdQuGLwZhgo11xq97879fqDfhFIDWteETcUr\nERLVegw36TKVrAjolcICSu9qn7NQpxxbqaRmdSfVPkQhW3ZDZJs0CwoFnAuz\nq1RfkMd2k9HY4gsoUi/uRce2XNFhDhaJ5heb64YeAqhALDDl3OVNm9Ibf5ap\npwj08u7RPuH0uupBeT6LZnfmDKGCZdpdFM37B9VAyiv3IjL3oY0o7upSo7b4\nIhWfu47pcyhpWleBxtH2PxCuC952kvllBHSeCYwbq2+AOCiVOA+MCMnP/pc4\nHnDcTfESk9+BBKydwA6QKhsEyUEgSrA8tyXY++x8MyIx01ny/0aVE3nyvf/n\nFNPp0XxK6l2Qj47f9reAKRj8GGg6gkEG+R5HR045ZMpNUWSW1L2cNdNF/oty\nodwdVPEkFEO8Zr/jce09bd3bMfSdFMnN8HtOCoNd7QS13m82P4OKRPokjXxM\nh5C6\r\n=PShs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnh49zdxZeSyZXa3+73LJiW9+XzqoIRkiHaB6VF5aQkwIhAK3zhXIXP+Yot31pS0i+E9x8ynMeT+dOHj+KjuiYqbnN"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-dev.14_1609242017714_0.8096043574217002"},"_hasShrinkwrap":false},"0.2.0-dev.15":{"name":"@fleur/froute","version":"0.2.0-dev.15","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","engines":{"tsc":"^4.1.0"},"scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.\nCan use with both Fleur / Redux (redux-thunk).\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (!user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouterContext } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouterContext(routes, {\n    preloadContext: store\n  })\n\n  router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouterContext, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouterContext(routes, {\n    preloadContext: store,\n  });\n\n  router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-dev.15","dist":{"shasum":"65b87d2f18458d2425f8fc3eb45c7c9c2678cc1c","integrity":"sha512-BrHvUuuvFM1J30DSqSbJDLk1KQeIeALJ/8SddqyPmW2xObPYfAMLhnJ76LOmCX+qUITDMUJDM49LhHNE3Zd+1A==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-dev.15.tgz","fileCount":30,"unpackedSize":93292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6xbrCRA9TVsSAnZWagAAOr8QAIkPCDfVKIcv56dtw8i5\nDz+QK9OoIWeM50XrskD/TduNF4X8p+1Affd+e1u2LHMw2/dasS4PK+s6sLAm\nKHMGN+Xctpu77OOJrKP0BV8OM5cuRC20HmshAbh9wMr56P0iuvl76ez7+9Gp\nbt8CxgTIlURyx7JZx+AN+VVs2YwOUDC94vfqAUBZMnBCYmandLYkaPACqasA\nLFenqpFPCjx6WjjIAAwSErrP0opCZr/F9rjmIlyhsSxPQHnkkxGFVSuSaVHa\nsQjyUPsUkGCm2fhVFSg57CJL0gFywSm/pjV27/TE2/k8Y3YlnKO2HzdoyTW1\nFeaw0t1lRkJdVjIl0kSJ7xZtCcKl0/TJy2SpliNPfnZnFkkJhd83D+Ona6v6\nqn9Li8Tzpwr9Ac5F1SOgiGcmtgdYvbmyyXPEftW3FvdY+cv/J+bkFnTnQuD0\nbSq5VuC1ziZ3SM6UcPiNSelQWpjwGm1is7u1+ICAWPluE5s+tHhKEusheHNW\nDtGEmF/A+NRWJBdf5RO7YqVrYHxi+CYK/QgK7GmI/F1wbj+nGQTsv/sOMkOH\nhq+Wha9cC00GJBgJrtyEMxl95r3VMVKL9KhqSR5u4ysyznOPklqqX+oQKZ57\nRuycB5snQgDk+8m+1T4ladW4MXpqlV6AP+j41NronkoK3CgfvcdJ+obUQ0d9\nyjub\r\n=67pj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPbtt1P8G87+K+jt68mijvdeFNu5qjB/ToIZlZ3p/7tQIga4u9/jIwRQf8GDjthwZFXRzxTRasmRh4RwUgKvXZSXE="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-dev.15_1609242346886_0.3458093416955066"},"_hasShrinkwrap":false},"0.2.0-dev.16":{"name":"@fleur/froute","version":"0.2.0-dev.16","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","engines":{"tsc":"^4.1.0"},"scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.\nCan use with both Fleur / Redux (redux-thunk).\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (!user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouterContext } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouterContext(routes, {\n    preloadContext: store\n  })\n\n  router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouterContext, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouterContext(routes, {\n    preloadContext: store,\n  });\n\n  router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-dev.16","dist":{"shasum":"251f464937a24a9218627ed6d1d1e89a1b8609c5","integrity":"sha512-bBqw8tt2uE8MLIzU/qlYXkT+N6oIMQqa5EIOlLN9WEjbgL9RczKmJ2iWsxNk1/pWi1bPip5lkZ+fYL8NYCK4fQ==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-dev.16.tgz","fileCount":30,"unpackedSize":93292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6xexCRA9TVsSAnZWagAAhO8P/RipMZR+Nux0LZ92+BGm\nbd0u7o45Tgjtdo93mrc0nV4EMGlDdtPylrV3eRVa8JW4yhPeQU672tUI9A+c\nIaSieXi6Rk/4ueBNWkidgR/rJpVE+DJj4kZXEcSuMvpPFvHIxEtoR/+CSmEf\nvoLY6o7XeLsqYCfrSRVhhvFe280y6/+L0CXf0TFIgYuuvs0aiIZyr5wmJ9Pq\n4WVW8jttQrCwjFuXRh1OGic/LUTeZwtoMZF7bcI4d/6wi+m9F74gCGCZoTGM\nFFl74olVFdXGdEw1EOTG7vR8xHbcsaDrgTLoYFYXQmHq/FvJJS5h34L3+ax6\nYH+BsQsfqB4vIm/Fql+tN1tx6rF1YX/Zq3n4VZnzikKxD6TaNGetEBAV4Lqc\n8Do838RaZJ2AM44Z26jwfZnHUr88eAEbBby2nzu4SBVWLeFk9FSefJLL63Fb\natLvwFXPv04fmxfG8fUyBq8jE/8PZeph9A9BLU7HuUznMg11wGOqpjmUsw6u\nrjcAo9rI+QOMXuo0geHd5d+RwVceEAHs2c1n7NVF1sYQ7jTSzN2W+5GTPobB\n/q+4ygbDzFgSkxr1g+GZNnB2HGSGcBl7aH/Mqy1plH0GdRB9Cqgs3ESmApxp\nuAzS+NGuU0KIHCpHsnO7+/MFHF4dIU4w6KEUtNz7c74n+HiMPaoBOfQX+azp\nOvPS\r\n=82Vv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5mC0dR6a2S8A87hOizjSnWOBc1X9Mjx3yw7lDpiQ18AIhAIvbkZCvl0MDcR3WeCoobvimUg5yBRH8MzgR/Sz9kmQ+"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-dev.16_1609242545549_0.463912206655106"},"_hasShrinkwrap":false},"0.2.0-dev.17":{"name":"@fleur/froute","version":"0.2.0-dev.17","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","engines":{"tsc":"^4.1.0"},"scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.\nCan use with both Fleur / Redux (redux-thunk).\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (!user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouterContext } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouterContext(routes, {\n    preloadContext: store\n  })\n\n  router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouterContext, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouterContext(routes, {\n    preloadContext: store,\n  });\n\n  router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-dev.17","dist":{"shasum":"111ddde76696c9105dfb64ffbce7e5d64845ee15","integrity":"sha512-+ExSoeSv3HFidhfuvzKLmQxr0lV/DSd4TNEupnDwWGWIF8sYZQbn5VD7gvAt9pevYvCRTL+TrCUgSRwM03bUHQ==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-dev.17.tgz","fileCount":30,"unpackedSize":93292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6xfVCRA9TVsSAnZWagAAneYP/ij0sJt5zRRrS2q3bt78\nOuhgHOcdxwfUFk1XWePkGL6dQIkV+bOGs18E2pqQvT3r7go/QQkAK5PBMJEm\ndCI6+I5Hwo+IPmcdGe0aAzABY/wwSB2NWH0nUf7pD9HnIQJj/x5RgpTHX282\nGJ/F899az3GjVixgGftgksf/ZFSiu07x4DCZXh0GEOWjx2BWbqf9AE6ThaFd\ng3S/TD7XST2Od7j8/5YtxGcYr9gaL5QEhxvRbsbqxVGocwDyoh0ARZUHABkd\nuycJFQQvZIyAv3d2bqjydTDhWHRU+usFCvDQUkOr/kgpTKwmCsuMIsvJN1XY\nmqBDYOpCMZ8yypZvEhTtloqKcB27G3d0WeiCHP+75Qsdvu6cX5e0OIL+1AFi\n/SeQ1mcARt2F3SieOnjjNgLbo2QNgBAyV40Q21ZLZrszeFTXe4fd/wDMEs1Y\nA/xJEh6/oFevkjyyRx5WsnqJPMEXrlXVWgV2K6CrfFPImPYtHIXmoElltdzl\n5WVWOBQzWKVTGBoUYdTIGuntb7Nvo+AlWMxFpQgK0EOPMCq8LFSliCdFTUi5\ntHU+SzoGkvhWl0Ys1VQ4ecq7GnXtcZFQ2R1mA9q9ItxB6Ua+uTmhnXdz7KiF\n2d3MZM0ShPYTVHUFZBz5MwBDo/jptqPSipX0P1HhJisUh+xOn/sWM++TpWjC\n8gxK\r\n=3KnF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLUhVePzW3C2FNz6c1g05EQcO7InxyNa8J+syQy7jLCQIgezGaPyzQIt6vzL/ZHX58PF/FjNRu3HLUHSIxVKzBJBc="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-dev.17_1609242581132_0.6299934525192401"},"_hasShrinkwrap":false},"0.2.0-dev.18":{"name":"@fleur/froute","version":"0.2.0-dev.18","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.\nCan use with both Fleur / Redux (redux-thunk).\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (!user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouterContext } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouterContext(routes, {\n    preloadContext: store\n  })\n\n  router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouterContext, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouterContext(routes, {\n    preloadContext: store,\n  });\n\n  router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-dev.18","dist":{"shasum":"5247acf673f88eda51ce907a8744985cda7f3be5","integrity":"sha512-kVvfWARI8qjTallmq5U4k76BEbwWKYa8WxtckYWEH/muvK7F7ZClVFxfyAnX8gKmUC0gwurGRQUqPEBJAUsutA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-dev.18.tgz","fileCount":30,"unpackedSize":93252,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6xnvCRA9TVsSAnZWagAAkSYP/1w1As6DcN2+yKyYqJaU\nEcRCrWYlnA3K2oQSbNe+TcRnhmZ+vDtzTKUvoLpO0Em3ZRIB42BdjhktgcvS\nyM/3qi9v8Q8Vqqa+ZcmFFrUZ8EN4sG4eyB9RztBNwRvyX/zak8HCG5v56A5J\nSzaC5muiIoRof/bThnFZMToQXiEkMjoBlEhVEyikDHhXNOGy5lxIoUMTLuZg\nmagNL4Gcl/wbyXSEVJ4H8hqV/UKzX5s9fUp4gW3QfdZW5WccUKnTBYi3fyAg\nMI9A0KIFRE1SCt1e6r2LoXfJlVe+zbtUou82taNEURLlxNGgi2iPuZXG0dKA\nO+v7cop14UwXpP55qT7O1/uNrzyLWserUQitrn4CQWkQkJM9/xawILsA9GUZ\nmR5urOh7JDKWHd+ehZDcec0blUi7fbP8QvL0sU7lAzco6oQH2viv0FnGbxLH\nP0QpGLVZhw8U+viR9o9THrU2fe8CLAkwGspdZZa2FlhreBZiItNvIh/Go/JE\n+711yWSMyic7ktfEPMgMUXHxIYtV2uG8m/NkFNpppxKOQGj/hjGNTcvA71m8\nKDIUMiO1wB7YmJSS7HW8cbb0keOrRkeTMTLAm2xmd4qY/Q/5MQhVslOLZr4z\ngdOw++jkHstpGKeG5SjcdDhzwfVq8lTTRRnP4tUWy5SQo3QudU8bgiwV3Cl0\nUZ6C\r\n=1/DV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKDel4QfYHJsXqgei9Z6iw1S+rHkWV3644tE8XjqGs5QIhAORIZ983hp6WEMGdbbnoSjrXAJyjqLRCahcfm8F48Un4"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-dev.18_1609243119252_0.5946559068324662"},"_hasShrinkwrap":false},"0.2.0-dev.19":{"name":"@fleur/froute","version":"0.2.0-dev.19","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.\nCan use with both Fleur / Redux (redux-thunk).\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (!user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouterContext } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouterContext(routes, {\n    preloadContext: store\n  })\n\n  router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouterContext, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouterContext(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-dev.19","dist":{"shasum":"bbe6b6d06360d2dac2aa434820998afe1c82021c","integrity":"sha512-VOduoTWNqBX6H2+wOTOT7JXyEBXWwFlubuQ167R81Lo8XtUczxvuI8stbgB+vhRoARmjq/F2QhOeRv2IHnIgsg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-dev.19.tgz","fileCount":30,"unpackedSize":93910,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6yoKCRA9TVsSAnZWagAADgoP/iDwPaolAxZu5noodMwr\nH9lHiyg3yTEEHNBRmkG7u7TuUkYYxWaX8WMIoE5BEv4q0nfG2Y6lqPZ9MDhP\niUb6jNwxvbbDc0SQiy5qqhCEJY7X8Y5vWoXWiv53kJ015UMysrMNuvXQRE7j\nqD8+rGGJWxMeBjHAcWPXnZF7eOHbqgRCFonuiuVx+9SyaRonZG29KCj9c6ZT\nf4ksZmQ3IqwA2eZjjCAt4KaMkvxgZ6zfMeuFAMvvJfLOrbsQqrqpo4KE/84i\nZ2qpVP3W7OUPmwht3GPVGloOkCQG6dETgWk11PWVJBl6wMSEPxOGKvINjbDQ\n5lkE1DDPeeX52pWyN3UqZDsMw/HToAK9mFLse3p7k1hZrXUs0xiOkobIMr0z\nJzHI5MNMdRMolTIrx/dZxc+qA8KVeQe5Dbwr/NBvcKPVYRh8GlOjpkkMlsc7\njqyZi+oCdAM8P6uM2316aCFRvmAB7aRhvLyNyq4MAa628R0MAclttFTvoOLI\nrnmfCqFESbbf6FuaFDICkoVrsPKeAioF7+KgTyMvZOWEmt4+ru/sJjJU8P4x\nhdnh3F7ckONjzGTj3vkI1J6kROzjLmxLanRdfDydND0e7d6JJluRmh+NMfDH\ne0trVJuT8hmVx6QjtSQD3nYrAcXNC1mAinZiFxs8ZtzG3N+H52xRQqaEY04p\n3i+T\r\n=9XXs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoaZkXqRbwDlM+OgiIPbtCUe77GRJMWOdqn7XsaLoMhgIhAMD8mWol8NdWGctZo7TvctWxB1k9DdFhmePhmvjg8cP3"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-dev.19_1609247242118_0.6164944940114425"},"_hasShrinkwrap":false},"0.2.0-dev.20":{"name":"@fleur/froute","version":"0.2.0-dev.20","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-dev.20","dist":{"shasum":"c02cfd0d8e43d299ba582352e77cad85c24e6d4c","integrity":"sha512-rQi+uQ0/Y71818LoMWzu3YVNfj1sH785BqcoZN/rt964UBfjNlhWv5H5LxK6S7syxbMxtXYcMjZ85WJ53hACdw==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-dev.20.tgz","fileCount":30,"unpackedSize":94202,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf60wUCRA9TVsSAnZWagAA7iwQAIRSOmkOF1HQN010Za9c\nVhrxUhGgmA/B/IcA47K6E1H6DPkn82/nndEDQbuy+TgW/3Uw5Exl3MwALUPr\nNR5dFR8IsTJ3/dnoVcSjkF0TjzXHgEiUV50cZbblpzCRrDcCwuGUnJYP5ozs\nE94uIrD/e7fmz30Yb1wHyaIUECRAhPBzRwHA9xhyCabu3fD0y4bs66atEBhR\nMj/jolYpTqdMSO1kq6BgnxVYMN+pENKryzYDs/07QNNkkMhA05/CFpO0FTMb\nIYgLYcEt6nHnniqIPq6Qd7J93/zmvyTNmVIbAb2QVQIxNIoHYqCc8kdhUpgO\n2uwxtGA4hFI2Eo+/OWV8qIppH/Zrjix0uUHTlFeqXY81f8aAI5PtCJ8R1ssj\nmL6jDhYhHR8tR1tsgEgAnKnZ6WgDfj2lzw1yospOLsQt5rv+2BpgcZ7DfcyZ\nBN3U6rk9g9YtAFkwXg7PeB/d7Qsr+nBQXaZLXxujlAeOnXKUO8ZoMSt1kkGW\nZ2FgVw5gkcxYcRFudrK6yehs/Orn+LN3dSyFgyQKmd3APFh032MFCPAt/9kc\nsoP5gU0658+l8CYABViG6h1TFb8piiJ9e/IAwZox4Sn7m3c84Cl42p3L5wA1\nwilF1NpFGQwPUzT66XKhLTEAzyesosDDjByDU8MI67rgfnbAT5coAlBxHT99\nLSh/\r\n=s+9B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFgA4yXuu8yeK7e2aDPgOuSibNy5ueehFokqL0V6c0toAiBIQMbuL/H5arqROP8jdN18kJn8NMko76VkPFEYPGV92Q=="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-dev.20_1609255955521_0.743197803066207"},"_hasShrinkwrap":false},"0.2.0-dev.21":{"name":"@fleur/froute","version":"0.2.0-dev.21","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.\nCan use with both Fleur / Redux (redux-thunk).\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (!user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouterContext } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouterContext(routes, {\n    preloadContext: store\n  })\n\n  router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouterContext, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouterContext(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-dev.21","dist":{"shasum":"a873fa98c5e8fd863ed975dbf8893a17ac78b420","integrity":"sha512-3lPhUbAKf2PmEoMmFTbv5dJ8ObQ+YI7BdroR7deCcMXBda9kgxLLjTeO1OBHdelgSZs0uz1Dxkqfm42dCR7YPA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-dev.21.tgz","fileCount":30,"unpackedSize":94280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf61c7CRA9TVsSAnZWagAAV6kP/2qrfSj1S8ez2Xww8QDd\nsnV2/0NlX1JvAoDsx8AzpR7Ft/FLqs8ipgSixptKjpULn/eMx59+k63ljmdb\n0YWArj9M1SWzMstxlcXwhQwIU+xD431zUvpDyJnhyvvEYrZESWboxYK+yUUs\nkG0adCRbRpEiIC1pjy+p0kRTDtDOQDeLpc5XWU//lqLxhnWcCYH9XAFuroQ0\nkk93LGruMLkcj074YFwuMlO3aAGKQLXh7Yfy27tLT67YqZPwvSdji/Ii3PCP\nnzesQoHG8cxA8hgD5gLtVA5BA44lJpLBE9SyoUFMUVt+AjDXOofAwlF9SXjv\nNZauvJYrlaL1IqQGTExzLRipUEElqA239vjd0I//qz8WW8LjiC7U75OgoPiK\nPCCkJb9ifRgHVG4MEAaoRQWRcxOnYDeZqcB9oZK0Bwz7t0wJ1geUNmFQaA8c\n3r7ua33mgubApxhfezfTDoiiNBqV07oRjLQm4nSs6fEX1QuMPtz/Ra8LEy5p\n4hasQXRzMHDunA+TevMWPHYNlRIbQXAK+6xhWIvkP7vxmpbBUDOPKGK6LmMz\nYxhEkXe0wYpkH8lLWLMSY/WeLOO7CEhPhH6OGP84yUABm+cxMf6JLWZJqOiA\nvyByKgUn/xrhbak+ovrho9VBH/sKmkEcNipBCaYSDjuzgI4oAVHCW+6hDWOn\n+bO3\r\n=HFL0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEJnI698epi+6oxhAGYUb4pUm6K+GY/XlQ7vyah7lGlfAiEAgO/2yEUQrHrIG5uqpD46bBl0frfoCnaQPgJhE/FKFwQ="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-dev.21_1609258811317_0.5324457944305017"},"_hasShrinkwrap":false},"0.2.0-dev.22":{"name":"@fleur/froute","version":"0.2.0-dev.22","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.\nCan use with both Fleur / Redux (redux-thunk).\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (!user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouterContext } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouterContext(routes, {\n    preloadContext: store\n  })\n\n  router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouterContext, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouterContext(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-dev.22","dist":{"shasum":"4ecd92fb45d1d5530b1316bec4eeda74727f8ccb","integrity":"sha512-IDyXsaQvNwFZQKEA/YXWIhqGUwrqkjeUDj34dFu+xg3mHQFS5DmfvLHHeOQxh8hQiZsvgnpCuO1BiSIKhl7k5Q==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-dev.22.tgz","fileCount":30,"unpackedSize":94352,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf61m0CRA9TVsSAnZWagAA7WcP/2FhC2QTPNtiBsLaXg1S\niExDb4mCWPg7MvapH8AHTTdyZgOQNyBK1CWpQEh4siqWGMjcsHwBUQVUw3e5\nQidq7N4d4NNKv2RhGNQX+3QzCBTAWLINeEaM6Op0lS4vYw8ws68IaKxRBoJM\nr/PaKH+OpoE+ezfW1QWxY3gAsuaufa0CplseJ40tKIvi+lTQZwCabZrNH7GB\nbRKnKzo6gyRbBDP4gEwdwfIekVkY0i9BdZrNB3ji1npnc6Yk08hZniDCO689\niBwQ8iZfXMCj24CDppQdpVD1rHkYohPV7EAXIwn9jPsfje2+wkN/AO1iA5Yz\nFRyDhjxoCk30bNbADG4n3X3lEqu/aTbvNwazKxP+786ugIrtWzmSNl3YyhUM\n+bzdJm6s22oa3QsJASRvyhgN9Yp3VWu/z0ohXC6UdrO/FVx3hsPacJ67NGSn\nLTaBwjD+XDZw4o9vpO0+S8YDdmLGgN3+TjYh49Pr1LO3A5S34VadLmesaaiT\n1U+QcWvg6Y4ZFwjDjhMd2yMorybQKEmPJLojffveLMxpn4ICJzzLiW6wPS+N\nrL6PM3rLsN4MwKNhQxWqPOKoLJIi076uzUS4akPyTTySR/nI6oW+zvAnAMYI\neh2hV6UvQRlbIiQT5Pwg1ToCEqDARKubSF6pe48Sv3q18cU6garw8GxJrN8M\nup0G\r\n=qYvu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDS00E8JqmsefcSo/lYR3qwxQ43bNybE8cMs6jr6OOf+AIhAMtMEklq/MAdXOpglvjHWycrZRWKV+I/PYnsWwwT9GQE"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-dev.22_1609259444497_0.4588302723910398"},"_hasShrinkwrap":false},"0.2.0-dev.23":{"name":"@fleur/froute","version":"0.2.0-dev.23","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-dev.23","dist":{"shasum":"e2f2b442f35621f566bdb251bd9c93c8f6b4e4a1","integrity":"sha512-DM5DmB8F/ngLZLwIwewFvZz7tCNSbCbrLui5MIu7dK0rSzezWYVVy3o7m7tyy0NgorNXgMdd6q4gaKsiZwTfyw==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-dev.23.tgz","fileCount":30,"unpackedSize":94948,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf62WeCRA9TVsSAnZWagAAszQP/0fLA78c186dcxD5QbkQ\nsGblyh1Lc+Jj4wYxKydzEfLuskey6ejiHxS29AAts9vRKAJkZgbzGFr7NPBY\ns4w+hOtaXtnUkfmHNgzkhFbbJv1c7dgHV/oLotJI+GJWmgF0XUNv2WyUlzdc\nNvZ9wCZLif0DHRyyaexjcasiVuyK0kdEYPNDkNrx59YRuk5MFQmrq9qAZz9/\nJVrjeg895ohkzhHVMZ1hZ3iyNAiIvOXKNTIreX9ZuKglVX+MrrFRZ4YhZWd+\nZWeri0ZewkJ8h25v1Cz7mMDZzqGNI2Tge/bstkD36RDiwBxnViuVUJ7Bz1qE\nDh4+XiuZVUQ6+Odo1Ixc6nWv8pbQ2mPMvDMwWJCnzRs2ljYh2dFs4BlN145p\n/8oudxkZXPcfe6y1W+LwJJUIJ0uOOzO3jWFTX5G1N645OJE9vykDtKUKBRCd\nI76h8azXXlgpjIq4OOMbi8We2kpNgzwhIcbxOOYRahqlXajg4iPK2x8jOBj+\nhWFPPNtYN+ro3A1FD/R7WanpYuu71AgPjfqZNPhKqE385wIM1cuIbXeAFrie\nwJu1Vq2pWIr7tHCFBc3tIJ3/yYcwP6R13Z7GpQU7gdmuyI5FMkidP/7loBGU\nwgqW9dYgLpKb7ljsWbBzIxJgEfekLrX6dcc3iytZIXhrx7RfonNzdTBbQpLc\n/xZ6\r\n=a+GE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAaMhbVNKRSz2VZmN6zW+I3l0E+X5lYhaVgHNMi6VMxIAiAEnakCtRXE/3JwgmtYxaEIuEWqaeW3K6xtab5Dim1oXw=="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-dev.23_1609262494022_0.748128544374592"},"_hasShrinkwrap":false},"0.2.0-beta.1":{"name":"@fleur/froute","version":"0.2.0-beta.1","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-beta.1","dist":{"shasum":"d2a98b6b430724323a88b8ad66c57276d78100ea","integrity":"sha512-mnyxYFwmwamW7KjdingiPhWqv3zKP42QLyj++fz6uBw6bccJ88UYqv2QGDSdoyJnirPW1OKzRQTMpPtnLTLBPQ==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-beta.1.tgz","fileCount":31,"unpackedSize":65934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7MhECRA9TVsSAnZWagAAIKAP/R3pSVUyqGkbaYvTRH7C\n+6Ykbm0G/W0yKSQ4sO+Z4i9yC3EeDwGGHl+0c9nrHJkALYFrJTVGhXpVSQ6N\nu0me/a7FxdP6zWQYeQuj64tpcICW2oXJ16bmUxzAkg6d+3f1RW+LGHJ189nq\n0YKWzt4ZvsI7Soh0b7yRil0znP3+Zn1UQwAeFkFSyA6rgGFD5Wt2cRY20KTG\n/Bp6wTNKu9Y4IltpoOj/yBsynR467xHn5nIbMJA5cHuibcDflFLJA6Bbp/x2\nX5Wtgsk9no8n4lnPZcmIWKHOPgGQqUyFzj5lRzWExs8Ut7mh4ZfgXwjnCbrZ\nb+pQqbkgqfsmzh8SiEWPc8zh6VNZHs0gZcNg/R9V/sI6qXJSCEnuNiuP7jqn\nnODhus09gjtOFDO/OsDYpfthWr7noYvNftUApJqS6GeWLBtWazAyWBehuaW3\nzQ5uHwDHXdbRW5LBM6kF1FBxIGuR+nxDh5d3PeJL95+BVZxn265bP+3Qj3RK\nSo54xXHWeiZkIUrX/JoFQsE+HNX3DLJFvflzPzavbGIXJ82UFgEULTazMu+j\nfpQYO7CVq+/R2ryfxcc+lOSow4VzxTk7YpBwHLSAZhSBvtxEVt59pTrqWwGT\ni/JmdqOfzBmaWpIxdHeOm7xnJeGvZBr/P15KKGR6ZK5+V71gu02cf7RxNIbj\nANbG\r\n=hg0i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcAWf0DEPORoHCwPK2ufkutBKLhn4NWubgkn8SkW7NbAIhAIvOfPaX+Vo6K+ALn/fXy5dHwsZxsScJb904GkA3kSMc"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-beta.1_1609353284468_0.4102897326360406"},"_hasShrinkwrap":false},"0.2.0-beta.2":{"name":"@fleur/froute","version":"0.2.0-beta.2","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-beta.2","dist":{"shasum":"1cbc36b5f5344b9fa78133a6636f7e3888cf91e7","integrity":"sha512-6LGSuxAGkW22orY8hdL4St4KxVCE6Gd5xr/XXP1xtWMzjY2n2D7K96bRlsyHcosnzXnTA3Vd8ZLAEZ+ZDRNbJw==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-beta.2.tgz","fileCount":31,"unpackedSize":65752,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8fEECRA9TVsSAnZWagAAnTUP/0EmQoo6ARRiJ+7lhR5V\nvHqkV/NUmHPi1XktJ2KvELBIeoZSJVqqxcN1rkTCSmsYVWDP276GqvquOFZ3\n4+ilbFsmaFIYvXfgv3VTWAZmKlr8lrfcYNdJE0ZVkxlloxwDn6dL7MF+2lcQ\nZpSUJO3AiRDcRcmjZjTbRxy17xdBiLoMcLd1BywgUU/BaEZ/InbgV5mB52tN\nHHoOtueXnlXEX6OY7RJIaggiRA/llxkSLqHz81gi9K5V86Htpzg+xbit3Zvr\n1G+nW4Qhu2voc2n+H3LupThC7yUVoftBb9EnwrMT8zR+rZrDGFDPirE6qrOa\n4mJse9JK9DE68lCBO5eP84S6xCKCxOPxCO7bwIkhEeYPtlYyKFaWdb3c0d06\n1zWC80RDASMcdRWsmT/zpZIRoLLQifQRpp6Gz59aBoeNsutRUu+WdO5iuNoZ\n+lwSbhEIm84h4uQF03yUrHzUDdM0l3sEUvKBEJ0TN0LGYCInHuO4BOqu4FW/\nDmDNn/ITSaNq5/PY/XyFz7Me/P7J7gJ/h7eBK/jox6Tu72G4UXF4bn9GZBBk\nBhxMqcVd5u3PreKypsEEwuSqtegoHI1ORh8gOoz1bVNAKDYrAQQZsuBambOL\nN0fWEvBaTBtA06NJpI9wccioiCFhSvDz5bBlL+jAyzp49r3HLkj6KhtBnflV\n3mG5\r\n=avLf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNJhbhSpOGEin6YQC16pb1memnssintYiyjiye/ngUJAIgdK6qsSiFLrktzhLg45cF7TZ3IH06mVaRwpKTkiKV/AY="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-beta.2_1609691396267_0.8902560135135416"},"_hasShrinkwrap":false},"0.2.0-beta.3":{"name":"@fleur/froute","version":"0.2.0-beta.3","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-beta.3","dist":{"shasum":"46bb41016edd16cea659a5a41081ae506334bb1b","integrity":"sha512-DRF0IKpoDWCOlmpJSHntCafZ2xEW2RYFkU2k0nl9JHcn80Iw7PsBti2NMSQ3TLxpv3J8O2ORVjVKIYOh0xwy2A==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-beta.3.tgz","fileCount":31,"unpackedSize":65914,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8fLOCRA9TVsSAnZWagAAZfYP/0aLuRaGSjieyfwLHHKd\nhoVFMKbnOMPviqEdChzlpxA83umdW3MtJX9Fhdm7X/qOZ6Qr1SQx9EhP1e6U\ntUKzAyb06lzVmyPFtgwsz6tRtLTDyHLb/BxqiTus4XKT9aCXBXlSZBYZgtpC\nmoSQA4bw2yosxD9AisjrDg22dYhVTw1wdHsMnsc/3ylzX4+gPiKQ7ubZxkE/\ng1Ivk3C5PcUaGICle5oUKQC9WKYyBBDeBD7TM/6gyZKgUGP3Z5202gPZxc7Z\nHOgQziqp81GOukb273w4cB0BBVf+sbNxCNpng13rEQqvQ6VwbCT42JgyUYgJ\nABTQN9ZMpM5b4A8VZsEF1+x1ofAkR4uzJZS5DW7959wRU8IBajJnOJT790Rd\nn6l6/VRcztsTGy/MMdjdlijKWEPi788HcmErOejUG7FaZqfEJR0uRaaXkgmJ\nx9SZnwhBS/YEjQWnscJOH+Oxc2nEqMLLOF6wokYIGYIcUgkLTRSzsJYaRY/2\nzLQ5Az32u4nq62Cb6L+XhEUwYcVTtf4VjozKeCNN89j3EP1v01tv+ySU3/Lx\n9QOAylg3PaK6XZZzqCbQrokvson0W26nog7PE6x2qqsad7ucfPBU1aSTaSZT\nAdHOFgppImMyKz1ehg7l2uov71xnQ1kmfXDVkernx0URTMcFoXlP3TKFMXLG\n1PS5\r\n=3EaZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHhejwNHYwuU1kVMe8FQg/SKUstusGx5bdb6ZML6JzLAIhAJlAlGWKqugZJV/4IHe6TgvZAx14GN3HiffMQlmDUUoI"}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-beta.3_1609691854413_0.15815290131385762"},"_hasShrinkwrap":false},"0.2.0-beta.4":{"name":"@fleur/froute","version":"0.2.0-beta.4","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-beta.4","dist":{"shasum":"39be9d61c6ced6c3076a727e662004cb54586a73","integrity":"sha512-lZ/FG3pJMGalPQSsOm/0qJEEhNVmZ1GAdXhpDfOXfvsqjNPsL70y2UoUHzrP/Y599n9X4hf2j+VziIQ2w4B1sw==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-beta.4.tgz","fileCount":31,"unpackedSize":66100,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8fbKCRA9TVsSAnZWagAAxWAQAJbpyn/i2NnyB394eW5p\nuqAxlQBYj+vBXPHGvRnf41iFJyRBc3J/YzCVQANr/uLFy8sALjdZG4GGpATJ\nJvQChnksY05s8SFNFWCdu+zdETK8+ifTawPMkXLj9Tl8Ctk+anD494RzdLhq\ngRUF14ek8tpK+QEyiPrzgLFaT05w/8pnTzePtVMOUbWI6ial7IGOFssCnhWE\nd7HRy2ZYRy0KNJnIHv8Xv+2CJDuSpuk5wIkiF9LiJEePzMT2YZbOKdBs6UJS\naXw0kYCOnm9tYPLvAflklJZmWeWrxrN0Yxcac7srU1JudDq/C6vuoeSZvPD/\n4+xGqdJH3thtSb+iDwWVMJsXh/0+P1m9WrRmHwI2xSpFpu1bIbXoQdVhA3IK\nBRF+bCym7zM11Jszwtyudq/dJ3DlvzYFYvVbXgC3CG+xIL7KVyy0hfKYVA9X\nml7WcgGPGxWcwdu+lrNOq7FGLcIbxgzJcd3IMOn/Vlzd+5Cie6g4SXi06YN3\nxmpMVxV6y/lDpb54C0Om6fUiD2veURxQFXsMeygjZfjyStFMLUD/VoLvMMuh\nK/Gda8iGM412lcgsTAP4+SpXM4no3gZvk+fr8tWEpkYZxTO2bJSBjhMykRL7\neyEsZMA0UT5whYmpTSmEZo2p86+vJI+ASmQ4QRN6JJm7sDOREKs9CxLLFWWM\nGU4w\r\n=yeQ/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkKk0bKmgcWDI4iLyQ0kKbkKnEGAdaAg7aTt9VpzV7dwIhALx8zm0+yNPGOBB6rgD9yj9HIDCX5vfxfKFDdYxx3nQh"}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-beta.4_1609692873960_0.33386322910994415"},"_hasShrinkwrap":false},"0.2.0-beta.5":{"name":"@fleur/froute","version":"0.2.0-beta.5","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-beta.5","dist":{"shasum":"35d4ae488d6386a027d87d5e667509a72f8bcdc7","integrity":"sha512-A9+4WYbzGB3CHpJ5Xx5HuslkVcSVg9XGIH4GtnI7QlkrDZ7cbjZx9rJeq6E4J5rM6lOvT00NIgx9V/Xud/+leg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-beta.5.tgz","fileCount":31,"unpackedSize":65586,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8gRJCRA9TVsSAnZWagAAUNsQAIBHZkuy6P5GKo4x8tY7\nX2xEaiecymSMFQKiNMicXdAmknFtJ4BZlCV2c7JygrMbSCMmviAZ1fGInXvs\n9BVGyRxxiAj7y9SqO6hLD+K5mMZ29WJKmj4DFRUnsVUaRoTNGMiCxJFmozOq\na37glEV7LNZ4jwA3jtx1uClaRUYXbK50A71rEI8KKpZQNlVX3wIRGkEwT69X\nEV0Zetg3504AeKpjpbxPhGltEnzrVyu/TKaZYiNhPRQtTHd18A1k6OpNsnyp\nM4/hoK09bMqHrH5iV62x8rLfvqbYkuQcMsQhvK4oNZdpu0yGxG2U3Whl2fl2\nesVM3IZyW4PVwUjYtsjbPf53oUY6FF1eQHxIut9uMM6Yifg34BghmBzwaNd5\nbCz7hpXG1uyOfjLAMQqGHfvAwNdVeKrEDtP41VSjmT6lpt0Wpn5kwC9wiAut\nhh9omvOI1uphlTF2viBXL/lyBa7IlRSGSP9ASIZeHisDA+2XQbKtCe5YICS9\noFUGbCZxjQ6MsyBeh0KH5W+q0wEtzp6AFPqs7C51TrKGqzuNumK3Ty608BuC\nHrNLWzPI2tC9CGn0G098+pmkrL2Bty2IpJFP1XtWQzEB6EokNlNQ8pnamUxI\n+Mx+cTosn+xcGMTTBsiLlUUvMMK/BAiCGucaHDDlhdxiyC+YK6O6J4amAiza\nm8b1\r\n=00oZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLTN/Ig1DXhZhlcEwAf1jI6EaKrLX6Qmfig4kjzhQSJgIgHHC3/9ykWLHjWUnDjmhwKkHTZFQUTATFn0TIQzbnJlA="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-beta.5_1609696328586_0.4859212244450424"},"_hasShrinkwrap":false},"0.2.0-beta.6":{"name":"@fleur/froute","version":"0.2.0-beta.6","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-beta.6","dist":{"shasum":"07a4a2fd3798fd53f8a4536d43558b49cfefa637","integrity":"sha512-Pcwc5eP+ORPLrGGo8MlO2MJGfwJJTIQcqZKu/MV7wYRPkVkfcmQLp3jL4cuMjX4OlnMw8+W4Zczsmy1ECmZf/w==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-beta.6.tgz","fileCount":31,"unpackedSize":65720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8gZoCRA9TVsSAnZWagAAjrcP/1mTKEJ1qW/CUurcOmys\nDwC0eaF2wkJqkpt0Ff9w3jCCxgAi6hk8mx211+iN5ijmoaH/jNT5WG/HWU6w\nqLR5jofMSDBK0P66W8sVmk5v17pF4XO2e3huIBvl6fPK/kZJ3m39bTd72Z0h\nbRBsERb27pPruS62Od/R6CsbWCLyFMPNawu1G5FvR49RCO6lfQnQRSgwSv7J\nVYyhWBq9pOyuHQKBwFwNDMp5emXIWrY4/v7tTsYXTsRSZPDdFYsGLVPporFG\n1mhR+zfCeXWOYOk/YjoPkEdNUVFoFRZ5BAwjZJmLnjZ4kcoErnTUfMo5ATUu\nk1edfT1wZ1XLHlKY/I6tJpj9Wpw9oLxATPxCGQvD6lvi4UK8RbrQrPe5sr8x\ntrvQNTbdjGsx3ubOYctYeTyly/9wC8rC3Y6x1nmPnKAo4qxLPdf0PeTbjqDk\nHX8TcmRdwiniPUJPfDwrT5PcbjXaH3MQx8tmdaAryZJEIDd/7TT+4OWDbu2c\nGztIlQxMZjBaQuryH5/TgIBBEwfYXubkA61+4ieWaJY2FNmoiLrwEg+L+Al+\nHIjcPcOybQn3ItBdrZP8AKmr8uNJ/WvHCmeiPXPeGOFvOFA/GI9+2gFUO6XV\nZ1Bp1niKniOlgfMnp8amEGDeE7qPiDLef5F/WDgy9ZTHnlckp42a1TvQMJ6f\n4jQx\r\n=U63a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcmqHXorGHr0HFkLJhMOR0sx0q3RGqSfxMI99y3sWEzAIgG8C5yRybPITQcv6+4Kh5/sxkoYtOjh/z3fr/oB5a7Co="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-beta.6_1609696871947_0.5125515147501014"},"_hasShrinkwrap":false},"0.2.0-beta.7":{"name":"@fleur/froute","version":"0.2.0-beta.7","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-beta.7","dist":{"shasum":"dba83901abbe556b5288af7b84974f686e198cef","integrity":"sha512-yP31NNVaWFVxx4RTKcnz9jFizc3HKEJHSigNmNOpggKnukSPyZ+zH3BV38DaOqcpyKURqkC2EFIX11SJfKMARA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-beta.7.tgz","fileCount":31,"unpackedSize":65798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8rXCCRA9TVsSAnZWagAAb4sP/jF2fonJL91tmQUiq7zI\nNLc4DVQ0RKay0cZim2p2wLkd76Vxa8/11lolrSiVd3Vwp77ffs8Cwv7G+aqa\nk9Pyx+g3FQulwt/byv9VByVa6GGRxEzQ9H1tjSECFsvYpmB1Z6115emvESpR\nDlGEvEWBul4HlrPIbPqPXwVQpPfiSKq3p2DaQaWKumyHPIcoIuFONZdcidqn\nCsw6oSUsCCCaKE7isJBCkfU/GsgbtDp+QfZUE5MkBzKLqLjqZ9APk3y8wsXL\n68wBDDIrnmkFQJ0fok1uxNhrbc8msFe7HiCraG7Z96i1b4uFYWBe1gy7qowQ\nqZiDBDnN/0l2TuHlJxkXV3ucm6vbzEYabJCBdAWcK6IpDUsU9J3c2jDUuWSB\nXtxJUntyYsybeerU2oS4yp0yGCXER1t55czXdO+ACIMKJtpbMHHQPLPvBx1+\nZtLtzrg5FjzuU9OCVszT8vGarpFu9wRdnwPGdZIM3t+s0mLq8zRUVg0mN//o\n3MDK2ulby/yN7cfS80d/KOOzyvTIs+s9pnqNbogTp0N5BeARZdHQKUZ3CS4i\n2nFA1NhquCYKKmlmcin5Q80C1l2outlQdAOtPlUFKUFKlUDNDs8/inWfmXzV\nm1gchVWpdMLoraOSAnzcKM9FCWYFB7emImhIBnHfxGXFOrQVmxl2nDa8RJ1S\n39RS\r\n=BXJR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICGhTRdSkpXzKeWM5RofURmpHyEAL4Y1VrjCY0pcblkcAiBzpEqxxkmEoNcn7XXSo06EJFx/HNbW0mMtUKLt/mRNIQ=="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-beta.7_1609741761438_0.276183870496882"},"_hasShrinkwrap":false},"0.2.0-beta.8":{"name":"@fleur/froute","version":"0.2.0-beta.8","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-beta.8","dist":{"shasum":"c2d4d26f4cb921e8347e6f581d850680a603425b","integrity":"sha512-1jY4BEdKP/7F11F1RcQi6lqnohEQAVjV9JtBk44/Mj5NZToyM/nN5NWlZyaC/ectIFZTP7KHebhr1dViOYrzqQ==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-beta.8.tgz","fileCount":31,"unpackedSize":67111,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8rsqCRA9TVsSAnZWagAAz4oP/iTRC/BtbY0G7VN9pdlk\nhlcTND/spyKo+7OHBCHeSX0GlYolh2To9gTCjcSWXZkaxAIRNOO/MzyBC49A\nkFED0VFTe01RQnM7k/DmEUKPtivQnf+r3xvSWRaL2h1JvpXNtdh98ofch0ct\nSIZIw2U8IGUqwTtFCxJpyt2tQwzvXCz1Txqj/HM0w5DJRzo9n7ysq49YYNXE\nFU82670HYA/3H1rYTYhMzA8/m/eHRWpVFPiJUstr2c0AGvBTd5SP1q6G0lo9\nUalroV9fbeHriur24T+A/PyfoA0c1fdQtDkhCl4mJqxXXzA8EXjl3PPTcsfw\n1DGvIuXUwHeXQZhrwtxXJ1XaELsMkttLUa4UFasEXTk3tOFcCiN8e+2EVh68\nOuXpXHFjRRXzEC1aW32tyVITg1MqcmFONo/C5SoED63D3BD83ccASycTDAaG\nXVaH2nnuVcbxtCkk7hCuyT9aBveXUo4rNTTZ2sMzSiAny9MiVVH0PEK3Kqms\ntKpNVhuAyR3LLPMKDk3n0Oog4HVfzpskB9wRtVQzSZb2Wf2T8IhA9/jDfUTA\n6sGPM9OSzrlksUfZlLBJQhBS4fvYBoNYUFjc524Mq9GHU8V9H2lTQ2/emH2X\nwBattHKKuDcBLpBJE8FQkidlQsLr3HnEnyynkjVk9T+G45L+GZ0pWId+qY1G\ngfHZ\r\n=3u5o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDF+Xy8lDosqRq9gC1teyVTzx3KOskqGfu4N1K2UZ7S4AIhAK/A8e3wteW2AzluVo/ve2HtXcBWS4JhAf2YH4f1nq8B"}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-beta.8_1609743145862_0.7617898640415326"},"_hasShrinkwrap":false},"0.2.0-beta.9":{"name":"@fleur/froute","version":"0.2.0-beta.9","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-beta.9","dist":{"shasum":"0bc7ce8a060e3b79fe809aa257a57ff5e2dcdc1d","integrity":"sha512-WyKhaQnXOx6Yl0xHb6dulQ7vXlu1iS2PqRVZV3cTte1FyjiFcyR58UDe479riuKqEWX+z3l/JbA7EyoBzHHvbw==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-beta.9.tgz","fileCount":31,"unpackedSize":67111,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8++9CRA9TVsSAnZWagAAzKsP/jQrLh3CLLJmwZKLlGsU\nkLGNA89IY8z0Joi4EHcYwxv5jk1YNG89dw3CO//ShlfG3eVc+8AwBwmx2ZKf\nOf4phy3F8be5+yV2QGXjmgywWSlVxnp3zyjqtst1Lqpn2TVW7tg6l4llKWIY\nv3GU37xNnO5Vegsv1p1BTz0TFkN3yUNP4tN1KkKdMUpuGFNvAYSn3aFFd4Pi\n+6a9JCYdnnc33OWhVk1oUed2lOLC0pn7TjfVnCvG1O0fmY17Kn+9Vp/QYfG7\ndDwDUypTqBfhQ5hctic7bZVL0bLhX8ngjzpjlfne1XQp2nGbAXUZMMaY9lpf\ng9/2RKmkQUQAyUpzrNVsVN8UUO4kX807podiwe9kbOxtpVwcpnfe6kMrzek9\ntw2EpqI9OuG6BFp/xnsOMzUqHcCpxhDqvrJid1E5Kipg8rq+Bc98kROwVH7d\no4tqN7jGT7F9FHII2EP9xL56qhsCCkF4FOTZw7ltSbVcNv6aBUyvVlhV+gUo\nbHIux9d5UuhgaWmsGN1td3jN9wUmp6INY4YQ9AhXvBkcTHG5chjp763sA7bB\ndY8QXA8VK8ac+sW6dUWR1eTGWFDazQiFCyBU8k+IRxyCP+AYed9M8gjZqWDl\nbTkw7Qqwz/76AMYBGqfNrdQ+c8AoyNVdJWmL8wXq680MnfHOn941t87wdqvp\nX1yK\r\n=c+b5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFnc47kyPE42pVgr5rA4bETS1N25rSMoNapD52d2jA04AiB+dSrRlFDTx8d9iQJuW1s51Oor+VG9RhZzB0ob4cWEdw=="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-beta.9_1609822140781_0.7433452473775726"},"_hasShrinkwrap":false},"0.2.0-beta.10":{"name":"@fleur/froute","version":"0.2.0-beta.10","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:fleur-js/froute.git"},"author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-beta.10","dist":{"shasum":"d514f123c25a2180f487d0ae876b9360e3be27ea","integrity":"sha512-u6sgKHHKBoWNcwBs7quzMkIIz1Tel3eZ//cBCdQNQqjFSc+IftUG1VjbwO8tLN1FrCuxLiDXmFdpL/jK+TR/OA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-beta.10.tgz","fileCount":31,"unpackedSize":67283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9C80CRA9TVsSAnZWagAArIIP/0LS/BfiVbDYGet4Z91J\nm6J4RycQIl2mpBJcKinVIWGck0TXSzpdEc0+yge0B+pc/Akww68yrueQzDYV\nPkGszRvHO2ttvrQvayEl7wDruIYH9oAooz1dExs1Dc2SA2W1HjpTVk7iwZMm\nd97vBAtdXjMNEAvg3z9XKUjr8PG9Ib1tmeYp0pcKejiVyMI5C0UtfVM/2IBC\nG22UondiWM/GIQfg9TvIqVjnt8kFKpW/OKVzXEUV00a+ubOWdDjmyAz7vYUJ\nWSjFhXrt9G7AD5MCddmNxtqm8f23H0VUAZ+4n/IuA0FKN6kDngT08gAdCoZ1\n3uw9OIUW7nv8YF1Ttt3sw3rhw4aTvwYe9l+9r9yysaheE0T9L+Ezhn3gKSYd\nTpwNz4gn5eDBv4Bl6Voi2NQ72TRTv0UiUm0CVf7DdiQnPzb8BK6uQ6qsH7kT\nbij2zyi07cI3CjnDNOCMmjeYJXJHs65ELRjPPud4EBxQHnUttByMj7EamHAs\npVtt9RTXHF9GngyASDBSqkg0/OlCYJ8fgZj5cuXJTsMjXO8elBEl2WAEwEOR\nfy30ZyXFdWdYqB5jORxns+uGo44fl3ltrSv5grQ1ZPsfTqycHfygpgR3K0jM\n14wcBALWc/arAUGm7CRSZ88nI8VWx0uJcIbj1kZ2Yy72Rp0PoiUJwAj4m5IT\n1dJ8\r\n=rcin\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGsjM7wlPpGnC5D3Z/1B6t6SRRjrBbEw215Jey+bdr1KAiEA1hmKHaI/G6ABtzME5LFANBzMFRqvSsdGGAorHyrmTfI="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-beta.10_1609838387761_0.8993667008261459"},"_hasShrinkwrap":false},"0.2.0-beta.11":{"name":"@fleur/froute","version":"0.2.0-beta.11","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute","author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe in Next.js\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## API Overview\n\n### Hooks\n\n- `useRouteComponent`\n- `useLocation`\n- `useNavigation`\n- `useParams`\n- `useUrlBuilder`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- `useRouter` - **Next.js subset compat hooks**\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  // Use typeof to circular dependency free\n  const { userId } = useParams<typeof routes.user>()\n  const { urlBuilder } = useUrlBuilder()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={urlBuilder(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-beta.11","dist":{"shasum":"b6f83789caec222fcdfc047026b6da3e84fbe725","integrity":"sha512-HFjkhx3smqkmV5ol2rgUZznIm+G9MCF4GWJzKCM6Zhi9aTegGoKZWSMKHTBb5nTb/AVFJuA5K0so+hsgq6irOg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-beta.11.tgz","fileCount":32,"unpackedSize":70342,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/yWKCRA9TVsSAnZWagAA0nwQAImIb0JxD8hhys7moWEn\n3p9J9ipPJNzukWGcorjhwtHFzJzJarAw3XOmuHgHUq1CiN8WTDr7XsZ3fZV+\naFnu/bgCSbHAII7ehuiMyaptZtug23SJNp5HhJlKFXgx5cTBbzUC9WIDfwIt\nBO04EDmqrY/Gw3ecXqz1u9wo3buTgPemi09f7EQbrg7RizkGD0Tradt6jCFQ\nkGMbKiiC9/5VsLUBYgLTS94mhbaQvgMfOP8FOeamlsost7KFXjkcTeywtMf7\neWJ09/92b05+ibfpVbLZ158h+LStVakig54QCR8lH/sUwACWuxSII2ZkJ8je\nbs7nPVIeE4p3tyZZrakOTXn9CR0KN11nqNxmz/udYql1tnzYBx6c2fpr6gw8\nrBqv2LUnAXNMOgsGRtM16U3tRgi9jW9mlvYU442JF6bHKtQUCWLnRnWoAfg1\n8xPK1hR/v5DupXua3nTYZazwbwsLHcSIlmPcs9ze31uxFRZIuqZqK1crgK5f\nsppYNFYuHWediKgboEBsvjXZjkrHjai2U15WQfdDyVIrAAZRF//kEiq731QG\n1s8LdiuOlRdFlKsoKVtbYS3EtBPO+ZMEwuYeF7Wih6cZNWyoHmgqSHcbazdo\n0BArgMHUpU3Fao4X80WEuGpQ/k2u+vyjeb2XbDwJ4b+aS0jPouTMW9RYI3jX\n77YX\r\n=qIZK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBmj/HSRuDOQfmaIvBNPVhN7oQgEc5hZobJytINC5mlTAiA6hNXvZEFidY8dG1bE8n5JEdIFCkjZ/madLkr1amgYkQ=="}]},"_npmUser":{"name":"ragg","email":"ragg.devpr@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-beta.11_1610556810336_0.22810383414515734"},"_hasShrinkwrap":false},"0.2.0-beta.12":{"name":"@fleur/froute","version":"0.2.0-beta.12","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute","author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useParams`　\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- The following hooks are deprecated. These features are available from `useFrouteRouter`.\n  - `useLocation`\n  - `useNavigation`\n  - `useUrlBuilder`\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `pathname`, `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n  - But it's not type safe in Next.js\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - All `router.events` not supported currently\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Component\nimport { useRouter } from './useRouter'\n\nconst Users = () => {\n  const router = useRouter<typeof routes.users>()\n  router.query.id // It infering to `string`.\n}\n```\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { buildPath, query: { userId } } = useFrouteRouter(routes.user)\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@0.2.0-beta.12","dist":{"shasum":"13eeaac74cc793b143bc3c7815c82f18fc8f215f","integrity":"sha512-RkjEG+sn8tmOEZbjPpyviER6JpApqvvafxVbVs3D+4cyZI7EI52FwTXVhPwr0i2J4sGiiLw7hcDQq7rNBb6wRQ==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-0.2.0-beta.12.tgz","fileCount":35,"unpackedSize":72524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAmR1CRA9TVsSAnZWagAA6TEP/3AUT4GiWwvbF72nvXrf\nz1Rgnm73R7tko3vbRQv6IlMuT5GPpfzLYPzhA815SPt/NS8FPM6I9Wm6RD66\nH64u3UbwQRGbrmLtgvZjtu80tOIeAkUYgTh7NAie5qH9Gcdvpt0tac9R5+B1\nFOKBQbbyZNpVJ0bRCSH7ivEPCH/unyFneo10Sc0U/QB0ghC27gg/RL9m6fW1\nelcUCHl/CtKghrJTseMkA6XGLKGAMn8pEwbSN1qYyBdy7RhBf816sZcBUQb+\nSqBwE6kQPdyffFd264pvErtjYyRd8j34e7VOX+iCgcWyLGYh5XSCAKU+QQSB\ne0itPwlOFf+jD8XCsSrJjWHem3SdIPcXDMSsWmmNAZt/wMdYJuZ5B2HyDt0a\nu5B+yDkXZ459i4p8S8DsAhOsc+8egpq57dUZ6FUKIj6If40k1/2o1SyqrgLv\nASsMncOH+HiZhuQnZDAevXox0WNF7GbTKfjfR6A3dGk4Xx2zLVi3YUpDlRAq\neRZuLH0SHK2ZzcA+2RNZMfyg3FT7SlLgWHMBdrmnh+hXm6lfAB0nCtgxzFox\nPv4PzSxAOc0BlY5GhIXoneK3RaxusBKpYhPJZBLcQu3Jl2M8fgfg4zH1IeGc\nIDx43Fvah3imZUUuhITWLtP5QoWWFiTAuMFoSkw51Nn5AMJ5zNrxhga76INC\n3FpJ\r\n=1jwV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGGHWWU4SGkaZdzoyTPa8Lx3er9g5W9SkDy7SK+7Lay8AiAnr+uLuoQuwNoYpFdO5tJk218r9i3NeB7XTjjZJuWTTQ=="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_0.2.0-beta.12_1610769524513_0.9903924236459964"},"_hasShrinkwrap":false},"1.0.0-dev.1":{"name":"@fleur/froute","version":"1.0.0-dev.1","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute","author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useParams`　\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n- The following hooks are deprecated. These features are available from `useFrouteRouter`.\n  - `useLocation`\n  - `useNavigation`\n  - `useUrlBuilder`\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { buildPath, query: { userId } } = useFrouteRouter(routes.user)\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","readmeFilename":"README.md","gitHead":"e872e46204083c1eff72d4ecf4ce992fc5e18147","_id":"@fleur/froute@1.0.0-dev.1","_nodeVersion":"15.6.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-WJXxLzmyfJk0/3iqfpaC2VSUHBP4QgJ47HvBA593Cia107dy7/RgHoDfikXFm1d2iLmK3ybPptoUHBew9zid0g==","shasum":"bf99f446cec6116d2dc742f31c600d2a9c55db2d","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-dev.1.tgz","fileCount":27,"unpackedSize":72425,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBCb5CRA9TVsSAnZWagAAMPwP/i18dSoI0mnw7yYlijs1\n+a3PvE36uqGGfNcBxiApD+KMT57qqKCT6+u0LS88vBulFobajIBQWTGeJCWA\nLbsYhSX+PmLXie5OclqCavCeuIUZbGdSmHEWFlQCHvyYSKEbj5gp4BdrXsaI\nwh5iVGtbH6nqXFisGQTLDIiM2lhWnq6CDfqJshom0HHbvsv98rFlF5CZJEey\n96NWzmWxcDTX8QZ7RCw37F+EVSIXcq7Kcez7EFEUTslSH+aQY88TjNTj/J8P\nX/Sb+yOL5AQvoERA1Y6MQTypTDBW3+xc0lKG39PuPvr2EO7N4MrYHRQdka6i\ncJY4q0i4MzK6Mi1DZorOWXaZaqMkBKD+AePUzEZ1DwKvRR6qrWifQy0Krl9+\nkiOcU3kkf/kPI43IaiuZ1NkOP+HKi8BHyt+iA92hKGp6+YBs4ytIsk3xnVYL\nljayLWnNMYrwB5Ss37xUE9YziRWHbwKlWODHt38yzQd0NR/HMuSV5liQnGfF\nO+DDrq1LQWA0EgeUw7XuRcRjX/u7uHaerH8wj8my/cgq/01xVP6Ij7Bhe9b/\nKQC2gQ0ES/8TVIJfTHz8DRcON/VprDCW7v63431vo+SsY0OyudL//VXbWfjv\neeFrElLvyt3isIMAnLXpsdOLhQAwAuvqHVQft33SYrmNoXH3ebznOYCAynVG\nqcFN\r\n=jvKD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfJNFflMiVwEJ+rsh5o2P00qMFkteQ4g9OhBC9DwfFwQIgLq2voNpSzSva5tUmrW7RCoIiyLZ7x4+RffcL2uNsPhM="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-dev.1_1610884856578_0.19348174083475733"},"_hasShrinkwrap":false},"1.0.0-dev.2":{"name":"@fleur/froute","version":"1.0.0-dev.2","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute","author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { buildPath, query: { userId } } = useFrouteRouter(routes.user)\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","readmeFilename":"README.md","gitHead":"c234d8141006ae8e64e03486bc150969a0ab7186","_id":"@fleur/froute@1.0.0-dev.2","_nodeVersion":"15.6.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-Llp17tdWcLqLfBOd1fmIsg5IRDFI/9SFuT0UbK0U1Hy+wMBPxCkBD36n63f6AEdFiaKxiNCWZfXLv48+MYsGJg==","shasum":"059203704e81aaac75213ac6e4ba8f5419615100","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-dev.2.tgz","fileCount":27,"unpackedSize":74709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBEr7CRA9TVsSAnZWagAA8nQP/RNb8Pds/Qpnfjl/3uw3\nqpFgDCwyE3cTuKqRiZwUytRqK3FRzlwsXFO0uYCRUpYpz/eFJ35Pn6Tx4iv4\n+uvYfRE5SMuLjFsqmG/V6cLki5Cm6w8vIMboLGmQmETbWRt3a+VzgNc2ndzN\niXWAFK52MmRmJ19VtpgQCQConCtluapHP8r/4ni3HSJZ6uj8M4WllR7FilgE\n3EZ2ZcFABq8WxK+Hk0/GD5HjobKAyW/+/Y/dG9FSlO0WbnrV47ajtTX6fxzm\nZIeSUFDK31EfA0xhhxTPp9YYT6pAtvWapRxl/asN8WS2c3SbYUB1uyofnzVs\nIUSKDSFLttPCeB/GS9xlfz14slhgZOaVIiIKBoLSz5G4nkAP6hPFWihq3jWC\ndIwEfrZNMLRMm+4HNsneckJU3raHtQgKHDwupXW5kg5zzSghoS5ippRv0rDx\nngeA0tSL20OY8MqtpVymlbPiAywpKZemviZxLH+DA6oS9Le7ybovkDnZoG/W\nTLkk5XDqixEq7IMOjS3EiEhyCTLVQ6hUc4nyEDVMiDq47RkQXoaPzWmNVeqQ\n2gF4zF9r5Ixlr08LFeomj4ZhXTZOdrfdLx/RJ/eVSQlmQO3k84qVlRzMPx4A\nvf7GTs8b+IZEbBF5n7fKDf0aheeme+CwZIQ8KhjhOJJA0AjDiYCamAjfjUe9\ntXia\r\n=H/I8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDL+22wjBv0kz4g4GBgHzuwJJXLs7+mFVYRENR6CfeSRQIgO/5dsmIwJN9np0jn31wE+/Uo79vUrhyZ0hpCdUOBngY="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-dev.2_1610894075491_0.9463370938479625"},"_hasShrinkwrap":false},"1.0.0-dev.3":{"name":"@fleur/froute","version":"1.0.0-dev.3","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute","author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { buildPath, query: { userId } } = useFrouteRouter(routes.user)\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","readmeFilename":"README.md","gitHead":"3370deaa65a00cc9974340ff3ce898ac19700c96","_id":"@fleur/froute@1.0.0-dev.3","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Hg4Kyy4rKrJr4RWVN1A7u/nN3GJji4u5NdWl2IHwHeps1Urh51VFd4ya/LqEPPXieS37j+SrTd5Xz7QFPXfCWQ==","shasum":"9826060399d80ccb9c2137c62749ed8962e45aa9","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-dev.3.tgz","fileCount":27,"unpackedSize":76218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBGp/CRA9TVsSAnZWagAACqQQAKJRFqrGTi7C/SibgIJM\nu3EOB1OYFjdercV+kmwNuj4+4mA6TikpaSsm/34RgzYpUky6xxawDmS5sPAO\nFy6ymMXXnF1QMs3KnmS8CbKUvLHELIT0iyDzmeGjQOjxUNq0vQOQ4pncJIdN\nH5wm98dIfZLqG+QQTo1X/4IQDBj0HXZivNdRQRcz1ljBLCcOjQz+4LzeyI+K\n8xLy/7Mi2ejQgWfZxXRrxznEglN54ZBOdWPUnHrjRDCEAP336xCtoYi81ttu\ndLO77BmfHT184NCC0lPykRtX/xmXBF1SvZAO3NkxqFH0shrkVnkJvdira5dp\n6ixY8Mve6NmElHdowKGGHFoUPJN8HdXfQqON08n/6mnvzz2LiFMKm5l4nviU\n2YEv/UHQB7usKBoEttOVTys2zAB+cqbhcb3yWWidmVr7+8LqT6IiYKpeh0FN\nU+ELXzp4MxmqVtvgjsFfs/ZFBaIATJAUmsPGhcEZxGHPBYco0Sr1KdL81xgE\nyjcYpXLxd+fQaTtXi3MlllDIEg0ZigiSMdtNcwJru8xZqTE6WnKlzPWb3ZsI\ns601OL6nN+jsB2PmSbFcu0M31vb8S80IiWG6JuA5rY2lmqo2Uqfy6kMEg2LX\n7tVHEHIzq9AP6Vf4FCj0EnRD+dLkj6DKST7H7n8x1ycJdhQJSkgJTtqjmoye\nYUrq\r\n=gVGn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDktnWOHqHZ1Y48oG7P+AeRFRkr1MWcKF9VczGb1Pa/AIgdEjfMCsNLNT5oozCVPfQBONEsWmnBH6+eIXw0d6XvXE="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-dev.3_1610902142862_0.9744015381914028"},"_hasShrinkwrap":false},"1.0.0-dev.4":{"name":"@fleur/froute","version":"1.0.0-dev.4","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute","author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { buildPath, query: { userId } } = useFrouteRouter(routes.user)\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@1.0.0-dev.4","dist":{"shasum":"30d302bd3dab2548fdedfd06d21692d4eff884ca","integrity":"sha512-7wuEsfpNpB1uMQIMAJz+2rvxA5xT0ncA4+IZR+PNyMbwOZ/Px04KVzq3UgNqECyAodKzJmTWDi8bGOvu5SVjsw==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-dev.4.tgz","fileCount":23,"unpackedSize":74426,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBG0uCRA9TVsSAnZWagAARZoP/3a8MB6Tdg2MCzebRxmM\nxqpOi3Fr/o7FMn6qoVk/2lhKnGSu6/kGtvt4p7R44+ipBaIqqH6rDULn+Uv+\n6ZC4FGKasyuJxhMCGPwkfQ3U2ERlzBI02+gLu/adDL9LsUOufsF5CB7jVmFY\nbJAgzu8OWUovdvtGAls6DlS0cxLnriIK8WQgdjULDok3UN7g1C3BmC2w4Y6S\nNclzBWhG4w6YJnT5BGD5Za1ckfU/490jAWpVbU3raQKsjURw5fD4H7byiV6h\nCI2YOdO5EdYUq9azskbjOvomZUgH0pE0i+VGGl/WTGQ/57blM2bhQaHywJU8\nsFkvUpVbmIIHNWYqR8NKKQBFvyIrp6YjfONNq/UCFnw/Fid30yrezZjRX7Ap\nVgfLrdUTGRFePsMuthsH9ABDJugNLKBzzgsUxNtGKjjtI2jLuwBaRol+NJAc\nI8KeQesHE9cfeh2wA0/uda7eoIDJWiQA2uXHIYQjQH2WT9q4JTI+yHPMxXV6\nr+dbDLBN1UTvVjZSWAjCNdPAQTJ1I9YnNFDKNPwzUiddSlZKtrl+oTKYgTBj\nvdqDYbiTjy6lVic+mQLu0OAl5adpPNH3XEzlxOicQYyVEWg91MF+WYuQEicg\nbkiScPdPde5yMQChKqHR8RrNObPNNlkHrbMwPRdAuSlkaJ79rF4qoCcOhkm6\n2Asr\r\n=YtDb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcS9mxBCTdWNa7XNwqJdpxqx8Fj7fdZZldbIPohJnxKgIhAN5w9cbxd4gEgLqPAYSW9G3TTa3eOM2Pv//LutqK00wg"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-dev.4_1610902829934_0.8499308698471639"},"_hasShrinkwrap":false},"1.0.0-dev.5":{"name":"@fleur/froute","version":"1.0.0-dev.5","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute","author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { buildPath, query: { userId } } = useFrouteRouter(routes.user)\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@1.0.0-dev.5","dist":{"shasum":"dced72fe614ea16fa388b833856cd679be98e3cd","integrity":"sha512-t3i0ayVC4wvIUBny108GM3fM3W87qoYb0qSylMa+gkSuKYEmnmMYibWUg5gBl5Gce2dw4bKcMgTS+bbhEW7kug==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-dev.5.tgz","fileCount":23,"unpackedSize":75252,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBG35CRA9TVsSAnZWagAAKZAP/iBP21EzWh7+WvHVsrpz\nqqzVGWZk1I2kBG8oUJwR3PZT9W7T5nVVKVd0tKIlYa7F4rc4eYgAe3McI1qj\nXfxu3O91pGjMDsMC0Gwp7maPfAo90mmcTy7AzG0JFUtlH2mrh1V5evi51fBN\nBlKF3x74SMUdVYAqYn2xRCei6+9BcbV0BqSCxdp7OryT0eaXSCiZ5gu1sax8\nJoX0SgtsPHC6w9r5vD5O+wEa/i58cjnAnzKF0RBNvxtPM+sUy7GE0Zh9evii\nyE3s7y3DW80eJFoTOm/4plQo6KSrPMRucjGvff+k0ICt8NgPwLfqSixZtS5q\nFrBPkxon34Emn1ZVtm5MAfwyU0qWfzuQca9h51uCrt7p0uwmLyvIJ4zEHaqw\nn3PUiPrG4HPORwV+Bs1gzIW/VRpJhwdS43TMVALMN4zY9YoXdscGc5vA1k1c\nq2ZmkcBSaMwZhmjn5NPtpJrl0rvkqnFw4GispYnOzVPrtpsjTtYroK5tSqYA\nyWZ8N/IfiDslPWXR1Eub9cdLWMAUBljDIPom96wxtXGije/EQk6pcb8+MwPj\nUi0L98bxRUSbk7ih44kgeJSGRbMjakkhXCoPRcoB4ssBMXLYwSgLd1hiSDKr\nl0isFj34EFJfO1tysUf5v46bdVRWwGMdXFBBmWA6dU4vKpge4lg4DTTA3lB+\nZ8Y4\r\n=Byrm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDG2pf+fZhCI4biLC3Mb4kjrgSI0BGTBy3v4uTtohqMZwIgVp1KFYODlXt2kAwGA365mjrriR2sHJUUX6vnyzEQsaw="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-dev.5_1610903033355_0.08983166661157438"},"_hasShrinkwrap":false},"1.0.0-dev.6":{"name":"@fleur/froute","version":"1.0.0-dev.6","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute","author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { buildPath, query: { userId } } = useFrouteRouter(routes.user)\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@1.0.0-dev.6","dist":{"shasum":"1f3a5e720121a0b1077c95e921d9901ccf02a306","integrity":"sha512-YwKIpP/fmFNvKiyYYKmuI2GF+UulzW9XSnMRNN4qE5txj6pvDwGGfZe711X3AbYqi5Gt4MiFVKWk0R5XPWbH7g==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-dev.6.tgz","fileCount":23,"unpackedSize":75200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBHV6CRA9TVsSAnZWagAAEz4P/1fO8qDz78KgxZ/BYEHV\n0PosAEOOFan0wCpooFRIwls4EUAkthUXA/Y3VY1CcO1XAlfqpcSJYJGixbpZ\ny+FYU9m8GvVvHgzUrO505KkFoRham26iLIUTCZ8uU5gJw35gm4VSfRsIYsdy\nX7lUqLqT10F0ncHNBOkX42UjfL42mmKVR6BKvMKezPCWkoeyw22qXFLXlF+X\nD4kqwz8F7UktVMq7FhOlM+UPUD8KRF7RIwk0agzrWEUCPSe5E+ppRPF+EBHi\n6HORBwriZcPvJBwSQvh902zdvH6Fm4nie3TGHD+soVrPB90Zn3xxjvmC/yKp\nm5QgfjovHuvPwKcyj5z2KCo+TcdZZMUmk/15qAC5H1SdOzuYWqX3Ww7ZtMFk\ncI1ucaYGhgwmKT9T3biNclu59Sh/qns2qzr7xiys9T0mnYeqf060SrXQ86RD\niw6hTTnagUknE64T2wVH4eH9siK7sHu01UUQm1JvoO2v3wTn9WtTi++S/1SD\n9SNknPeWiESTIH9bLdjw/tAMAhY7dmAp65T0kHUYWSd9L7k+aiRpQd47NYCb\nJ/AYhT/wr/JSDu5imzD7f4YTo7zGsKvG2W7QxbxV6tsaHJlOfBaoNAcUJuzR\nDFNogNUK2UzzcuxNz/JsR099cICD/H9RxAo4/JJ1srhcKlWDPerTkzsJJnwh\nI8u4\r\n=W+/g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE1t5w2xIQDdFvL76fEMdW1D34L0X2xKrHdVN4NIqhRMAiEAyK0lAK1r9MqMJBS8R07MjZychN0Arl2Rio9cleo8lTQ="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-dev.6_1610904954185_0.17531969785242763"},"_hasShrinkwrap":false},"1.0.0-dev.7":{"name":"@fleur/froute","version":"1.0.0-dev.7","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute","author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { buildPath, query: { userId } } = useFrouteRouter(routes.user)\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@1.0.0-dev.7","dist":{"shasum":"13998b5bbfaf04a6ce5505527b30d247f1781d44","integrity":"sha512-quusmOzVb+JQSM3SzrYgvNE5BN7csw5w2/zzfBh/oV9EkKF3i9b84unfeuALGN7A7XeTlwfdw2mnsaLgYqt2MA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-dev.7.tgz","fileCount":23,"unpackedSize":75274,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBHzSCRA9TVsSAnZWagAAcQYP/32Ch8lDH6cJRyaV8mDF\n5zTMv1Hogf81KG1TVUUp3pqeAgk6G9+4wocX5BWxPLDQM31RBh/OwKke0BMZ\nEhwPayFfAFE+aprxWNfa5tekfHpl3i/iPwRNnAIf5CbOKL2M9LAnqImgSJ34\nKxQdPl8Ty3QMYyAyCBwsLWlLmOKuxqzfg/ynU/kZI+d8RtTxHmUg6YGtw92m\nSr037YAsnjbtfflLJN1dv7kTN4IYBtv8EOTv2qdelJVtcPYOZjmzJAWIlWC5\n6OmLQR/IWydIWtQm+bdmb8UsfWOSvP4VcPCSLDjjiIO4++6k33au+VPO/NUq\nCNMYgCN3oiB1UgnURHVAwhWHQ2lwmv88IWoc++TR6T42AuJ256kOQzOh9/ft\n2/0K9yswlJanocKKu/78IHbbhCQFBXLIku6HRHsDRNCUepuPdXdUKfQQdrIM\nOc+ElVWSCVALRYG8qyV/K5L2Ho9x+HCA3uZR15f+R030ydJVjSw8m/9NS99u\nGxI/8OEHsePf4ybsssPdRUgSayKIWqWt5e1brIUoeohcAKB8nIc0u9F4woti\nRAHeQ35vtmI02qs7EzbWiiLYjEtjhSCxy2LsLSdGsANajlhikJvbyY5NeBuH\nxPJGgd1M7YWDta1yZ2CXZxBL50+Gh06oMj+HMRxHALIhENcEsLkWTqgiSgWK\n23RO\r\n=LcAp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCl3Y6Lr/qbZillyJsowBxNIzsCbeWPCUTwb7u3MFh3NgIhAM2hYv6iKhjjKoFh/SDXwFWEG56jw032/M/WImOforE/"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-dev.7_1610906834393_0.324747544697509"},"_hasShrinkwrap":false},"1.0.0-dev.8":{"name":"@fleur/froute","version":"1.0.0-dev.8","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute","author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { buildPath, query: { userId } } = useFrouteRouter(routes.user)\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@1.0.0-dev.8","dist":{"shasum":"b705fd4b553c875c8ea7071c39ca459d8736f4eb","integrity":"sha512-F+dJmvIGT6lBSOFfkBoukHk8FnX6Ka81itm2PL/3NW+CTgPR46V1jwNq8ofyhoc4eaIQLTprEdO0XzGdbdi4ww==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-dev.8.tgz","fileCount":23,"unpackedSize":75378,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBbrnCRA9TVsSAnZWagAAoZ0P+wUrkOyUMuSHpOfviFWF\npB6Gc0SAa5f8lSo4kvNB9wacf+sJURnlMC9LEzwgujLH2OshfzU2OAr30GCl\noeMVpNkZYIccukPjitO1vJJ+YX8GEx3hAVS4zzX6UQ5FOPfF6qwPjEbWiZBR\nK7znz56cjFwvDh1RyJxeYBtMRrW0xbWZslUXd/moP/F87s5yHJkFaiGhYijm\npsEzdIZLlPkEkaf2XxxUJYod1sYVup3oR5tK4mc9Iqz+HoyAYKlBxG1TV14J\n97F8SNfEA46Xj0BORotyaSPCg0XuUsx81RPF4qQ1TXQv5mtodpnTqdkqCs8F\nCac8+qQQxeXPlB3CY3eVhWCKcnLbCTFA0frODyd9agdh63M2li40CqdXp8yX\nao1EW375E8lUiFVNKkcWx8de0UZTWYk7/YYRFyujX+5zgDrNGp8HKWon+ybR\nRpikNsHana/siIWR8eAwu5IEwcMSC2N2+0ylISJosMwl++bnScLdUsPAbdfL\nlq8c8MWnKLwBUuG3cdgVf8iqRgVa5AErhxO9cuvlTbTgrzmRKR21WwogsyQ0\nd0oMOuPZrDIfzfWw42O5CyhUmaOCNLjusAMktcTgtv64a7XI6qDmjZvzt0nh\n5vy9hRQqPcXXPy9ow2lgT0Esv78SltCO3R1lUHQCp5w9GlUtyAl4Hzjw1srk\nBv9Q\r\n=PpKF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0BrksXxuNDzE8EKNduHn61RCI/zdXH+dvFT4wxLx9JAIhAOSMkQaJ3ua49B0WRD1o+H7sArgiM9/Si50sOjXU7bDp"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-dev.8_1610988262928_0.425885915913907"},"_hasShrinkwrap":false},"1.0.0-dev.9":{"name":"@fleur/froute","version":"1.0.0-dev.9","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute","author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { buildPath, query: { userId } } = useFrouteRouter(routes.user)\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@1.0.0-dev.9","dist":{"shasum":"bbf53d7828b879fa19932625de55f2b9c6826a83","integrity":"sha512-jtEv1fNJhSNooqza3Sl5/OTDTwGjHef3G+DzZSUK3JbUlTee7n8MAB3Eoy8Z5si6B25DYa2lu9XikQJnRxIaQg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-dev.9.tgz","fileCount":23,"unpackedSize":75608,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBbukCRA9TVsSAnZWagAA+4cP/0hYwkYBQxLQi9f89C4r\nihV1g9ApGagXKkCaaTwKMnJE4yRsOoOmsjndo1y8NLr1OAn57Js4zzvAljwF\neAzLX9hlRkxSuaXMyfcgoe/z0bKR+0wMxDRMYFPXQSYvxzKyMQ4L8yxT8tj1\nyu1+HSY47eF96AeM56omxh2Szznbi5hkw1jZx894nq5TUB14IG4vHSCyo3/W\nS5HF7xIveQ2+19/rHDF68wlc5d5MOF+SEIMZO/itxT5k1b08wz2bP0jER+QZ\nx04YH+Sz9obqohoDPRowi32x5j7tSWkzrIJOLwsSZIGOjeOohiH9mEuMnI84\n7+pM2EhxDHrqj/mzgVuDAu1NiX8NlsPiECDZVmFaCPy+rReY74JRo6UQxoBN\n+yC+bkR/34ptcxtCZDhf+st+dWCmwXpi4+se40rQkzOUmr8bBf6D5xkYpPpW\n3xzFBZIFlBlYeq2HHvAOML5ujXPnGM6YVphngN6TxG2on1dmyMQZMQe08gsk\nIKyCCpzTStW7jm4wvF2geXYV/2HVw7fXncxydo6DNwG/aav64fGJ32exwfXI\nZfgW/tJY6ie6wJk18PE0N4JdDwm1aqsHvrbqmuUr/8tCbzGOMzTot/+NDSlc\nBOoVw4ZaQnv/L0nv4luckbEEH1a6jDJNjLRm5miGDt/iRrY/6LilHZ++5pmR\n8Zn9\r\n=cVwy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAOr7Oz0q1lOPSRshSD1ZppGijREXcEj27xgsFSkfCnmAiBMfKjXD2NNd6xMmZ1SQG2Pha1YB3d/pV4FR62runOnyA=="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-dev.9_1610988452460_0.8654641217750514"},"_hasShrinkwrap":false},"1.0.0-dev.10":{"name":"@fleur/froute","version":"1.0.0-dev.10","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute","author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { buildPath, query: { userId } } = useFrouteRouter(routes.user)\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@1.0.0-dev.10","dist":{"shasum":"467afa79d7f91048f3149e7c2b03c89aef1f4405","integrity":"sha512-g2Abq+QtmrTib1syFKWrvH0VMf79bwCLm13yPCI3bAp3R5WBIeZ5+dZi2ta9ri0uw8e/lV9t65/AnjdlyHOK6Q==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-dev.10.tgz","fileCount":23,"unpackedSize":78094,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCjdFCRA9TVsSAnZWagAATOsP/16P6+0JNdkgY2O1k3Ub\nUbbU2dFqMu/FKOPiOhLxuVcxdU3EzAU7rQxpRnti906wrUzppMEH2UcgNY+5\nNXw/ZUWljXBLhQD7hbRalCJiGKnNjj8LO7i/vJz4Lq6xtmSdPr72Jz3r5CVD\nCw7JohJgao4SgjDE1OzSw7f6PGBcv4tfUn6RX2eTVLGDxYkWka0k09fwjSVF\nb8lSA6Ju56k7NFVhAva94WOWb3KoBERd0MKSbQbpHrqc4yTCQq89aI9QoKGW\nTlrSlchh1WFRKQY3Uwwqb9FZC4TidSmVchDOu/Dbs6t+ZfaCDVGFDVVFdxGW\nAUPNJBtVmGule3XrcP29EJtkVoVT0dKUUsewnrg0ZXZecBlcGKWKWQ+vNvdE\nT6DYQEoM0ungQOrKKN1h4zrZyvyfYVdtsZd/YZM9dzXR5BMcoRiv51S4DswC\nQEM6MaQSF0xc5jr+YUtlPesiEoBjaVTkbX1rNwFAj/RPpZyitZspEz9UUbU9\nPdlIUj4TIBiKK9ssPlT6zbntzwEcjjpv4cPBDp2Hr4Cd5b0qGkFrIkuTqL6I\nqrbliHdYquEZen8RVHxN8bUIYM9qrbSGDO40mxfigglg37Oq59hI0INxoe1k\nltmKnPFENN/5FzLKc3lYjyIsBKbdh/8fHhDZvLb3BfxMlLB0JlYkPJy2II4F\n9HBP\r\n=6YlR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIRTp8w2Y7mgw9AoXfT21Rugf0abHhbrzMLCFuu8LWFgIgAg637Dwe0mQtd3iwwah0iMpJu+6jYARe97WKe26ltak="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-dev.10_1611282245215_0.7967082016806317"},"_hasShrinkwrap":false},"1.0.0-dev.25":{"name":"@fleur/froute","version":"1.0.0-dev.25","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute","author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { buildPath, query: { userId } } = useFrouteRouter(routes.user)\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@1.0.0-dev.25","dist":{"shasum":"63e6060bdf3d4f7d31287bd521df78756547daa0","integrity":"sha512-G2SzqK7K8FCgeJwbXbbQOjrE0P+YLAu65Ddc2v+ftYBesbpJEpaRX4MFppcZpF1SPljPn+EqyYaN/og2GsHvog==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-dev.25.tgz","fileCount":23,"unpackedSize":77297,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCnfqCRA9TVsSAnZWagAAcWcP/32Fy/kRQ+5Xof7BiMcT\n7a+k7o8P3zNT7bbae8Lm3pe9EDvyYOOFh0lWK42aG8r1W217JxZLDkGV0slz\n2Sac81huHklflb1S4jUpniIjMl9qqN9NmZwMRufPmO97s3ZfR+3iNyr/RDLg\nKlB6f7oH0/tupCR8Q0Vn2BEEWkuxUSDGGHtYJYggKTRuBdwYZ/cZ/WnraJnc\n6TludDVBQFlSPprAgFLmCwCtcu1pln/Ub2plAkbyv5pL2ZUbfauM4JsDyUdx\ncAGrZxTAcOmac8yf76mepjKytB+x9Zetq/6iXddgC62shIHocroS6/seYum9\nn1KAYArWLzJIPkJNxoTs+ZRG80GTJFYKLXsBpzMAjj4/xv3qtifM0vpq1VE8\nwgYwkrxCW0Q0LeBdu4o9H1lMwGgmgmjs7jsA2Ahbx5+A9XK0u1iilw46k7C2\nBk/J3aojFV0+xX+WwOPGhmrDQvib6xPr2sTZTjTSG8y14Wd+jvcXb45+LNrN\nhDS7NfsPgMcF0W+FE9aVnOu8yKSb96ScK7ByRLb5SkxdIugGrjLB1Lge70ME\n2TDqEKxOVewOohbrk5wVhIARO9kl4HrMErVfXAzWm50jRHikb7TYiRoYXiyq\nhmuYN6MExdo0nOdAzxdkQI5Utvrn3pCYVxzbnAT90g4dJj4dUPutd7dhlLKY\npXnU\r\n=NvdK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0U9g7SM5JTPWWvt/Nw1wTioWP0hXtjYxoC2+MKspO5QIgelczabjDhPSnj3Ao8rnQxMWaahGeeQj+JlocUUjyDYY="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-dev.25_1611298794458_0.12434850925495944"},"_hasShrinkwrap":false},"1.0.0-dev.27":{"name":"@fleur/froute","version":"1.0.0-dev.27","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute","author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { buildPath, query: { userId } } = useFrouteRouter(routes.user)\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@1.0.0-dev.27","dist":{"shasum":"35affaf9ef88ee7f17d467460af2af37576e4c78","integrity":"sha512-xb5GTnVHwN8n00uPfbAjqVa/io+1yd1NDUdB032dDi6XdKplZO/4VRSNddqXhVLlGAh5B6P+MbpkP3YgQI+rSQ==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-dev.27.tgz","fileCount":23,"unpackedSize":77896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC6VwCRA9TVsSAnZWagAAobQP/jHjWYkAPrjJasbw8fHD\nBIY6d1if79TdQuoQDumVlL2PZmZst0kXLPFfiq7ZX1KbupYpO9VkcPueEeUM\nHbt5mYt0J3LoVFyR6CzJ7AhR/rLTvBWXyl2K4nlEQu0f0t+sAOaF8bjsyEen\n80qQS2PH0BaVEmw7Wt5uAuZxQ8o635p/j1JFUa2VyGYr0WQieq+39bAXt/tq\nO+muVA/qpsxTRDkxqFcZtV5z1ptYlxept3cqNdn7kPQUxY8Mq/vqI69Q67LC\ngbTgNO7hKUw+a3TQvDwjY/xwmvezW84cdKXn3p5C3IY/vFYL6q1ksJBEZWdb\nYMw8gIlpBK+KUWG/oRrGMIXbAKA43LDgEQYXEYoYLroLOlAQTXnbEp2qOPOE\nExnpCwCFQtRIjxvSlWiMM41CpHQJftUEx9PsEFIwXe+5SnlXRgq8WqZW9btq\nvz3nCmvFFsPc3yYQqcyuef3MPvsbj93X40CFMcXm0QuCO1VqFX07esSzEHVj\n8Ft09BdWZiwu2EpKyIEdNUAD72C2q5FETcpGi/pIbHrQOZ506ic6fWdTX/Oo\nr4KOng0AB6POsgKKvHrEqc5322P7mAKYsYDzC6TOFUQln3JSwGrBirQm4H2r\nUXgdW9TkS+dHTsSDYbC4gu7xfq5xweJt7WsNQxUY0pLXUOYU9/V/IP7Nlx0C\nH0/T\r\n=ToSe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwW7yX+hJmUIbns0JbGfgt5zXH1LsiulP+0NZXqcCrzQIhAIH+QchKheV1kuaAlmD44eo5OclzjMdU7Gpp+3quchMR"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-dev.27_1611375984327_0.3445276536596551"},"_hasShrinkwrap":false},"1.0.0-dev.28":{"name":"@fleur/froute","version":"1.0.0-dev.28","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute","author":{"name":"Hanakla","email":"ragg.devpr@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","build":"yarn build:declarations && yarn build:esm","prepublishOnly":"yarn clean-dist && yarn build","watch":"bili -w","example:start":"cd examples && yarn start","example:update":"cd examples && yarn add @fleur/froute@dev"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write","git add"]},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","bili":"^5.0.5","cross-env":"^7.0.2","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","jest":"^26.6.3","lint-staged":"^10.2.11","prettier":"^2.1.1","react":"^16.13.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0","rollup":"^2.16.1"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { buildPath, query: { userId } } = useFrouteRouter(routes.user)\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 fleur.js\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@fleur/froute@1.0.0-dev.28","dist":{"shasum":"3f1510f2f52544dfe633cfa13d63fbdc9577e95a","integrity":"sha512-U45c2hQG1kc5rrsnugcsXCcpsrCzgW+VF6hFwMRD4XY8XB5hVkGmVegumI2epRH0W8wMRDpdNH3oppM9kO2BBg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-dev.28.tgz","fileCount":23,"unpackedSize":77954,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC6jdCRA9TVsSAnZWagAAsgcP/3K58nS1sFE7LcQ0MWHj\nQlxKd8xtJLde7drtsSzkhPmVf/9ofZoLBDAXYxYmb0tbGFoKOT/AYfNaeJDF\nCgrSZ9NhHSHY1dKr36EOd01wzzhcSx99iV+oQ3bNsHOFDQE9kMB76TcsnKLi\nlZiO7EBQ42r/3ZiVVEAaW5gaOKE2eW/Tli8m07+BJ92w9AcV1dx0BUynwNc/\nqllg6p25DLA8Kcua1Hcc8DiAadwJTEK82n4yswQ2M2/W4eR3HUnJGUNQ3fkz\n17IfCzb+Sp4Ng70wHd12hEW+j0WiaIcpvbda95ddhz8PzY3HBdDh4BEaf4AU\n8LnTHh2KQBohPwin9nZ97mc/Oqdst3WJ/YW/CfykmpjpJLStm1ymemX/PZsg\nlZauO09EQWKtsY+ndFLx6nVyc32XLZJtBMKE4W0BxGSCgKaXlffZL9BoFGOa\nSA0hEKImpClQDG7ihyIAFVY53UXYvtOqxxms2dpMXBz4QDFZLMEsW/i+h/VR\nRKv31pR++4XF/petH/IwFNGyh2cQbWkqB/g6FDGf0m/ecyAn7ocR1Pf3ht2i\nY3nrqAmcLbstRrxmgZ9cvU7UEGnx+Yu44Hv4xAJZ6lkd5qJ0Pi7q06WCpzvw\nMdkj6LFB+JO9nAI1L6FOeKG+rjifR26YLjn7aKIcXXjl+A+px+AI5pCabN4Z\n0QyH\r\n=QHe2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH0ylPEVYp4Sgis9aHsm8pQGg0oHBAFQk9iidmzCLnOCAiEA6Ny+KWEPJu33r35+XjDHd2ISmN1KEj+ED5rRxFgfFo4="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-dev.28_1611376861309_0.5978887401109263"},"_hasShrinkwrap":false},"1.0.0-beta.1":{"name":"@fleur/froute","version":"1.0.0-beta.1","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","watch:declarations":"tsc --watch --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","watch:esm":"bili --watch","watch":"run-p -c watch:*","build":"run-p build:*","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","bili":"^5.0.5","jest":"^26.6.3","react":"^17.0.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup":"^2.16.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { useRouter, buildPath } from '@fleur/froute'\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { query: { userId } } = useRouter()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n\n  router.dispose()\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","_id":"@fleur/froute@1.0.0-beta.1","dist":{"shasum":"59242f0c5a3cf2dfd70576bb47639c056096dffe","integrity":"sha512-GwnHisbEEiMPgJwFJqwoUNbYEcTXCDcFwis5n2s0Oqg+eG/8xFIz//01oO9ZKhhhpcUUN0NtRCrVrXNRSAuPIw==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-beta.1.tgz","fileCount":22,"unpackedSize":77354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDmwXCRA9TVsSAnZWagAAEhAP/RhCPIlt/ykqjmU7mA7z\nw0CozByDVglSxCfSNXQDn2tqY7WNx5TsDjmo1/5ix6KU9XM99Ox6hryiOnL4\nuJBmARXL64Sp1vg0b2pC3AlPtrkVKpzhgkG9TF7g9PxATA4uKir8qP7AT1eM\na/bAZ+wkynDpqSNoU3afRdvjJvFJ/VaZMjCoyvFDNUVwOWbdvFb1Z4RAyRy9\nDkZuHrJR4OrRox6f2MzH2efPu3Crjm7CNK7cfZ6BcN/asqGqPHsnrib3cca7\ninRuPhpBC2nFTjmYVezPLwM9zTfeIh4FErrVPzY8PJflYqp6b0ET4Fb+4WHV\nPU4jbJWRt1bpDyRYbp1fG4EzWNvtu40QL6JGFtJogbbrQJzupY6nxDoxqfwI\nl47Kf4Rqt/CXmbQHgYT0N/6Kmf4snwGqIpouPCR6SqjMxU7PD3XG+kshvdn/\n141KD59wSb98ScGSR98XsxDD48FRY+eIjqbk679NUmTEo+Jb03Zzj97tS8i9\nOEzX0vUzZJLhStCUt0fhRzc+58PMZyPfsTqe1lvgEvVZoy7QpB8rb2Ex2pvp\nhAzdQ0J0SNzq+VM833CR4jL71XAcFiM9LAGIEZc0OsjFfCMEFQAC5l6mhS09\nku1f50ucY5oiObIZ7d/us8++xkqzX8pJKg7HWjOex5Nbl+escdDmtgletM++\n8aLE\r\n=NJLi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFksbiDqlgZsKZ+1lpOW/qwu+380fiZkTtbmfnFiYPNGAiEAvQvZvqE3Bvb1bCvPjmIAghSjuOVWfOJLqYy/BBPHPUY="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-beta.1_1611557910491_0.029836683561260458"},"_hasShrinkwrap":false},"1.0.0-beta.2":{"name":"@fleur/froute","version":"1.0.0-beta.2","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","watch:declarations":"tsc --watch --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","watch:esm":"bili --watch","watch":"run-p -c watch:*","build":"run-p build:*","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","bili":"^5.0.5","jest":"^26.6.3","react":"^17.0.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup":"^2.16.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { useRouter, buildPath } from '@fleur/froute'\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { query: { userId } } = useRouter()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n\n  router.dispose()\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","_id":"@fleur/froute@1.0.0-beta.2","dist":{"shasum":"88927baf29d15a21b6107f8bf7d6ba108fe8b13d","integrity":"sha512-0AMhsS7p+IpCysor3doAK75dwcRNPEdb8QwPhkERxFz2PrVrHPgs3koJgLvDvJNme/DMP2Dd5+9WZwCzkGmKKw==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-beta.2.tgz","fileCount":22,"unpackedSize":77360,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGSGlCRA9TVsSAnZWagAAV5YP/3lWZXvcnljdkyaC3SBz\nKXQjodXpLKlooH8LQmQQffs0tLe7ltj5BDi5msZWIpD51aRJJJ8/n5Fr++1E\n3+V+9o+nRapx1wo6Klh3SL2O+oaY5lnCbvcfVtqnosj2xNDCEnQoj7Fnzt9g\naeewluWSCEuxmQlKei3xB/Kf1NCIqF650+ggwTdy6lAQYwwKaC++vx5C4SUj\nRJwgDuVfJJeBDshN0z8yd0BzWWnJAg04/l06uodfXp0QdNbf9tQB7L4eIfKT\ngEUDjrOsUypFe6Ig/sNvu1KoMguwwTgzBhdRqx4lkThhVkxYmT67NmlkGZBv\nZpIrGqJL55hRAn67i6enHP1w0cI0K2hbJw5mQzgFwKDjz3pXwHf5qR9k/vpc\nDUfLsyVc7jVZAaz6qM6eJfClaZgio+AGZ9Q8ZFvkPWKVgjmRYOhp8bH1QKiL\nllmB+Tn6O42+WjONAIKRoqFxQZGYILvNGk8Cw+4+SxfwpVdmm5TTANrJ6Ddg\nMPxCuLSKorK7F4hNi8GJirVxxd7gB2AeqphhRuNE25bCHcyyV8eRYsfS8mJH\nsM2WiroL/UjOdQ36Ngwvz3cdg9MtRvgwDXgs77nZRqZJ2BeomX0ov0tDguiI\nGLENWzZl7+LEIZDgXQdHHdJTbpvANvpmeXA7ih3d6aNLmDUFFp19VL8RjmAy\nQTp4\r\n=e2No\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE5SR++9+yKQUhvVW69sC7VY2ReDartWdsqaEWaWQR4dAiATSlpYe2mZ9TytOvQzonCIXIIQq9Wo6GDg02jvenb9Pw=="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-beta.2_1612259749477_0.7924448595254092"},"_hasShrinkwrap":false},"1.0.0-beta.3":{"name":"@fleur/froute","version":"1.0.0-beta.3","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","watch:declarations":"tsc --watch --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","watch:esm":"bili --watch","watch":"run-p -c watch:*","build":"run-p build:*","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","bili":"^5.0.5","jest":"^26.6.3","react":"^17.0.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup":"^2.16.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { useRouter, buildPath } from '@fleur/froute'\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { query: { userId } } = useRouter()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n\n  router.dispose()\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","_id":"@fleur/froute@1.0.0-beta.3","dist":{"shasum":"fd2911a6f1e8f47c5f4fe09a3182fe06482dece4","integrity":"sha512-EPwvfAf+iu0gW2+tWCnOFWUwiMbmnUKWC6D0gQSUkcoaxNuQLXKeduXDj1okUr1KiwWZgDyZGXFcibf0SfkBJA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-beta.3.tgz","fileCount":22,"unpackedSize":77210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGhxQCRA9TVsSAnZWagAAIpkP/2CdQPfhK4RkV97MRAw/\n4fL0ej0JnydyfSkHUI9wnOoR/ruqjTiM7zhcQANMOd6jNuOvMm4IkvsgP7M0\nqUk/ZeHaAC8h7sP+QFd7dtN07SF7QRhjVKUc+dg3NT/kPoRb13YQ/RsTNVQH\nG695c2Ci941Np1gh/lEFEyaG3w6E80oJ+QQ/BYWvKQB18D+2PuyUmu6Z6byx\nIxB/QrLdsRtgJ4XTjW/uVzwFybWsrohffEWV7zj1Jk7zLXQOcIIJyPuiNzvt\n86zLGnmXLe1GOhS68N1iRI9/O3JdGjLPb5Xpy50JRDYQw49yJCF804Bhy/+P\n1M2At0vHoGG3KR7JGv++l0RirJNLN0Pztv0W4EYvtiYATK28RGvR6SceALcP\nu+ZPP6Dzhil+gQ+bxCcwgkTaBNCiGHbT0HT8VxYMfSHGPGyWF9VgTYL/R9vF\nw5qjuANjLOAatkuEL3jBjkmSGtF4GmRMM3r7wfindWElDvCYvNoSZ/2nxXjj\nqnsbLwh4ws9SFDIf6o8De6TxlLrMkIMhDxJ7O0l6l9W+FDUQ8Y+gjApJK5p4\nD5fQjUjvnCiJgR5Soqnd11N75710Ix6vGEOQo3fcegU9+lW1s9XU6rZwipjJ\nSS+unxhe1hcFO2NLr/facg1t9652LpAkQJiaLTu65yZCdE4NeW1INDSM5nO0\nSYO+\r\n=7oy3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH+18UOxQPjOZhqtbukz+zoFzZYaY6XEPL7SIgRc2re2AiEA9ji2ympWqpiJTWIkZiUyenPsLlJn3uwP4ceoALV+Vqs="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-beta.3_1612323920184_0.07529897005998332"},"_hasShrinkwrap":false},"1.0.0-beta.4":{"name":"@fleur/froute","version":"1.0.0-beta.4","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","watch:declarations":"tsc --watch --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","watch:esm":"bili --watch","watch":"run-p -c watch:*","build":"run-p build:*","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","bili":"^5.0.5","jest":"^26.6.3","react":"^17.0.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup":"^2.16.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { useRouter, buildPath } from '@fleur/froute'\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { query: { userId } } = useRouter()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n\n  router.dispose()\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","_id":"@fleur/froute@1.0.0-beta.4","dist":{"shasum":"51a5b92f793885bf2a1604204867eb86b40aef7c","integrity":"sha512-+VDfdc5Gc2PJfXd9bF8xn8mVMlvHMlR7OviqjgO+eTfapJ7MIKVLhnghbXP6yceJvbpPu4gqmCIExxREdUJbpA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-beta.4.tgz","fileCount":22,"unpackedSize":76662,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGkrMCRA9TVsSAnZWagAAMkoP/A6JqAq0FiYr2/It4h+0\ngM1CznS4sciguN8VnekeTaAa5Fd5JZc821jdJ4oAjeACEElXnKdoB5Tsh2C9\nWA1VQMKwEED6LF+tmFLDHVPIF5e1xP7shjyxfjIZ9srN/w7pkhQ0KdCAFpLR\nrYGiNc7to++KmeluaTym+zoNSbCQ4Yp/8SYjz8/5QRTXu6TuByZenYftYUIC\n0K2yubvGPsFG+Pp/lYhPE7+6tKjgt/QmZIITDSMLCCaxqEgYuBhlbmD1TVE3\n0sq3UU/CRWYYEtbhkllnjN0MSlKFfogsVI5w1e5btY8dgaYpF4fcWWVmjzBa\nvZCESjh3zBqF2BXSSDDUrhPKw2ch0Nv0cEQI5J2H70ZVj3CtqcmLo9BmVxkC\nAvKfsZ/ankwzQZG7+ghwu/QvA8+rlo/QhBupaaTq8iXBb1YLjGnZjhs/1E7p\nud3dGa3lVSTtcbhaU+nZKq65GdtwRSKIw9YoWraHaX94kjv7g66klsc+HExe\nYlxvFpSwyI9M9JtXb7vEWwSnUNs3tlG0LPRV7RmwsOOrmNTCHs1TmWJJTB6+\nOfo7nJjR2SIpYEPVMf/AoKdmuG121C0Fo4Brfco6hl8c8nHs+IZBxD8qqfnG\nMGXySPtOZTCb8dAl4H8kqnB/Pnj41oFMDaYXDLe4hyH6r2t2xjxT5YgfLS2z\nkZBC\r\n=7zl3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlHgWFgdFfQ/qGc+CKUURAXtvB/3vZZ6UUE6hK0XoudQIhAIWynshlu2/iewP2MK2qLIXcDFUES840oGIKNE0D9lCR"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-beta.4_1612335819509_0.8991917919013754"},"_hasShrinkwrap":false},"1.0.0-beta.5":{"name":"@fleur/froute","version":"1.0.0-beta.5","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","watch:declarations":"tsc --watch --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","watch:esm":"bili --watch","watch":"run-p -c watch:*","build":"run-p build:*","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","bili":"^5.0.5","jest":"^26.6.3","react":"^17.0.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup":"^2.16.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { useRouter, buildPath } from '@fleur/froute'\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { query: { userId } } = useRouter()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n\n  router.dispose()\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","_id":"@fleur/froute@1.0.0-beta.5","dist":{"shasum":"c403c4bfabb02eb10a9f76c80ca97f6334e77802","integrity":"sha512-3GvmkytmpwiLNVjxBKvxs+fqHIDqGOemBwTEH9xZ4OWFpXGoFNQPHvenWdiE95khon5PBJ3zGqMBzon0wr8Rhw==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-beta.5.tgz","fileCount":22,"unpackedSize":75258,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGltLCRA9TVsSAnZWagAANgwQAJWIgjAXOp0ZdRXatPFW\ncRBKa2vyOSfftd5XhluxX9BvXMs7gZrVND+6K0qjZ0v45RW69nicOexSqGKZ\nW0c8r29HK07s1FhsVVy1VNmYdeMzGMK9XiXgw68odBzKUXoH2UM7ihWFnIwB\nB7Lq4k3ARrGtaSM8uSymzJWZ0+KwaCJMCsw/NhNDn9P5l5d8TLTp5id6rC1c\nRIQkDnqu8z5eWv86bnBRDOUSBD5YH/Tj3DXIeC9afS9L5nvrkdyC6egRZ7G8\n5YeSljlV7au3ZHpDo9AyJxoJd2WMw0izRkyl8klFUcJDrHrE7RPQFm7mQhSH\nMNviFnj4Gosfam8v8MqZiPvsJotRY/wvwkuBRsY4HhWCOuzbilIyyBI2FAXa\ny8WaV+HUW8SgoHTjU9sD7IDdAEdd2fz5B4MoTwVR116rL/97AUmklZPI9tm3\nitCBkFUxP9UCVBMsg4X1g4XJKZQt5BcUxJHODvluItxgC+nev94elPuoEHqq\nXtbeLCwQCrVZIcEb+8seiqA8ucXnzeCb5hb42hrU9PMuYVdoI1LDDsdlq0r8\nem0HZsHfhYMn8+ywymhAQEOW6MRctqZ3PLi8mt6DRH46Hn/aQDhkoH/xzrxJ\nZI3/69FvmDLgLpgfYc4mqDHymc4XLiVqrmMEmDfaFyUrnIYwKb1ea1Y5hyzy\nEpL6\r\n=3xEd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHcD7nIsst0WVREqFtBg2j3JTySEPjgXK0ou8s4g2ecwIhALBDM1fFrTjioMJmDx8wnVtBjnEcVGg72jxHBXMj9YkR"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-beta.5_1612340043476_0.7557819447624226"},"_hasShrinkwrap":false},"1.0.0-beta.7":{"name":"@fleur/froute","version":"1.0.0-beta.7","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","watch:declarations":"tsc --watch --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","watch:esm":"bili --watch","watch":"run-p -c watch:*","build":"run-p build:*","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","bili":"^5.0.5","jest":"^26.6.3","react":"^17.0.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup":"^2.16.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { useRouter, buildPath } from '@fleur/froute'\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { query: { userId } } = useRouter()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n\n  router.dispose()\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","_id":"@fleur/froute@1.0.0-beta.7","dist":{"shasum":"5ce1ff74bd7f4e6b52d3f5dd68dc3f77a6415e84","integrity":"sha512-2I4SKuFyiU0Jii01Myab6ovu3PUgCTLjOdQGWKXd/pVuIikcIc0LtTGus6CPXY1tLWCvsSH+H006zEQj6lHo7g==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-beta.7.tgz","fileCount":22,"unpackedSize":76824,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGm3rCRA9TVsSAnZWagAARWAQAIhBKUovbUWMw2qKO8su\nvObBzLlj2jsi+7Zyy5RfPNG83hNX/ICnNoXhGiSyo7XsZy+CjC042WhvLaxy\nto1bLljewSj7zargR1GXBPUeNV9gXJTqfiT17FtDOaIYjzE8rrcRFGIvcRJ4\nBE5AOkKXUn141amHK5pJttBjwoOJHIec1h1vm5MdNHiRe7WNQjMeQc88k2PX\nBZPfvJsLe4DFVVIOvkC1AkbepTzRe8sqUGXoiiJg/ucD1RtJpnuZHiRulRQ5\nqNDtpEiU5/f9A24ifpeTKsDFJwuQjeK2U+mMekBZq6a4wVkFwdJk4/QLEdYI\n6VY/UPauTNtxtycoLb+lJzVmFShkVNVgEERdTogMq79Qz4bA2lsnmDrpX9Ll\nd66v10g1yZTbEZ5C+29/taFDz8zZ8FLK45i8QsVj6dddFOM84k41qMnIno+K\nKgQSIeAE385NiK0szRc9nu/PCajLrnolMLjZmJi/B/95k7IwdDW37iFIOKuA\nIjZxtpibPUcqdn/Q48WW+t/HXilV3G9FUO2GAYXH6XIGQHUwIpLpfooDa9V0\nmk9xSH7xoNmamDwsdQHDB6WxfUoK1NF7GvW+6xQUB+RV5/uGCsi+78XA2WA+\n9TRRwWkUfIeTiYQLWOkBPFnk7KgTNVFYuuVQlpWu2DW+bXrglQxFazQiX9d3\n75C7\r\n=+HkF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICqeY/8P5kdNI3pGPn5yGYz0Av+Q+bs4oAWe6Wgtw47rAiBpzmjAQSwl2xZLMphDK08GZn6KmBy01TUJiTyL1F2opg=="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-beta.7_1612344810970_0.19726789746386908"},"_hasShrinkwrap":false},"1.0.0-beta.9":{"name":"@fleur/froute","version":"1.0.0-beta.9","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","watch:declarations":"tsc --watch --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","watch:esm":"bili --watch","watch":"run-p -c watch:*","build":"run-p build:*","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","bili":"^5.0.5","jest":"^26.6.3","react":"^17.0.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup":"^2.16.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { useRouter, buildPath } from '@fleur/froute'\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { query: { userId } } = useRouter()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n\n  router.dispose()\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","_id":"@fleur/froute@1.0.0-beta.9","dist":{"shasum":"310bc4802e2294a89c7c242c1425749d25f130ff","integrity":"sha512-ZxwZp4OE3on8xBMYq9QnwZntlgUm8aMIimW0U0sf7L7T7kcTY4m8Dtacb0GhBfXIZvHnPa45ZtvvHnisHuSdoA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-beta.9.tgz","fileCount":22,"unpackedSize":76748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHTGgCRA9TVsSAnZWagAA7QcP/R02/K01nxLIgAOKbqh+\nQClDl+bX72a6jfB6yoaGqqSHfMeuvY2wOLpyINVUjQn2tEJKyW0ZDHRDmczV\nTbfEDAPp7JxPkztNO1ktCNO9skHhq6+gmwhN7lBAQQJ1cN3N5ANyl5BX144K\nipWGWG7JbDqTwKSHbzz64Y9HjNCe6yOsMBXotX22wQwdQlGZIbldyglNKcfL\nag/YbZfERbKatqgmNS0A6Mbulh87kT72PnhVXv8ZgB4pnjSOhrbz11BtrR1S\n/JU7uC7tjxPu1AO5bOwOBbhERMpjF0lMnTjllv285eHsGW+2zRa7HvcvhoSk\nA6KeZnB1evdLTB//onxtZcj/XRhf2XEishCqDfWUXektiTMieqh3UXSba98H\nL3uDmDTO9Zs6yM+/3ggJiqj26H2wxJOCS5bWM0nPnFrKTVseiZXASpjA9Bm0\nhR/9VImZ1/pOEB8kaaSczvHzjSl5Qk07jvvu+rpIj/S8LL1Cy/AGKsa32UMj\nsSMWkRtPwkEDqDbZrfcRJVfY7BDAEtCyoyAU+Z5cNxMiDf6cd93MvdqKNRvy\nL3/1HPbQVy/4eO3uk1p5iGoF+T1ECBP2Re6tGjPo/O10oW3Ng+axkvmJ2mAY\nMeb5UJFGrw/mSz2l+Gx2fF2WbwDT9uvgJWaHEl/uWPXIRgMHC5vLWeJsmvGt\nGQ2c\r\n=1PcH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEC9fd8JqdV9XmL5khb1QOHpJ4Z1DdQe8oTd5ahgP+X3AiAOgRacM43dqyeHbCe8huSbwLbOOCFUvVzfRVc6TvaXJg=="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-beta.9_1612525984317_0.9979919667016901"},"_hasShrinkwrap":false},"1.0.0-beta.10":{"name":"@fleur/froute","version":"1.0.0-beta.10","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","watch:declarations":"tsc --watch --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","watch:esm":"bili --watch","watch":"run-p -c watch:*","build":"run-p build:*","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","bili":"^5.0.5","jest":"^26.6.3","react":"^17.0.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup":"^2.16.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { useRouter, buildPath } from '@fleur/froute'\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { query: { userId } } = useRouter()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n\n  router.dispose()\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","_id":"@fleur/froute@1.0.0-beta.10","dist":{"shasum":"95b765dbd25301484a4fad947ce5b30d04b12420","integrity":"sha512-77D/nxueGgItqWZM+0ODs9O6hHsymp7ysVPdWzpjmp12fXtzJ49fcbV1cnUmaZ78u6oFl7qCSlUvzqlBsu6H3Q==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-beta.10.tgz","fileCount":22,"unpackedSize":77329,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIiE9CRA9TVsSAnZWagAAf/QP/iXgdlr01lsvKJTx2DHs\naSihdOTZUbjURv9JPa/0oc8x0YtJef2fb4vzXu9s1LR8QOZs6r6sByMH4H31\nRB+3gbGy5emJ1F7kcJklUMOFm/nlaYfwNplqSRi9reUOTUg3d5spq4833lsf\nI9PYt9vdwp2ih/5kzLBjg7GENdACyj01lLbmLhaIG1uZbGvwoxLdS2TyeCtC\nLIbu3WLA0e7/XiUHSRuCNgJz/kX3ctXK2xUqON5FkEBYgB+YOXCox1ll4lZ4\novaX9uw4f+Ryv+lnOxN6eZrjy83TO6FWk+YyNut4+3gPsOa/a1hiOg9kzUu0\nOFuUMsawIOBKCT05J4NRY8Ug95TTjqF8//yPd5z+3vSqPtI5MFWjis62PpsI\nqZcIJRDg55cyzHowsA+UxcB1pm7eWSyv9goUPO1lQ01s2hO8goVDBOmiMyM0\nnXIexnqODJ5VIkT7/YuKuMOtWVX2NWGuQHiJmamr56nKhuUN7tgGoKhbBWOK\n6heCCRWItdkIm9MzCNwABHnOgeUMN+aOXrnJIOG0EM2sCIQA2u9bDPfYpJuy\nYZQwAxu/YMAtALsMnOEZ/aF/wu8x4etwuahSOzw+dvP7HL5H83cJTnmjV3AZ\nExv7F/Pzzt58Lbwy7cvMmZSH21UCJLVx/PLjhIjN/ESvW2zq9SUQES+I16Nw\nLfZQ\r\n=SDNg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGjVSnavcG5yneXAIC1DgzoI3K4/TVYKNS2o8IBXl1klAiBUJbEbOnZCA8aLPA2fxNSotOwQ1kyJIanPz5Qrgda9cw=="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-beta.10_1612849468613_0.8276206616749624"},"_hasShrinkwrap":false},"1.0.0-beta.11":{"name":"@fleur/froute","version":"1.0.0-beta.11","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","watch:declarations":"tsc --watch --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","watch:esm":"bili --watch","watch":"run-p -c watch:*","build":"run-p build:*","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","bili":"^5.0.5","jest":"^26.6.3","react":"^17.0.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup":"^2.16.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { useRouter, buildPath } from '@fleur/froute'\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { query: { userId } } = useRouter()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n\n  router.dispose()\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","_id":"@fleur/froute@1.0.0-beta.11","dist":{"shasum":"91a012172c08effabbe74af3212823547b9e7b99","integrity":"sha512-eVtWK1msVTX1GoWPFOaKUbpEUa28wokzkktVpQUnoPT05JRQzoxeTKBIy1WrE5+Xp3gAmB6vHt2vfiEexc5JMg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-beta.11.tgz","fileCount":22,"unpackedSize":77689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgImE5CRA9TVsSAnZWagAAYDYQAJuYRGH8MdaVgS3Alosk\nIej1tDEJmbECc0dJHTveUbUPS3Q1MJJU9Qkz3QsMmOxrEhG+u/Zt2jKfzbgt\nwG71YHhwkHul25NSs+HsLcb21p+QynFeSruC0X8JzO+Sp4XIC38rIPxji/72\nmEYOQ3OMWPo4P80clJ44ZqduDS2MmMbMmN/tJlZPh39NK35Ntk5gX0CmNuOG\nIxOIWEkYC+6Xu5mRYQN+SQgfv/+eMhwZPvO9LwmQRxn6a5kswAkGoo+A85tW\nI7cd7DBkZK8ZyN8wb1gAFhJs8DgnWklfxVXOfBDJkxiWfl52HBCvCc02Hb91\nYr8VQQOVj16C6u7iD1qgzFimcVMYKiO29WKJvqK3I2OLoCVXsC/5G2olRCM3\np7G3QUwtp6BWGITHorEok++dAZP7O3dJZvQQuMyWJtd+nXDVWSSoUX8Rn0EV\ni62WPQtNfOlypNc7Ex7XDJDocZJ5jbN7zFB8XHEp66mRQoKKrcTcgjs8I2t8\nSHmAGoVyuchFLf34N9k1xaQ6F8tVxJg4Y5W2hKBd2UJXodVeA3pqT5JS6p2N\nZMLajGKAbOt+vOMhGaTYqVsUuhAlcdSwJpzLNv3qjIOm90bH3F8aAI07gKVE\nzvKydgnGVFpyD6ycnSI0EUWA5iLPj4OA4l9ERJJwQEQse8xEqftT/nyPbftn\ndDjk\r\n=LWMj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNX0zvbnQ1QDdzS3WzORqom3y/8e0beWLiYdY38mCNDgIhAMGZ2lKJ89IFM0vWM/CFvrdNbkCyzvqsxdzbEWhLkvov"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-beta.11_1612865848912_0.371482847633247"},"_hasShrinkwrap":false},"1.0.0-beta.12":{"name":"@fleur/froute","version":"1.0.0-beta.12","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","watch:declarations":"tsc --watch --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","watch:esm":"bili --watch","watch":"run-p -c watch:*","build":"run-p build:*","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","bili":"^5.0.5","jest":"^26.6.3","react":"^17.0.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup":"^2.16.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"readmeFilename":"README.md","readme":"# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Example\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { useRouter, buildPath } from '@fleur/froute'\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { query: { userId } } = useRouter()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n\n  router.dispose()\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","_id":"@fleur/froute@1.0.0-beta.12","dist":{"shasum":"d1235aef58d02a488cee55435ad4103094ac39d0","integrity":"sha512-jIfxsBGZg6a0uf9MvcKU8BOFdu+Dd7Sr4iVqzNunIs8bl4vakjggaJoCyYqYc/yQ1XMOhWnT5AK0SMRFOiIjeA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0-beta.12.tgz","fileCount":22,"unpackedSize":75341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI1ocCRA9TVsSAnZWagAA3LIP/juRZNP/oAYUnWsgMrUx\noldObG0MdbxvZZa4Rqk0psRLhhHDXkuJsg+FD9de5tQcC+flls9qWXTab0gT\nRKca5msHnxwDgYm0CVu/bgCJvECvWduDegpT/XeuxDB+DTGEPW3xtV2wyGzM\nMxlMicXAIgyNd7hUP0SvXT7Uwbf3mUTwz2SPQYc82hEw6d8Eaj6CUv0GTTmv\nfcKb4i4xboemEkQ5+jAsbM+w7NZXJeWgc2ai2X+arjVCbjpUKEUxiLJO/x8/\nOWKc36OTE2q9CiOoDWW6IzcIvHyyhpPKDx7PojccLavu7ResPtR7tCCpugPz\niyvnSBGo7paQuuV/npwwhegkeiiBbmNJR601Gho8mWLZu5N9jgrvKnKXV0iC\nS4IpiLdXih/cTCdyVmeHAVvnAKaU7DhXLz7su0QjsRFcsMjdyP9zsf2q0Jy0\nAQBwokl57YgD1qyvrN8wn5T+h8mtzuY7JXzC1T5WwZtbdfON3pgxQUJh+9AB\nUAiftvZFztcMGGG8z1jzduMfYDNP4DK0CiIzYGOhjrthjIcFZ+2JDpDPUzIT\nYf9dXqL0b7w+Is0kiUfpxz5luYxAxekCwewuHLnsvIcnpfS0B9nkF9i2rRJm\nV9LBOKY+L+P2lfRt55bZeUixCSb2WATCkywU563SwiQmfpXmFN9Pl3RZ4fGu\nJ+gU\r\n=l3wf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrZQPSP6peHwbdSU1VhwmEwnnbROHKfjBRYPGYBDGB3QIhAPyRsAgoYKF9c6kZR2BlBgmeYtqvvm91iB0YuYtmhPUg"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0-beta.12_1612929564135_0.219718217658321"},"_hasShrinkwrap":false},"1.0.0":{"name":"@fleur/froute","version":"1.0.0","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","watch:declarations":"tsc --watch --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","watch:esm":"bili --watch","watch":"run-p -c watch:*","build":"run-p build:*","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","bili":"^5.0.5","jest":"^26.6.3","react":"^17.0.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup":"^2.16.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"_id":"@fleur/froute@1.0.0","dist":{"shasum":"a0d47c2edc270760c4d47b0accd0fb28c5b627fa","integrity":"sha512-kiMeDuJ7pQUCpNZREBEQsse5VwONL3QiwVOMyhOij6LUAjlLW44+R+66Xp3H+Xr5yUxZCHpt34PI5KaZwljZMg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.0.tgz","fileCount":22,"unpackedSize":75508,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLNAKCRA9TVsSAnZWagAASckP/1tV7kghePLyy8wintin\ncKZnTfJd1wCtKD8xvHa1Sbl4S8LXTwxXE6I6ZOIqUIF2LukIgzK3bCt8sTDt\n4fjM52C+5Frp1Ubflj2JesczO0+X2+wgx3Yrt+/IPz8OhJl0RbnfbKwZr8Mp\ncir8uHBfaIy+LN6Xq4yIu7bwbKKquAp/VJ/+QkmFMchZ1rXMX6M2PY3llKHk\noso4MZHDkYnWtiihYBC5fSnhrp6EeDDMNa+CL3B/h3dJ3OQ+7E3Pt9U9MpUv\nlt5eGsGoYW4SKIkvV/uT6fzCym6GFcf+b3ay7sizawgDadcdnupfKdm8654/\n2mPbtjVLmy6mE4PzTEv+6AGYHHHuXAor6MwZLgo/kUKoc+Ev/tMALPAQAJK1\nQWbmn7SpLapUQeN0WswjMDE4hfMR+YCjY+rTehpWWxD4SbIqqSNoGQ7zoG+o\nT6R/UmZyfDyjKuBLYpk3Sr5Phm+vHCfBxpox18jOWK4Rt1FMntpNXk/9tLCH\ncMRsI/R/p8GvKpZDxNw5yEr08UDe2lnnNQLC/i6+Z1HtJDAgZk2bxSDEPgt3\nWKDcmh0BRFGWjVV46u7dci7X8GXzR2nwTEvwizyQHWlbbIae1EUwTJplVqZv\n1l0I64CeGmldmLF6+IaYQP2EoSeDyx/eEUq9AFeezd5oarSu5hro4ttMS36L\nbqYL\r\n=MlUf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHm35QlJmylnfSu3a1gCx/ZcIh4tVqKM4IjztJwxSTzQIgL9BvNMmAQC71eVxfJ8eK9O65AOjbtClRbxxZMtCJ28w="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.0_1613549577913_0.036973320088831585"},"_hasShrinkwrap":false},"1.0.1":{"name":"@fleur/froute","version":"1.0.1","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","watch:declarations":"tsc --watch --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","watch:esm":"bili --watch","watch":"run-p -c watch:*","build":"run-p build:*","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.7","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.0","bili":"^5.0.5","jest":"^26.6.3","react":"^17.0.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.1","rollup":"^2.16.1","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"_id":"@fleur/froute@1.0.1","dist":{"shasum":"96252b085ea8dafe836009374de8385945524069","integrity":"sha512-6fnMpCAoDcmoVo/V5Qh2yOKOdEkW77c59PObov5V1fWsLM9Eu3WdptDsURgBZ9Ol+8Cwv3Q2SoxP4SBR4SL0aA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.1.tgz","fileCount":22,"unpackedSize":75615,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgatcbCRA9TVsSAnZWagAAdG8P/jBJMegOVgc75m/zRkH0\nnZsguRjr9owBwwSI9P5YsqUW6XNo6dCsGmmwIAexR9nrzpaYrUWqwyi0rBR0\npFFz4o/jPv8FROMuFz2YN1b9weE5ZITXHsVcFWRtLfOAy9s4VBdvHxqyWARs\nTqJKzfXFom7hW5mHVV7JH/e7Q7rBCYdq1eYFtQoXMpfhNXr8d2ac4o64gpWa\nF832k+j4lncrj3VWGJ1mYaMQ6phyMRRLj+23uzl49L8z1YhRzL/bYHNzlU/G\nIBTxB37zOaJOYdjVIWB9k6MOx5ngijwVt3ls2fZRwRm6Xy3fRFNZBYb4QLpn\nQMim5mOK2pxJwWjj84hoWeLSK/9U7AP5+t6iBzr9hVwjDt7TWWlBCzy6+0Jz\nh4sSW+SxRGWw3j9e8DH4nH1JeGRjNkN8/3SUHWFPQrZlTxP2irP70yNV1Cvf\ndFXW2D5K4fUkQxG9GTa1RS+8C5VV1dtBT8GD1lz/Gxytlj1cucgF8K0RyV6/\n9LDMSFPRp5PBqoC9KDTjkrcEtmBGc674kPYsQfih7LpJOKHV6XCctHLctjBZ\nDKEg3IzJvL2yJMi5zJnkzR/Ev8sIjuN5DiVWdAK0lNtwRiJXUfLXx7leWCg9\nqJk9Lkdo+Joj5munekGZ97xPXE1wW0Ovvqz4qun4xcJkLrz0QgaJGPG+zNec\n0uvE\r\n=ApAF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHd0xuSRM91kzuJ0cSU8sQgbjAP6YwvOlPy1dmNWZSJeAiBMXPX1RoF7AtM1vOCGhhPdcL8PrutTTDGcnzbIg4/mDA=="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"hanakla","email":"hanakla.dev@gmail.com"},{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.1_1617614618522_0.44797719278426706"},"_hasShrinkwrap":false},"1.0.2":{"name":"@fleur/froute","version":"1.0.2","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","watch:declarations":"tsc --watch --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","watch:esm":"bili --watch","watch":"run-p -c watch:*","build":"run-p build:*","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.11","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.38","bili":"^5.0.5","jest":"^26.6.3","react":"^17.0.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.2","rollup":"^2.64.0","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"_id":"@fleur/froute@1.0.2","dist":{"shasum":"79d3a2fe0161cf190680256f83310e205c3c3955","integrity":"sha512-0SSb/A4T1+o27Bg7EzdfScxioqQpxWi1kC1nFt8dlYDl7BJcW7lfNElrrFGVjnqwKOG1Lw3/shWk7nlPVT3a/A==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.2.tgz","fileCount":22,"unpackedSize":75844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKaOgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr1WRAAjVRJqUVYgVgNPUg+T6PZt57jHT0DvTVxAL914FVxjly7Fwnn\r\nnSRDx2jEEJhfGGaQZt5U7jtA3fSzuBc+oS9iOZWGQIoGKh/XNPMZ4Ov4eGqD\r\no3HJ9vmHgs6SVBXYcPjXF9EdA6GH4anuichOuibwP7ejzi1nv4ZKWFk1QZTp\r\nKJiuxj/r0JTR7FjbmZq1oEL3HMPBkVBRn4NhVhOzYmPpXnWfUuGm0gMJ9ESJ\r\n+ajg5QczaaF8wOKV3HeOIHwPPn35/M1xves3teY7+iS5QjNntmu6AyG5OwN2\r\nuauieSPRQ55u5nem2Fhg/y9FaKQmLyfQsIZbpVJDxMtrIQu8HP7ow6m8LB+V\r\ncM/Lkvg5lXsgbj6M0YhnkY0rOnv7+l63q4Ml0AdE8YZiA3XZ6MPtdQKEqtkU\r\ngZYpIaUhirCj9RrUDS7pK/IDcTAiHWn5nPm+O2+6sF9znjFQ4iPycEKhEols\r\nGPcMEOzpo3D9hw3mOF8Z0Pvks94GxPIiOJqmz3frbAVQdc4LxK2FIzpjisKf\r\nPVyxmZHpuSxzZcC4s7FrJHi/+kbfz3sI+OCxgSDtfuX9jOOFFkRDqos4thmI\r\noXK92MFsKCRb2Ph7H0Ik7QR/WSjUk/6w5j/wiaHpJjtjLbabFyORqX8By32w\r\nzbogHxnaoNPuWnTCdom+9XPLPibgpIK3D1E=\r\n=00V0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIELep23zWwr8UCy6mXfYr+6xFjwJ2UnxC6uGfa5Y8msLAiEAwP2sI2BuiKYG+3BBGJ5tMT8QdkNMyghoGAtLdWlb23U="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"},{"name":"hanakla","email":"hanakla.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.2_1646896032405_0.9743740315609948"},"_hasShrinkwrap":false},"1.0.3":{"name":"@fleur/froute","version":"1.0.3","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","watch:declarations":"tsc --watch --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","watch:esm":"bili --watch","watch":"run-p -c watch:*","build":"run-p build:*","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.11","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.38","bili":"^5.0.5","jest":"^26.6.3","react":"^17.0.1","react-dom":"^17.0.1","react-test-renderer":"^17.0.2","rollup":"^2.64.0","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"_id":"@fleur/froute@1.0.3","dist":{"shasum":"966171d53b8f8076f813b95650f3133d729a7a76","integrity":"sha512-uwxH60nzi91qEE3kOZjvjdwnD62yGqCIbFtFYvBnvko4+livtH8laBdx57QzNaD6ymHHIVB1fD4B5VBSAbJ9WA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.3.tgz","fileCount":22,"unpackedSize":75934,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgyf4raIzpueRGCKQav1p3IGobiZJeHyK6C5paNrT/JwIgP1ceMqDxJivqIqh3K0zzUQDqlNwJAf5YA1bFxJZzErg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNrlAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoX3g//ZMMGaKujQWOSrAiSRw4cgB3S0zLZqBhk23U/V1LqyOXnmtnq\r\n4q8SApzWqi4ZOxnogLqFAGmaBJuTKHAexsHACBjWu2j6vZA9A/9a9Oc9hHHN\r\nJTxZM6AslaSbysUvthraWIR0E2QFraZ01VIKH1IWhd2XbgRcEsygV4dX7ET1\r\nW4gGgCdBLiRJm6Lhpq+lXUk7QVV1rF1RurcnTObAUTneOHpxgs9Kv5GcmUUe\r\nfLhpQiMkP1QIOqWrZQpaV9EcWl8L+6R9iZQ4Q8AdiG9Wb1dBQ7C8/NSUVhJT\r\ncXemUq2UOESCM/Oq8dD+cECGGBJ3r3j5L3++suJHASXJHyzsiqkg3iIyLi+b\r\nn1LuzFUOSWucW0TCaF+w5FQoIb1w/rw3NCwzTPFuQ88F9R6g+M+lFDQatVmu\r\nQQR+A24Uo2xT7hmUmxuV6zU16y7vXbw608gTg2qhLZoqSAiQQ5jP8Q8WrOwt\r\n1HgxeKS0MwjtYVekV8O5vkYXdmcm5tXYnI0Qryr4bqpLglGzmc8XGRHusUaW\r\nmNMxymqbbwx5+p34U7pZnhu+2ztgs6mn5eNIvXsahkI+EkFUZu7k04paNznl\r\nwknUo7LmEmDf/tFQORdkF7fp8kAAIjJ1gryZj575lUfUAXj/bVxVubpZ+q6u\r\n9XrrTv8EwrQtNniTqL8oAI6dcKBJ0eqQH1U=\r\n=n/3+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"},{"name":"hanakla","email":"hanakla.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.3_1664530752752_0.2488394710432913"},"_hasShrinkwrap":false},"1.0.4":{"name":"@fleur/froute","version":"1.0.4","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"jest","clean-dist":"rm -rf ./dist","build:declarations":"tsc --emitDeclarationOnly --declaration --outDir ./dist","watch:declarations":"tsc --watch --emitDeclarationOnly --declaration --outDir ./dist","build:esm":"bili","watch:esm":"bili --watch","watch":"run-p -c watch:*","build":"run-p build:*","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.11","@types/jest":"^26.0.19","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.38","bili":"^5.0.5","jest":"^26.6.3","react":"^17.0.2","react-dom":"^17.0.2","react-test-renderer":"^17.0.2","rollup":"^2.64.0","rollup-plugin-typescript2":"^0.29.0","ts-jest":"^26.4.4","tsd":"^0.14.0","typescript":"^4.1.3"},"dependencies":{"history":"^5.0.0","path-to-regexp":"^6.1.0"},"_id":"@fleur/froute@1.0.4","dist":{"shasum":"e9dc882891e767892ec51a2bd4caaf26096b53f3","integrity":"sha512-b6CG8YjHgtTsIRze8bxJeEJaueYIy0bUXGVgNWSvcRbPZScIneqEpLotTtuVZTiZAX7bwuyJSgwCArOh5NsZZg==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.4.tgz","fileCount":22,"unpackedSize":76153,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8swz0qjYYUC26WFC/1WB9EyrFu8S2XTgz0rR0H2S4vQIhAKpDcSM8XopYYomqOvtuOCYiKbk58M2rsKsrDqc5VA0F"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNr/QACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWfA/+Pw7ktDNhkXsRNgMOUJmh4SQmraC2ii1fQO0UEOqOWdl0NEBC\r\nIxCEEs4BlY8U450UnFDONY1qxLAPv31sVKDFwBJSAxCZZYW8xTXC2xeZ2OoB\r\n4kcNO3THsJAq4XCi1XA9oUEqSjZvWqs2GJg9qQwNsszTEjxqMHM3WxrdPIFg\r\n8zFGL2b+QShovlAO1gtjk9IgvI8GQUss5KByF8IaqflKhi2Y4alMUcjOdxA3\r\nLbKRYAkt3AibEFM3cQIchWvPqGfR7B7BVF37W1xK/HWGhH8BWh1UArS1LpE8\r\nj8owyJZ4A/RG6uMxeflvkVElRMvoRAmvPPkalO7PJdqXtUGo0oskRYY57cBa\r\nlZjeUdUQJLaB2TS+TP7dH+MTwfOzqnDmWUNV5PBNKJyQjQVsOefxq/Oy/cG8\r\nBQ/nn7qdskad1ml9eEBIL/QyGWLwIkpBDNp0Mkx2PB9VTVgTsdLLl6KonIcR\r\nHxRM6GpcLnuUwub+KJ5D//Hhmf7H0Pw7OP0acVDkA+HSC+IiYBwoXtZ7bxbx\r\nvEZVNgirf8An+NNE8zg6AIbZbfO//q+FqeZLnTj9BytBl76+i4ituxSey+rG\r\njmI1c7u8gZkoDuCNku7X3Y1XFVncgyYe3kPrnvvLxCw2Rklu/RYh57gnM09G\r\ngYymqMSi5jQlENyC/rWaBUZG/RXkDvIgHZg=\r\n=92sd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"},{"name":"hanakla","email":"hanakla.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.4_1664532432636_0.5133658868649533"},"_hasShrinkwrap":false},"1.0.4-dev.1":{"name":"@fleur/froute","version":"1.0.4-dev.1","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"vitest","clean-dist":"rm -rf ./dist","watch":"vite build --watch","build":"vite build","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.11","@types/node":"^20.1.2","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.38","@typescript-eslint/eslint-plugin":"^5.59.5","@typescript-eslint/parser":"^5.59.5","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","node-stdlib-browser":"^1.2.0","react":"^17.0.2","react-dom":"^17.0.2","react-test-renderer":"^17.0.2","tsd":"^0.14.0","typescript":"^5.0.4","vite":"^4.3.5","vite-plugin-dts":"^2.3.0","vite-plugin-node-stdlib-browser":"^0.2.1","vitest":"^0.31.0"},"dependencies":{"history":"^5.0.0","jsdom":"^22.0.0","path-to-regexp":"^6.1.0"},"volta":{"node":"18.16.0"},"readme":"[npm-url]: https://www.npmjs.com/package/@fleur/froute\n[ci-image-url]: https://img.shields.io/github/workflow/status/fleur-js/froute/CI?logo=github&style=flat-square\n[version-image-url]: https://img.shields.io/npm/v/@fleur/froute?style=flat-square\n[license-url]: https://opensource.org/licenses/MIT\n[license-image]: https://img.shields.io/npm/l/@fleur/froute.svg?style=flat-square\n[downloads-image]: https://img.shields.io/npm/dw/@fleur/froute.svg?style=flat-square&logo=npm\n[bundlephobia-url]: https://bundlephobia.com/result?p=@fleur/froute@2.0.1\n[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/@fleur/froute?style=flat-square\n\n![CI][ci-image-url] [![latest][version-image-url]][npm-url] [![BundleSize][bundlephobia-image]][bundlephobia-url] [![License][license-image]][license-url] [![npm][downloads-image]][npm-url]\n\n# Froute\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Getting started\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { useRouter, buildPath } from '@fleur/froute'\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { query: { userId } } = useRouter()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n\n  router.dispose()\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","readmeFilename":"README.md","gitHead":"a7f54f9fa51d5cf72bbfeeb4b265fc54331aa12f","_id":"@fleur/froute@1.0.4-dev.1","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-chTPsUzdrKiLIdPth+b3C64oQ+Eq/NozoDRaAROhweprUCuiJ8mHwFL+nMW9j+X3GT+jE5V7dRGeU7dUd3E/Aw==","shasum":"784327b51ef16d52287c3c3374950ff1da38adbb","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.4-dev.1.tgz","fileCount":19,"unpackedSize":264296,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDWiugEAn6qiAz4VIA+aaLS7a1oYIdLfMtxdeq8FGyI/AiEAm5Szz2+2U/oq0OWjuXkRxKZPUUf6iIRRHm54jZmRFHE="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"},{"name":"hanakla","email":"hanakla.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.4-dev.1_1683778915964_0.6112240988198256"},"_hasShrinkwrap":false},"1.0.5":{"name":"@fleur/froute","version":"1.0.5","description":"Type safe and flexible router for React","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","homepage":"https://github.com/fleur-js/froute/","author":"Hanakla <hanakla.dev@gmail.com>","license":"MIT","scripts":{"test":"vitest","clean-dist":"rm -rf ./dist","watch":"vite build --watch","build":"vite build","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.11","@types/node":"^20.1.2","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.38","@typescript-eslint/eslint-plugin":"^5.59.5","@typescript-eslint/parser":"^5.59.5","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","node-stdlib-browser":"^1.2.0","react":"^17.0.2","react-dom":"^17.0.2","react-test-renderer":"^17.0.2","tsd":"^0.14.0","typescript":"^5.0.4","vite":"^4.3.5","vite-plugin-dts":"^2.3.0","vite-plugin-node-stdlib-browser":"^0.2.1","vitest":"^0.31.0"},"dependencies":{"history":"^5.0.0","jsdom":"^22.0.0","path-to-regexp":"^6.1.0"},"volta":{"node":"18.16.0"},"_id":"@fleur/froute@1.0.5","gitHead":"60a00ad433bcc2603483d47fb27f50051cb1dd7a","dist":{"shasum":"1ed369997d064f25dae5b22d8e5525746336d046","integrity":"sha512-B4PEC0k+4X8ngubql3reIajGquC6CpSDz665NyrR035QKxNl9dq82xmcZjhOvl50AbmG8XJ/ii71R/quyO1aAA==","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.5.tgz","fileCount":19,"unpackedSize":58453,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC/87LnE8n3R0VfP6p9zvPS/pKhCN2qu5jlcJcddYlD1AiBVesP6XTtByjwUj2+bV435clkh3yFbdiL1oYQD/RIKJw=="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"},{"name":"hanakla","email":"hanakla.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.5_1696332135594_0.7964138623544166"},"_hasShrinkwrap":false},"1.0.7":{"name":"@fleur/froute","version":"1.0.7","description":"Type safe and flexible router for React","repository":{"url":"git+https://github.com/fleur-js/froute.git"},"homepage":"https://github.com/fleur-js/froute/","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"vitest","clean-dist":"rm -rf ./dist","watch":"vite build --watch","build":"vite build","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.11","@types/node":"^20.1.2","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.38","@typescript-eslint/eslint-plugin":"^5.59.5","@typescript-eslint/parser":"^5.59.5","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","node-stdlib-browser":"^1.2.0","react":"^17.0.2","react-dom":"^17.0.2","react-test-renderer":"^17.0.2","tsd":"^0.14.0","typescript":"^5.0.4","vite":"^4.3.5","vite-plugin-dts":"^2.3.0","vite-plugin-node-stdlib-browser":"^0.2.1","vitest":"^0.31.0"},"dependencies":{"history":"^5.0.0","jsdom":"^22.0.0","path-to-regexp":"^6.1.0"},"volta":{"node":"18.16.0"},"_id":"@fleur/froute@1.0.7","gitHead":"a3d64a0304f14533590797a880f7c88870c043d2","bugs":{"url":"https://github.com/fleur-js/froute/issues"},"_nodeVersion":"20.8.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-ASzzmomlNLLoVxKgB/X4B/XP4TAdL6skATI+uji17Dk0BiGvgiwSgqrSDpFGgynBVbIpnBuFOwT5ePw0mgTpbA==","shasum":"c4ae623746d39b682564baff5d7c15823edee974","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.7.tgz","fileCount":19,"unpackedSize":58764,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@fleur%2ffroute@1.0.7","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjuZyIiRUMQzsQG3Xw1uWbbXiHGYB1rApLDpBKIdAFMAIhAIjC/3JPHlU3FvoYptzSuz/D7hkGuEZTZpTE1poULu2W"}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"},{"name":"hanakla","email":"hanakla.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.7_1697171038328_0.10855545360591501"},"_hasShrinkwrap":false},"1.0.8-dev":{"name":"@fleur/froute","version":"1.0.8-dev","description":"Type safe and flexible router for React","repository":{"url":"git+https://github.com/fleur-js/froute.git"},"homepage":"https://github.com/fleur-js/froute/","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"vitest","clean-dist":"rm -rf ./dist","watch":"vite build --watch","build":"vite build","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.11","@types/node":"^20.1.2","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.38","@typescript-eslint/eslint-plugin":"^5.59.5","@typescript-eslint/parser":"^5.59.5","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","node-stdlib-browser":"^1.2.0","react":"^17.0.2","react-dom":"^17.0.2","react-test-renderer":"^17.0.2","tsd":"^0.14.0","typescript":"^5.0.4","vite":"^4.3.5","vite-plugin-dts":"^2.3.0","vite-plugin-node-stdlib-browser":"^0.2.1","vitest":"^0.31.0"},"dependencies":{"history":"^5.0.0","jsdom":"^22.0.0","path-to-regexp":"^6.1.0"},"volta":{"node":"18.16.0"},"_id":"@fleur/froute@1.0.8-dev","readme":"[npm-url]: https://www.npmjs.com/package/@fleur/froute\n[ci-image-url]: https://img.shields.io/github/workflow/status/fleur-js/froute/CI?logo=github&style=flat-square\n[version-image-url]: https://img.shields.io/npm/v/@fleur/froute?style=flat-square\n[license-url]: https://opensource.org/licenses/MIT\n[license-image]: https://img.shields.io/npm/l/@fleur/froute.svg?style=flat-square\n[downloads-image]: https://img.shields.io/npm/dw/@fleur/froute.svg?style=flat-square&logo=npm\n[bundlephobia-url]: https://bundlephobia.com/result?p=@fleur/froute@2.0.1\n[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/@fleur/froute?style=flat-square\n\n![CI][ci-image-url] [![latest][version-image-url]][npm-url] [![BundleSize][bundlephobia-image]][bundlephobia-url] [![License][license-image]][license-url] [![npm][downloads-image]][npm-url]\n\n# Froute\n\n[CHANGELOG](./pkgs/froute/CHANGELOG.md)\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Getting started\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { useRouter, buildPath } from '@fleur/froute'\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { query: { userId } } = useRouter()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n\n  router.dispose()\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","readmeFilename":"README.md","gitHead":"4585ecaffb4afe0e97586368d296fe9aab3a497a","bugs":{"url":"https://github.com/fleur-js/froute/issues"},"_nodeVersion":"20.8.1","_npmVersion":"10.1.0","dist":{"integrity":"sha512-S+a4g/KdTyze5F46HIDEd9Ot15KGbhJQyAbWA4NiB4mQRppKSWu5u0ar1qO6CLLXKwvCYBgqWRpapL3aWRTlCQ==","shasum":"946a486a023dddec66866f138f986296d78afb6d","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.8-dev.tgz","fileCount":19,"unpackedSize":58774,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@fleur%2ffroute@1.0.8-dev","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDzPngNhTh0itM03b6qR77FJHvnw7xmsPkJnv6eAjXdCAiEAixnRDIUW+iW5kFdsuof0mQO1FlcY4b60lacbVJJ0c3g="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"},{"name":"hanakla","email":"hanakla.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.8-dev_1697696982375_0.8805546807124551"},"_hasShrinkwrap":false},"1.0.8":{"name":"@fleur/froute","version":"1.0.8","description":"Type safe and flexible router for React","repository":{"url":"git+https://github.com/fleur-js/froute.git"},"homepage":"https://github.com/fleur-js/froute/","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"vitest","clean-dist":"rm -rf ./dist","watch":"vite build --watch","build":"vite build","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.11","@types/node":"^20.1.2","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.38","@typescript-eslint/eslint-plugin":"^5.59.5","@typescript-eslint/parser":"^5.59.5","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","node-stdlib-browser":"^1.2.0","react":"^17.0.2","react-dom":"^17.0.2","react-test-renderer":"^17.0.2","tsd":"^0.14.0","typescript":"^5.0.4","vite":"^4.3.5","vite-plugin-dts":"^2.3.0","vite-plugin-node-stdlib-browser":"^0.2.1","vitest":"^0.31.0"},"dependencies":{"history":"^5.0.0","jsdom":"^22.0.0","path-to-regexp":"^6.1.0"},"volta":{"node":"18.16.0"},"_id":"@fleur/froute@1.0.8","readme":"[npm-url]: https://www.npmjs.com/package/@fleur/froute\n[ci-image-url]: https://img.shields.io/github/workflow/status/fleur-js/froute/CI?logo=github&style=flat-square\n[version-image-url]: https://img.shields.io/npm/v/@fleur/froute?style=flat-square\n[license-url]: https://opensource.org/licenses/MIT\n[license-image]: https://img.shields.io/npm/l/@fleur/froute.svg?style=flat-square\n[downloads-image]: https://img.shields.io/npm/dw/@fleur/froute.svg?style=flat-square&logo=npm\n[bundlephobia-url]: https://bundlephobia.com/result?p=@fleur/froute@2.0.1\n[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/@fleur/froute?style=flat-square\n\n![CI][ci-image-url] [![latest][version-image-url]][npm-url] [![BundleSize][bundlephobia-image]][bundlephobia-url] [![License][license-image]][license-url] [![npm][downloads-image]][npm-url]\n\n# Froute\n\n[CHANGELOG](./pkgs/froute/CHANGELOG.md)\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Getting started\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { useRouter, buildPath } from '@fleur/froute'\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { query: { userId } } = useRouter()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n\n  router.dispose()\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","readmeFilename":"README.md","gitHead":"80a5fee9d699aa79a9bd4248580df9221330f09f","bugs":{"url":"https://github.com/fleur-js/froute/issues"},"_nodeVersion":"20.8.1","_npmVersion":"10.1.0","dist":{"integrity":"sha512-3GefxxzB7QmqRKA8GD7nFQSOeoap4lkzcydYCfOEQSQdoGCSqy7sSfGeg2wVASvcd3Fz8JnVeoz5IQL48jd3Eg==","shasum":"858376a8b2edc928fd2ec83d0a152cbc7e95a3c2","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.8.tgz","fileCount":19,"unpackedSize":58890,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@fleur%2ffroute@1.0.8","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAKSWIevESuDL9KTk+gGqqSem7OmWVDerk+O85bx4fYSAiEAikNFaF09EXyiWkRHl145VinxSiRwz9ketLzulfTVzQQ="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"},{"name":"hanakla","email":"hanakla.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.8_1697698016509_0.6816923551618697"},"_hasShrinkwrap":false},"1.0.9":{"name":"@fleur/froute","version":"1.0.9","description":"Type safe and flexible router for React","repository":{"url":"git+https://github.com/fleur-js/froute.git"},"homepage":"https://github.com/fleur-js/froute/","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","scripts":{"test":"vitest","clean-dist":"rm -rf ./dist","watch":"vite build --watch","build":"vite build","prepublishOnly":"yarn clean-dist && yarn build"},"peerDependencies":{"react":">= 16.8.x"},"devDependencies":{"@hanakla/rescue":"^1.0.3","@testing-library/react":"^11.2.2","@testing-library/react-hooks":"^3.7.0","@types/history":"^4.7.11","@types/node":"^20.1.2","@types/path-to-regexp":"^1.7.0","@types/react":"^17.0.38","@typescript-eslint/eslint-plugin":"^5.59.5","@typescript-eslint/parser":"^5.59.5","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","node-stdlib-browser":"^1.2.0","react":"^17.0.2","react-dom":"^17.0.2","react-test-renderer":"^17.0.2","tsd":"^0.14.0","typescript":"^5.0.4","vite":"^4.3.5","vite-plugin-dts":"^2.3.0","vite-plugin-node-stdlib-browser":"^0.2.1","vitest":"^0.31.0"},"dependencies":{"history":"^5.0.0","jsdom":"^22.0.0","path-to-regexp":"^6.1.0"},"volta":{"node":"18.16.0"},"_id":"@fleur/froute@1.0.9","gitHead":"ba07a0ed528c4c7ecd36f447867de5b6caf4bf4f","bugs":{"url":"https://github.com/fleur-js/froute/issues"},"_nodeVersion":"20.8.1","_npmVersion":"10.1.0","dist":{"integrity":"sha512-9ZbSjlV1EtHi53amCQ0+QfluPbKt3xWat+izDn9pvzkZVZ7eyCAVom9riACfjw197BhM8JwUIS2yNFGhLJ+YHA==","shasum":"3c111fda8a74512b50f44e0fec59d05ded35634f","tarball":"https://registry.npmjs.org/@fleur/froute/-/froute-1.0.9.tgz","fileCount":19,"unpackedSize":58999,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@fleur%2ffroute@1.0.9","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQfdOrBagw0HbHtkI1LgX+EhKEIu9TOMi8bnNl/I05EgIgFqIV8Ctra0MdpyAqgX9KLe81rSnhOMArsptzqrH8ASQ="}]},"_npmUser":{"name":"hanakla","email":"hanakla.dev@gmail.com"},"directories":{},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"},{"name":"hanakla","email":"hanakla.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/froute_1.0.9_1698027953998_0.6986328583635442"},"_hasShrinkwrap":false}},"time":{"created":"2020-12-17T13:13:12.836Z","0.1.0-pre.1":"2020-12-17T13:13:13.320Z","modified":"2023-10-23T02:25:54.743Z","0.1.0-pre.2":"2020-12-17T13:17:44.723Z","0.1.0-pre.3":"2020-12-17T13:20:53.557Z","0.1.0-pre.4":"2020-12-17T13:36:23.426Z","0.1.0-pre.6":"2020-12-17T14:03:31.888Z","0.1.0-pre.7":"2020-12-17T14:31:49.583Z","0.1.0-pre.8":"2020-12-17T15:12:52.569Z","0.1.0-pre.9":"2020-12-18T08:48:01.977Z","0.1.0-pre.10":"2020-12-18T08:49:40.455Z","0.1.0-pre.11":"2020-12-18T08:51:27.959Z","0.1.0-pre.12":"2020-12-18T09:01:47.446Z","0.1.0":"2020-12-18T09:08:25.530Z","0.2.0-pre.1":"2020-12-24T08:39:23.386Z","0.2.0-pre.2":"2020-12-24T11:39:32.625Z","0.2.0-pre.3":"2020-12-24T12:20:36.835Z","0.2.0-pre.4":"2020-12-24T12:26:15.260Z","0.2.0-pre.5":"2020-12-25T16:09:42.226Z","0.2.0-pre.6":"2020-12-25T16:32:22.774Z","0.2.0-pre.7":"2020-12-25T16:42:38.146Z","0.2.0-dev.8":"2020-12-25T17:05:51.135Z","0.2.0-dev.9":"2020-12-28T08:52:44.043Z","0.2.0-dev.11":"2020-12-29T08:53:54.949Z","0.2.0-dev.12":"2020-12-29T10:23:34.391Z","0.2.0-dev.13":"2020-12-29T11:27:16.772Z","0.2.0-dev.14":"2020-12-29T11:40:17.833Z","0.2.0-dev.15":"2020-12-29T11:45:47.037Z","0.2.0-dev.16":"2020-12-29T11:49:05.675Z","0.2.0-dev.17":"2020-12-29T11:49:41.290Z","0.2.0-dev.18":"2020-12-29T11:58:39.371Z","0.2.0-dev.19":"2020-12-29T13:07:22.296Z","0.2.0-dev.20":"2020-12-29T15:32:35.695Z","0.2.0-dev.21":"2020-12-29T16:20:11.538Z","0.2.0-dev.22":"2020-12-29T16:30:44.627Z","0.2.0-dev.23":"2020-12-29T17:21:34.212Z","0.2.0-beta.1":"2020-12-30T18:34:44.635Z","0.2.0-beta.2":"2021-01-03T16:29:56.410Z","0.2.0-beta.3":"2021-01-03T16:37:34.560Z","0.2.0-beta.4":"2021-01-03T16:54:34.108Z","0.2.0-beta.5":"2021-01-03T17:52:08.796Z","0.2.0-beta.6":"2021-01-03T18:01:12.108Z","0.2.0-beta.7":"2021-01-04T06:29:21.684Z","0.2.0-beta.8":"2021-01-04T06:52:25.987Z","0.2.0-beta.9":"2021-01-05T04:49:00.914Z","0.2.0-beta.10":"2021-01-05T09:19:47.924Z","0.2.0-beta.11":"2021-01-13T16:53:30.499Z","0.2.0-beta.12":"2021-01-16T03:58:44.684Z","1.0.0-dev.1":"2021-01-17T12:00:56.692Z","1.0.0-dev.2":"2021-01-17T14:34:35.647Z","1.0.0-dev.3":"2021-01-17T16:49:03.020Z","1.0.0-dev.4":"2021-01-17T17:00:30.140Z","1.0.0-dev.5":"2021-01-17T17:03:53.486Z","1.0.0-dev.6":"2021-01-17T17:35:54.391Z","1.0.0-dev.7":"2021-01-17T18:07:14.511Z","1.0.0-dev.8":"2021-01-18T16:44:23.043Z","1.0.0-dev.9":"2021-01-18T16:47:32.567Z","1.0.0-dev.10":"2021-01-22T02:24:05.378Z","1.0.0-dev.25":"2021-01-22T06:59:54.632Z","1.0.0-dev.27":"2021-01-23T04:26:24.473Z","1.0.0-dev.28":"2021-01-23T04:41:01.456Z","1.0.0-beta.1":"2021-01-25T06:58:30.640Z","1.0.0-beta.2":"2021-02-02T09:55:49.633Z","1.0.0-beta.3":"2021-02-03T03:45:20.459Z","1.0.0-beta.4":"2021-02-03T07:03:39.711Z","1.0.0-beta.5":"2021-02-03T08:14:03.616Z","1.0.0-beta.7":"2021-02-03T09:33:31.145Z","1.0.0-beta.9":"2021-02-05T11:53:04.547Z","1.0.0-beta.10":"2021-02-09T05:44:28.786Z","1.0.0-beta.11":"2021-02-09T10:17:29.022Z","1.0.0-beta.12":"2021-02-10T03:59:24.301Z","1.0.0":"2021-02-17T08:12:58.164Z","1.0.1":"2021-04-05T09:23:38.728Z","1.0.2":"2022-03-10T07:07:12.576Z","1.0.3":"2022-09-30T09:39:12.941Z","1.0.4":"2022-09-30T10:07:12.824Z","1.0.4-dev.1":"2023-05-11T04:21:56.130Z","1.0.5":"2023-10-03T11:22:15.821Z","1.0.6":"2023-10-13T03:55:14.790Z","1.0.7":"2023-10-13T04:23:58.540Z","1.0.8-dev":"2023-10-19T06:29:42.728Z","1.0.8":"2023-10-19T06:46:56.770Z","1.0.9":"2023-10-23T02:25:54.190Z"},"maintainers":[{"name":"ragg","email":"ragg.devpr@gmail.com"},{"name":"geta6","email":"getakura@gmail.com"},{"name":"fsubal1102","email":"fsubal.1102@gmail.com"},{"name":"hanakla","email":"hanakla.dev@gmail.com"}],"description":"Type safe and flexible router for React","author":{"name":"Hanakla","email":"hanakla.dev@gmail.com"},"license":"MIT","readme":"[npm-url]: https://www.npmjs.com/package/@fleur/froute\n[ci-image-url]: https://img.shields.io/github/workflow/status/fleur-js/froute/CI?logo=github&style=flat-square\n[version-image-url]: https://img.shields.io/npm/v/@fleur/froute?style=flat-square\n[license-url]: https://opensource.org/licenses/MIT\n[license-image]: https://img.shields.io/npm/l/@fleur/froute.svg?style=flat-square\n[downloads-image]: https://img.shields.io/npm/dw/@fleur/froute.svg?style=flat-square&logo=npm\n[bundlephobia-url]: https://bundlephobia.com/result?p=@fleur/froute@2.0.1\n[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/@fleur/froute?style=flat-square\n\n![CI][ci-image-url] [![latest][version-image-url]][npm-url] [![BundleSize][bundlephobia-image]][bundlephobia-url] [![License][license-image]][license-url] [![npm][downloads-image]][npm-url]\n\n# Froute\n\n[CHANGELOG](./pkgs/froute/CHANGELOG.md)\n\nFramework independent Router for React.  \nCan use with both Fleur / Redux (redux-thunk).\n\nWith provides Next.js subset `useRouter`\n\n```\nyarn add @fleur/froute\n```\n\n- [Features](#features)\n- [API Overview](#api-overview)\n  - [Hooks](#hooks)\n  - [Components](#components)\n- [Example](#example)\n- [Next.js compat status](#nextjs-compat-status)\n  - [How to type-safe useRoute](#how-to-type-safe-useroute)\n\n\n## Features\n\nSee all examples in [this spec](https://github.com/fleur-js/froute/blob/master/src/index.spec.tsx) or [examples](https://github.com/fleur-js/froute/tree/master/examples)\n\n- Library independent\n  - Works with Redux and Fleur\n- Next.js's Router subset compatiblity (`useRouter`, `withRouter`)\n- Supports dynamic import without any code transformer\n- Supports Sever Side Rendering\n  - Supports preload\n  - `ResponseCode` and `Redirect` component\n- Custom route resolution (for i18n support)\n- URL Builder\n\n## API Overview\n\n### Hooks\n\n- `useRouter` - **Next.js subset compat hooks**\n  - `withRouter` available\n- `useFrouteRouter` - `useRouter` superset (not compatible to Next.js's `useRouter`)\n- `useRouteComponent`\n- `useBeforeRouteChange(listener: () => Promise<boolean | void> | boolean | void)`\n  - It can prevent routing returns `Promise<false> | false`\n\n<details>\n<summary>Deprecated APIs</summary>\n\nThe following hooks are deprecated. These features are available from `useFrouteRouter`.\n\n- `useParams`\n- `useLocation`\n- `useNavigation`\n- `useUrlBuilder`\n</details>\n\n### Components\n\n- `<Link href={string} />`\n- `<FrouteLink to={routeDef} params={object} query={object} />` - Type-safe routing\n- `<ResponseCode status={number} />`\n- `<Redirect url={string} status={number = 302}`\n\n## Getting started\n\nRoute definition:\n```tsx\nexport const routes = {\n  index: routeOf('/').action({\n    component: () => import('./pages/index'),\n  }),\n  user: routeOf('/users/:userId').action({\n    component: () => import('./pages/user'),\n    preload: (store: Store, params /* => inferred to { userId: string } */) =>\n      Promise.all([ store.dispatch(fetchUser(param.userId)) ]),\n  })\n}\n```\n\nApp:\n```tsx\nimport { useRouteComponent, ResponseCode } from '@fleur/froute'\n\nexport const App = () => {\n  const { PageComponent } = useRouteComponent()\n\n  return (\n    <div>\n      {PageComponent ? (\n        <PageComponent /> \n      ) : (\n        <ResponseCode status={404}>\n          <NotFound />\n        </ResponseCode>\n      )}\n    </div>\n  )\n}\n```\n\nUser.tsx:\n```tsx\nimport { useRouter, buildPath } from '@fleur/froute'\nimport { routes, ResponseCode, Redirect } from './routes'\n\nexport default () => {\n  const { query: { userId } } = useRouter()\n  const user = useSelector(getUser(userId))\n\n  if (!user) {\n    return (\n      <ResponseCode status={404}>\n        <NotFound />\n      </ResponseCode>\n    )\n  }\n\n  if (user.suspended) {\n    return (\n      <Redirect status={301} url='/'>\n        This account is suspended.\n      </Redirect>\n    )\n  }\n  \n  return (\n    <div>\n      Hello, {user.name}!\n      <br />\n      <Link href={buildPath(routes.user, { userId: '2' })}>\n        Show latest update friend\n      </Link>\n    </div>\n  )\n}\n```\n\n\nServer side:\n```tsx\nimport { createRouter } from '@fleur/froute'\nimport { routes } from './routes'\n\nserver.get(\"*\", async (req, res, next) => {\n  const router = createRouter(routes, {\n    preloadContext: store\n  })\n\n  await router.navigate(req.url)\n  await context.preloadCurrent();\n\n  const content = ReactDOM.renderToString(\n    <FrouteContext router={router}>\n      <App />\n    </FrouteContext>\n  )\n\n  // Handling redirect\n  if (router.redirectTo) {\n    res.redirect(router.statusCode, router.redirectTo)\n  } else{\n    res.status(router.statusCode)\n  }\n  \n  const stream = ReactDOM.renderToNodeStream(\n    <Html>\n      {content}\n    </Html>\n  ).pipe(res)\n\n  router.dispose()\n})\n```\n\nClient side:\n```tsx\nimport { createRouter, FrouteContext } from '@fleur/froute'\n\ndomready(async () => {\n  const router = createRouter(routes, {\n    preloadContext: store,\n  });\n\n  await router.navigate(location.href)\n  await router.preloadCurrent({ onlyComponentPreload: true })\n\n  ReactDOM.render((\n      <FrouteContext router={router}>\n        <App />\n      </FrouteContext>\n    ),\n    document.getElementById('root')\n  )\n})\n```\n\n## Next.js compat status\n\n- Compat API via `useRouter` or `withRouter`\n  - Compatible features\n    - `query`, `push()`, `replace()`, `prefetch()`, `back()`, `reload()`\n    - `pathname` is provided, but Froute's pathname is not adjust to file system route.\n  - Any type check not provided from Next.js (Froute is provided, it's compat breaking)\n- Next.js specific functions not supported likes `asPath`, `isFallback`, `basePath`, `locale`, `locales` and `defaultLocale`\n  - `<Link />` only href props compatible but behaviour in-compatible.\n    - Froute's Link has `<a />` element. Next.js is not.\n    - `as`, `passHref`, `prefetch`, `replace`, `scroll`, `shallow` is not supported currently.\n  - `pathname` is return current `location.pathname`, not adjust to component file path base pathname.\n  - `router.push()`, `router.replace()`\n    - URL Object is does not support currentry\n    - `as` argument is not supported\n  - `router.beforePopState` is not supported\n    - Use `useBeforeRouteChange()` hooks instead\n  - `router.events`\n    - Partially supported: `routeChangeStart`, `routeChangeComplete`, `routeChangeError`\n      - Only `url` or `err` arguments.\n      - Not implemented: `err.cancelled` and `{ shallow }` flag.\n    - Not implemented: `beforeHistoryChange`, `hashChangeStart`, `hashChangeComplete`\n \n \n### Why froute provides Next.js compat hooks?\n\nIt aims to migrate to Next.js from react-router or another router.\n\nFroute's `useRouter` aims to provide a `useRouter` that is partially compatible with the Next.js `useRouter`, thereby guaranteeing an intermediate step in the migration of existing React Router-based applications to Next.js.\n\n\n### How to type-safe useRoute\n\nUse this snippet in your app.\n(It's breaking to Type-level API compatibility from Next.js)\n\n```tsx\n// Copy it in-your-app/useRouter.ts\nimport { useRouter as useNextCompatRouter } from '@fleur/froute'\nexport const useRouter: UseRouter = useNextCompatRouter\n```\n\nUsage:\n\n```tsx\n// Route definition\nconst routes = {\n  users: routeOf('/users/:id'),\n}\n\n// Typeing to `Routes`, it's free from circular dependency\nexport type Routes = typeof routes\n\n// Component\nimport { useRouter } from './useRouter'\nimport { Routes } from './your-routes'\n\nconst Users = () => {\n  const router = useRouter<typeof Routes['users']>()\n  router.query.id // It infering to `string`.\n}\n```\n","readmeFilename":"README.md","homepage":"https://github.com/fleur-js/froute/","repository":{"url":"git+https://github.com/fleur-js/froute.git"},"bugs":{"url":"https://github.com/fleur-js/froute/issues"}}