Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename non public exports #4899

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 11 additions & 5 deletions packages/remix-react/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export {
Link,
NavLink,
Form,
RemixEntry,
RemixEntry as UNSAFE_RemixEntry,
PrefetchPageLinks,
LiveReload,
useFormAction,
Expand All @@ -58,8 +58,8 @@ export type { HtmlLinkDescriptor } from "./links";
export type {
ShouldReloadFunction,
HtmlMetaDescriptor,
CatchBoundaryComponent,
RouteModules,
CatchBoundaryComponent as UNSAFE_CatchBoundaryComponent,
RouteModules as UNSAFE_RouteModules,
} from "./routeModules";

export { ScrollRestoration } from "./scroll-restoration";
Expand All @@ -69,6 +69,12 @@ export { RemixServer } from "./server";

export type { Fetcher } from "./transition";

export type { AssetsManifest, EntryContext } from "./entry";
export type {
AssetsManifest as UNSAFE_AssetsManifest,
EntryContext as UNSAFE_EntryContext,
} from "./entry";
export type { RouteData } from "./routeData";
export type { EntryRoute, RouteManifest } from "./routes";
export type {
EntryRoute as UNSAFE_EntryRoute,
RouteManifest as UNSAFE_RouteManifest,
} from "./routes";
32 changes: 17 additions & 15 deletions packages/remix-testing/create-remix-stub.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from "react";
import type {
AssetsManifest,
EntryContext,
EntryRoute,
UNSAFE_AssetsManifest,
UNSAFE_EntryContext,
UNSAFE_EntryRoute,
RouteData,
RouteManifest,
RouteModules,
UNSAFE_RouteManifest,
UNSAFE_RouteModules,
} from "@remix-run/react";
import { RemixEntry } from "@remix-run/react";
import { UNSAFE_RemixEntry } from "@remix-run/react";
import type {
Action,
AgnosticDataRouteObject,
Expand Down Expand Up @@ -75,7 +75,7 @@ type NonIndexStubRouteObject = AgnosticNonIndexRouteObject & {
// TODO: once Remix is on RR@6.4 we can just use the native type
type StubRouteObject = IndexStubRouteObject | NonIndexStubRouteObject;

type RemixConfigFuture = Partial<EntryContext["future"]>;
type RemixConfigFuture = Partial<UNSAFE_EntryContext["future"]>;

export function createRemixStub(
routes: StubRouteObject[],
Expand Down Expand Up @@ -124,7 +124,7 @@ export function createRemixStub(
monkeyPatchFetch(queryRoute, dataRoutes);

return (
<RemixEntry
<UNSAFE_RemixEntry
context={remixContext}
action={state.action}
location={state.location}
Expand All @@ -140,7 +140,7 @@ function createRemixContext(
initialLoaderData?: RouteData,
initialActionData?: RouteData,
future?: RemixConfigFuture
): EntryContext {
): UNSAFE_EntryContext {
let manifest = createManifest(routes);
let matches = matchRoutes(routes, currentLocation) || [];

Expand All @@ -164,7 +164,9 @@ function createRemixContext(
};
}

function createManifest(routes: AgnosticDataRouteObject[]): AssetsManifest {
function createManifest(
routes: AgnosticDataRouteObject[]
): UNSAFE_AssetsManifest {
return {
routes: createRouteManifest(routes),
entry: { imports: [], module: "" },
Expand All @@ -175,9 +177,9 @@ function createManifest(routes: AgnosticDataRouteObject[]): AssetsManifest {

function createRouteManifest(
routes: AgnosticDataRouteObject[],
manifest?: RouteManifest<EntryRoute>,
manifest?: UNSAFE_RouteManifest<UNSAFE_EntryRoute>,
parentId?: string
): RouteManifest<EntryRoute> {
): UNSAFE_RouteManifest<UNSAFE_EntryRoute> {
return routes.reduce((manifest, route) => {
if (route.children) {
createRouteManifest(route.children, manifest, route.id);
Expand All @@ -189,8 +191,8 @@ function createRouteManifest(

function createRouteModules(
routes: AgnosticDataRouteObject[],
routeModules?: RouteModules
): RouteModules {
routeModules?: UNSAFE_RouteModules
): UNSAFE_RouteModules {
return routes.reduce((modules, route) => {
if (route.children) {
createRouteModules(route.children, modules);
Expand Down Expand Up @@ -247,7 +249,7 @@ function monkeyPatchFetch(
function convertToEntryRoute(
route: AgnosticDataRouteObject,
parentId?: string
): EntryRoute {
): UNSAFE_EntryRoute {
return {
id: route.id!,
index: route.index,
Expand Down