Skip to content

Releases: tatemz/remix-strong-routes

v3.2.0

29 Nov 15:46
Compare
Choose a tag to compare

v3.1.0

14 Aug 22:17
Compare
Choose a tag to compare

What changed?

  • The resulting type of buildStrongRoute now has a strongly typed routeId property string

v3.0.5

04 Aug 19:16
Compare
Choose a tag to compare

What's Changed?

Make effect a peer dep

v3.0.4

31 Jul 14:55
Compare
Choose a tag to compare

What Changed?

Updated to use effect Either type under the hood

v3.0.3

28 Jul 20:13
Compare
Choose a tag to compare

What Changed

Bugfix for the StrongLoader & StrongAction types.

v3.0.2

28 Jul 19:37
Compare
Choose a tag to compare

What Changed?

  • Bug fixes around types
  • Better organized namespace and exports

v3.0.1

28 Jul 15:55
Compare
Choose a tag to compare
3.0.1

v3.0.0

28 Jul 13:43
Compare
Choose a tag to compare

What Changed?

  • strongLoader and strongAction functions expose callbacks succeed, fail, and redirect in a well-known object
  • Moved to effect library (away from fp-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

12 Jul 20:39
Compare
Choose a tag to compare

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 and strongLoader which inject the appropriate success & error callbacks
  • No more Errorables, we use fp-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.

v1.3.0

07 Jul 14:42
Compare
Choose a tag to compare

Added Errorable helper methods and documented a pattern to leverage the types in StrongLoader to harden returns.