Releases: tatemz/remix-strong-routes
Releases · tatemz/remix-strong-routes
v3.2.0
v3.1.0
v3.0.5
v3.0.4
v3.0.3
v3.0.2
v3.0.1
v3.0.0
What Changed?
strongLoader
andstrongAction
functions expose callbackssucceed
,fail
, andredirect
in a well-known object- Moved to
effect
library (away fromfp-ts
) - Expose
useRouteLoaderData
hook alias
Using the New Callbacks
import { strongLoader } from "remix-strong-routes";
const action = strongLoader<BarResponse, FooResponse, RedirectToLogin>(
async ({ context, request, params }, { succeed, redirect, fail }) => {
// ... Same as before
}
);
import { strongAction } from "remix-strong-routes";
const action = strongAction<BarResponse, FooResponse, RedirectToLogin>(
async ({ context, request, params }, { succeed, redirect, fail }) => {
// ... Same as before
}
);
Using the New Hook
import { StrongComponent } from "remix-strong-routes";
const Component: StrongComponent<FooResponse> = (props) => {
const parentRouteData = parentRoute.useRouteLoaderData();
return <></>;
};
v2.0.0
tl;dr
const loader = strongLoader<BarResponse, FooResponse, RedirectResponse>(
async ({ request }, toComponent, toErrorBoundary) => {
const url = new URL(request.url);
if (url.pathname === "/bar") {
return toErrorBoundary(barResponse);
}
if (url.pathname === "/foo") {
return toComponent(fooResponse);
}
return redirectResponse;
}
);
const action = strongAction<BarResponse, FooResponse, RedirectResponse>(
async ({ request }, toComponent, toErrorBoundary) => {
const url = new URL(request.url);
if (url.pathname === "/bar") {
return toErrorBoundary(barResponse);
}
if (url.pathname === "/foo") {
return toComponent(fooResponse);
}
return redirectResponse;
}
);
What Changed
- New helper functions for
strongAction
andstrongLoader
which inject the appropriate success & error callbacks - No more
Errorable
s, we usefp-ts
Either
now. - Added an
.nvmrc
, I originally ran into errors because I was using a different node runtime, causing the snapshots to render differently.