Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(v4): new router bindings (#3591)
* feat(router-picker): add a context value for legacy and new router switch * feat(routing): rename router to `legacy-router` * feat(router): add new router context * feat(router): update router bindings types * feat(resource): update resource types in bindings * refactor(resource): memoize values inside context * feat(core): update refine wrapper with new router * chore(querykeys): nullable id in detail * chore(exports): update router exports as legacy * chore(exports): export resource context * test(mocks): update to legacy router * feat(helpers): add legacy transform for resources * chore(helpers): add resource sanitize helpers * chore(pick-resource): add pick resource helper * chore(redirect): handle undefined cases * chore(route-generator): update legacy helper * chore(router): add route matching and generation helpers * feat(router): add new way of route matching helpers * feat(react-router-v6): update bundle config for `/legacy` exports * chore(react-router-v6): export legacy router from `/legacy` subpath * feat(react-router-v6): add `<RefineRoutes />` component * feat(react-router-v6): add and export bindings * chore(use-navigation): update hook for backward compability and internal use * feat(router): add new router hooks and deprecate legacy * feat(router): update redirection logic in form * feat(router): update use-resource with new bindings * feat(router): update use breadcrumb for new bindings * feat(use-table): update sync with location with new bindings * chore(router): update hooks for undefined resources * test(examples): add test setup for new router bindings * chore(codemod): add router to legacy router codemod * chore(router): add missing exports * feat(codemod): add legacy router option * test(examples): transform all to legacy router * feat(ui-types): add `meta` to buttons * chore(ui-types): remove deprecated access control prop * feat(remix): add new bindings and move to legacy * feat(react-router-v6): update bindings with components * feat(nextjs): move existing routers to legacy * feat(nextjs): add new router bindings for app and pages * feat(core): add `link` to router bindings * feat(core): add new useResource overload * feat(core): update hooks with new bindings * feat(core): add `useToPath` and `useLink` hooks * feat(antd): update components with new router bindings * feat(codemod): update legacy router transformation for all * feat(codemod): add move-deprecated-access-control transformation * feat(codemod): rename to legacy router provider prop * test(inferred-params): add inferred params test * test(core-router): add router helper unit tests * refactor(core): update use-resource usage * chore(core): remove deprecated props * feat(antd): update with new routing * feat(chakra): update with new routing * feat(mantine): update with new routing * feat(mui): update with new routing * feat(hook-form): update with new routing * feat(kbar): update with new routing * chore(inferencer): update with deprecated values * chore(core): remove warnings * test(core): update test wrapper for routers * feat(react-router-v6): add show segment * feat(core): add show segment to default paths * test(core): update hook tests for routers * feat(core): update `useMenu` * chore(core): update type export * chore(core): update route composer * feat(core): update auth hooks for new routing * feat(core): add redirect with new router in authenticated component * chore(core): fix backward compatibly * test(core): fix auth hook tests * chore(core): remove unused mocks * chore(core): remove `react-router-dom` from devDeps * fix(remix): move `qs` to deps * feat(router): add unsaved-changes-notifier comps * feat(core): deprecate layout props * chore(core): replace params to meta * feat(ui): add `meta` to breadcrumbs * fix(core): update router bindings * feat(core): create route on legacy even if not exists * chore(core): replace type export * test(core): transform resources at tests * test(ui-tests): update router * test(core): remove `fit` * test(ui-tests): update button tests * chore(core): allow deprecated options in meta * fix(core): check for route in legacy * fix(antd): update selected key in antd sider * test(antd): update test setup * fix(mui): selectedKey in sider * fix(mui): fix broken show title * fix(core): legacy resource can be undefined * test(mui): update test setup * fix(chakra-ui): variable name * test(chakra-ui): update test setup * fix(mantine): update sider key * test(mantine): update test setup * chore(core): fix lint error * fix(core): update conflicting types * fix(live-previews): rename to legacy * chore(examples): remove obsolete props * test(inferencer): update test setup * test(inferencer): update snapshots * test(ui-tests): fix clone button tests * test(kbar): fix test setup * chore(react-router-dom): upgrade version * fix(react-router-v6): remove unused argument * fix(react-router-v6): fix legacy looping * chore(examples): remove unused import * chore(examples): rename `routerProvider` prop * chore(react-location): mark as private * build: ignore refine-react-location at bootstrapping * build(codemod): fix versions * fix(codemod): update to matching versions * build: remove codemod case * chore(examples): fix undefined error * chore(examples): fix import path * chore(examples): update react-router imports * chore(examples): update `Link` * fix(codemod): add export rename for routers * build(codemod): add `start` script * chore(examples): fix export paths * chore(examples): add fallback * fix(core): use menu return type * chore: exclude react-location * chore(react-location): fix type error * chore: update bootstrap script * chore(examples): fix unknown prop name * chore(examples): fix unexported import * fix(core): useIsAuthenticated hook * fix(core): `Authenticated` component * test(core): update tests * test(react-table): add resource * test(antd): add route inference * test(auth): fix test setups * fix(core): handle undefined return in query function * fix(react-router-v6): skip authentication if not provided * refactor(core): move `patname` in bindings to response * fix(core): authenticated component calls * fix(core): do not include parent prefix in new routing system * fix(core): use table link creation with new routing * fix(core): always pick parent in breadcrumb * fix(antd): use link by router type * feat(sider): add `meta` to sider for menu creation * chore(examples): add new routing example * fix(core): allow additional nested params in parse * feat(core): add form sync with location param type * fix(core): remove console * feat(antd): add `syncWithLocation` to `useDrawerForm` * feat(antd): add `syncWithLocation` to `useModalForm` * feat(mantine): add `syncWithLocation` to `useModalForm` * feat(hook-form): add `syncWithLocation` to `useModalForm` * chore(examples): note `routerBindings` as optional * feat(remix): add `navigate-to-resource` component * fix(nextjs): fix multiple calls in NavigateToResource * refactor(syncWithLocation): use `identifier` when possible * chore(examples): fix lint issue * test(core): parent prefix on legacy and new * chore(examples): remove commented authProvider * chore(examples): fix wrong name * chore(core): remove deprecation mark * fix(react-router-v6): better workaround for usePrompt * fix(core): remove repeated params * fix(nextjs-router): type issue (vercel/next.js#46360) * fix(nextjs): pathname issue * fix(nextjs): wait for router to settle * chore(live-previews): move demo components to legacy router * chore(core): warn users for unknown properties in router provider * chore: add changesets * chore(core): add `identifier` * chore(kbar): add changeset * chore(examples): upgrade `with-nextjs-auth` * chore(changeset): update changesets * chore(examples): fix legacy type import * chore(examples): fix build changes * feat(live-previews): add react-router-dom * chore(live-previews): add memory router replacement
- Loading branch information