{"id":16596408,"url":"https://github.com/saulwolfdev/piral-test","last_synced_at":"2026-04-16T16:39:43.943Z","repository":{"id":218075590,"uuid":"745522704","full_name":"saulwolfdev/Piral-test","owner":"saulwolfdev","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-19T20:01:42.000Z","size":93,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T04:40:59.446Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saulwolfdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-19T14:18:25.000Z","updated_at":"2024-01-19T20:01:45.000Z","dependencies_parsed_at":"2024-01-19T15:55:01.857Z","dependency_job_id":"ceffe4be-b4a5-480f-afde-e76ca73a5cb3","html_url":"https://github.com/saulwolfdev/Piral-test","commit_stats":null,"previous_names":["saulwolfdev/piral-test"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saulwolfdev%2FPiral-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saulwolfdev%2FPiral-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saulwolfdev%2FPiral-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saulwolfdev%2FPiral-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saulwolfdev","download_url":"https://codeload.github.com/saulwolfdev/Piral-test/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242272780,"owners_count":20100720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T23:53:11.225Z","updated_at":"2026-04-16T16:39:38.923Z","avatar_url":"https://github.com/saulwolfdev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/develop/docs/assets/logo.png)](https://piral.io)\n\n# [Piral Sample](https://piral.io) \u0026middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\n\u003e Sample project to illustrate how a Piral instance using Piral v0.14 can be migrated to use React Router v6.\n\n:zap: Exchange the router and establish the required compatibility level.\n\n## Getting Started\n\nInstall the dependencies:\n\n```sh\nnpm i\n```\n\nNow run the application:\n\n```sh\nnpm start\n```\n\nIt uses the sample pilets. Some of the sample pilets are not supposed to show something since the Pilet API surface was trimmed down to the core level (i.e., no further Piral plugins have been used for this demo).\n\n## More Information\n\nThe sample has been scaffolded with:\n\n```sh\nnpm init piral-instance --framework piral-core --bundler webpack5 --defaults\n```\n\nThen the `react-router` and `react-router-dom` dependencies have been changed to `^6`. The `@types/react-router` and `@types/react-router-dom` packages have been removed. Types are now part of the Router packages.\n\nSince the new router does not rely on `path-to-regexp` the external dependency has been removed. Alternatively, you may want to explicitly add it in the *package.json*. The removal of a core dependency is done via:\n\n```json\n{\n  // ...\n  \"pilets\": {\n    \"externals\": [\n      \"!path-to-regexp\"\n    ],\n    // ...\n  },\n  // ...\n}\n```\n\nFinally, the `src/routerV6.tsx` file contains everything that was done to establish compatibility. The new parts have been integrated via:\n\n```js\nconst instance = createInstance({\n  state: {\n    components: {\n      Router,\n      RouteSwitch,\n    },\n  },\n});\n```\n\nWhen running / building some warnings / errors should be shown, e.g.:\n\n```plain\nWARNING in ./src/routerV6.tsx 7:0-22\nexport 'useHistory' (imported as 'ReactRouter') was not found in 'react-router' (possible exports: MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, Routes, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, createPath, createRoutesFromChildren, generatePath, matchPath, matchRoutes, parsePath, renderMatches, resolvePath, useHref, useInRouterContext, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes)\n @ ./src/index.tsx 4:0-49 34:14-20 35:19-30\n```\n\nRight now these references are still there, but do not matter. Most of them should not be used. For instance, the `./node_modules/piral-core/esm/components/DefaultRouteSwitch.js` is not used as we've explicitly overwritten the route switch.\n\n## Outlook\n\nWith Piral v0.15 the detection of the router will be done automatically. This way you'll be able to just migrate by installing the package that you'd like to use. We detect what version is installed and try to pick the right API.\n\n## License\n\nPiral and this sample code is released using the MIT license. For more information see the [license file](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaulwolfdev%2Fpiral-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaulwolfdev%2Fpiral-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaulwolfdev%2Fpiral-test/lists"}