remix-fastify

Fastify server request handler for Remix

MIT License

Downloads
21.2K
Stars
154
Committers
20

Bot releases are visible (Hide)

remix-fastify - @mcansh/[email protected] Latest Release

Published by mcansh 6 months ago

Patch Changes

  • a7fcb6d: allows you to customize the cache control for both the files in the build directory as well as your public directory if you need to. using pretty-cache-header under the hood so things like 1y or 30 days will work

    await app.register(remixFastify, {
      assetCacheControl: {},
      defaultCacheControl: {},
    });
    
  • a7fcb6d: fix cache control so that build assets are immutable and cached for 1 year instead of everything being cached for 1 hour

remix-fastify - @mcansh/[email protected]

Published by mcansh 6 months ago

Minor Changes

  • 597df2e: re-introduce plugin for easy configuration, we're still publicly exporting all the pieces, so you can still continue to configure your server as you do today.

    import { remixFastify } from "@mcansh/remix-fastify";
    import { installGlobals } from "@remix-run/node";
    import { fastify } from "fastify";
    
    installGlobals();
    
    let app = fastify();
    
    await app.register(remixFastify);
    
    let port = Number(process.env.PORT) || 3000;
    
    let address = await app.listen({ port, host: "0.0.0.0" });
    console.log(`✅ app ready: ${address}`);
    

    and if you need to configure loadContext, you can do so like this:

    import { remixFastify } from "@mcansh/remix-fastify";
    import { installGlobals } from "@remix-run/node";
    import { fastify } from "fastify";
    
    installGlobals();
    
    let app = fastify();
    
    await app.register(remixFastify, {
      getLoadContext(request, reply) {
        return {};
      },
    });
    
    let port = Number(process.env.PORT) || 3000;
    
    let address = await app.listen({ port, host: "0.0.0.0" });
    console.log(`✅ app ready: ${address}`);
    

Patch Changes

  • 90c6c61: changeset for #324

    bump dependencies to the latest versions

remix-fastify - @mcansh/[email protected]

Published by github-actions[bot] 9 months ago

Patch Changes

  • 9300c22: feat: allow http2/https servers

    previously using fastify({ http2: true }) or fastify({ https: {...} }) resulted in type errors for the handler when passing the request
    image

    this has been fixed by passing the server type to all uses of the request and reply internally
    image

    this PR allows any server that extends http.Server | https.Server | http2.Http2Server | http2.Http2SecureServer;

remix-fastify - @mcansh/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • d11803a: remove criticalCss option from createRequestHandler as it's now handled by the vite plugin in an agnostic way
remix-fastify - @mcansh/[email protected]

Published by github-actions[bot] 11 months ago

Patch Changes

  • add5583: remove criticalCss option from createRequestHandler as it's now handled by the vite plugin in an agnostic way
remix-fastify - @mcansh/[email protected]

Published by github-actions[bot] 11 months ago

Minor Changes

  • 1d708dc2c62c5e29d030d855a78cab4f47604ddd: add support for inlining criticalCss when using the vite plugin
remix-fastify - @mcansh/[email protected]

Published by github-actions[bot] 11 months ago

Minor Changes

  • a5ee9f1: add support for inlining criticalCss when using the vite plugin

example usage: https://github.com/mcansh/remix-fastify/blob/main/examples/unstable-vite/server.js#L66-L95

remix-fastify - @mcansh/[email protected]

Published by github-actions[bot] 11 months ago

Minor Changes

  • f6793b4: remove staticFilePlugin wrapper around @fastify/static as the example is now configured properly to find new files without colliding with remix routes

Patch Changes

  • 8f3093e: update author info, add keywords and funding keys to package.json
  • 25f00c3: bump dependencies to latest
remix-fastify - @mcansh/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • 9560ef1: fix: actually determind requested file
  • 66ba8e5: move glob inside onRequest hook in order for getStaticFiles to be called. doing this allows the removal of node --watch which i totally didn't realize was restarting the server as we import the build 😅
remix-fastify - @mcansh/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • 1484ec4: Uses the normalized path for filePublicPath.
remix-fastify - @mcansh/[email protected]

Published by mcansh about 1 year ago

Major Changes

  • 40e8daa: remove plugin in favor of having server code in server. this allows live reload funcationally of remix dev to work

    you can find an example of the updated server code in /example/server.js

Minor Changes

  • 40e8daa: remove references to fetch polyfills
remix-fastify - @mcansh/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • 4789835: add custom contentParser for json

    fastify automatically configures application/json which prevents fethcer.submit from working with json encoding

remix-fastify - @mcansh/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • 31c3507: feat: require explicit installGlobals call in server entry

    newer versions of node include Request, Response, Headers, fetch, etc globals

remix-fastify - @mcansh/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • b7e5567: chore: move @remix-run/router to deps, bump to latest
remix-fastify - @mcansh/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • c279e3a: return reply from response handler for async work (fastify/compression)
remix-fastify - @mcansh/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • ab24416: fix(plugin): return handler in production
  • d92c468: automatically disable require cache purging when unstable_dev is truthy
remix-fastify - @mcansh/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • d3c16fb: feat: add support for early hints (HTTP 103)
remix-fastify - @mcansh/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • 31f5883: fix for post requests getting aborted
remix-fastify - @mcansh/[email protected]

Published by mcansh over 1 year ago

Minor Changes

  • b52d31b: use tsup for building/bundling, no user facing changes
remix-fastify - @mcansh/[email protected]

Published by mcansh over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/mcansh/remix-fastify/compare/@mcansh/[email protected]...@mcansh/[email protected]