Skip to content

Commit

Permalink
feat: custom index route (#2486)
Browse files Browse the repository at this point in the history
* chore(core): fix filename

* feat(nextjs): add ability to fetch catch-all refine page to useParams

* chore: update `refine-next` example with catch-all route

* refactor(core): update action types

* fix: check `options.route` for `resource.parentName`

* feat(nextjs): add ability to parse catch-all refine route

* chore(refine-next-example): remove unused

* chore: add changesets

* feat(nextjs): add initial route support to nextjs-router

* chore: add initialRoute comment to refine-next

* chore: add eslint ignore for unused vars

* feat(react-router-v6): add `initialRoute` for `routerComponent`

* refactor: replace `React.ReactNode` with `JSX.Element`

* chore: add changesets

* fix(react-router-v6): non declared `this` issue

* chore: upgrade to `@tanstac/react-location`

* feat(react-location): add fallback route support

* feat: add `initialRoute` support

* chore: add changeset

* fix: unused-var `children`

* feat: add `handleRefineParams` helper to `refine-nextjs-router`

* chore: use `handleRefineParams` helper to `refine-nextjs-router`

* chore: add changeset

* feat(remix): add ability to parse splat params for refine

* feat(remix): add ability to change initial route for refine

* chore(react-location): add comment

* chore(remix): update examples with splat

* chore(base): add comment

* chore(examples): move react-location example to top

* docs(examples): update react-location example path

* chore: add changeset

* chore: fix typo

Co-authored-by: Ömer Faruk APLAK <omer@pankod.com>

* fix: `handleRefineParams` return type

* docs(routers): add `initialRoute` section to `router-provider` docs

* docs: add splat and catch-all support to docs

Co-authored-by: Ömer Faruk APLAK <omer@pankod.com>
  • Loading branch information
aliemir and omeraplak committed Sep 22, 2022
1 parent c14fa73 commit ee4d0d1
Show file tree
Hide file tree
Showing 81 changed files with 1,060 additions and 504 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-lemons-mix.md
@@ -0,0 +1,5 @@
---
"@pankod/refine-core": patch
---

Fixed the issue in resource routes not taking `options.route` of parent resource into account.
5 changes: 5 additions & 0 deletions .changeset/calm-lizards-reflect.md
@@ -0,0 +1,5 @@
---
"@pankod/refine-react-router-v6": minor
---

Added ability to manage the initial route of **refine** by binding `initialRoute` variable to `RouterComponent` component.
5 changes: 5 additions & 0 deletions .changeset/dirty-bottles-look.md
@@ -0,0 +1,5 @@
---
"@pankod/refine-nextjs-router": minor
---

Added `handleRefineParams` helper function to handle catch-all refine params.
9 changes: 9 additions & 0 deletions .changeset/famous-items-fetch.md
@@ -0,0 +1,9 @@
---
"@pankod/refine-core": minor
---

Combine action related types into a single file and derive types from it to avoid future inconsistencies.

Renamed `RedirectionTypes` type to `RedirectAction`.

Updated every type definition of actions to use the new `Action` type or derivations of it.
5 changes: 5 additions & 0 deletions .changeset/funny-crabs-compare.md
@@ -0,0 +1,5 @@
---
"@pankod/refine-remix-router": minor
---

Added ability to manage the initial route of **refine** by binding `initialRoute` variable to `RemixRouteComponent` component.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-keys-relax.md
@@ -0,0 +1,5 @@
---
"@pankod/refine-remix-router": minor
---

Add splat route support to remix with `handleRefineParams` helper.
5 changes: 5 additions & 0 deletions .changeset/plenty-suns-wink.md
@@ -0,0 +1,5 @@
---
"@pankod/refine-nextjs-router": minor
---

Added ability to parse catch-all refine route in Next.js router. This way, instead of creating multiple pages, users can only create one page at the root `[[...refine]].tsx` and handle all params for the app.
5 changes: 5 additions & 0 deletions .changeset/poor-keys-rush.md
@@ -0,0 +1,5 @@
---
"@pankod/refine-react-location": minor
---

Added ability to manage the initial route of **refine** by binding `initialRoute` variable to `RouterComponent` component.
5 changes: 5 additions & 0 deletions .changeset/spicy-monkeys-suffer.md
@@ -0,0 +1,5 @@
---
"@pankod/refine-nextjs-router": minor
---

Added ability to manage the initial route of **refine** by binding `initialRoute` variable to `NextRouteComponent` component.
5 changes: 5 additions & 0 deletions .changeset/violet-tigers-call.md
@@ -0,0 +1,5 @@
---
"@pankod/refine-react-location": minor
---

Added support for fallback/404 with `catchAll` and `ErrorComponent`.
19 changes: 11 additions & 8 deletions .eslintrc
Expand Up @@ -8,19 +8,14 @@
},
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"prettier",
"@typescript-eslint"
],
"plugins": ["prettier", "@typescript-eslint"],
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended"
],
"overrides": [
{
"files": [
"*.js"
],
"files": ["*.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
Expand All @@ -32,7 +27,15 @@
"@typescript-eslint/explicit-function-return-type": "off",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"prettier/prettier": "error"
"prettier/prettier": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
]
},
"settings": {
"react": {
Expand Down

2 comments on commit ee4d0d1

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.