Observed since 20 Oct, 21:12 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Cloudflare page plugin for tRPC
This plugin allows developers to create tRPC server on Cloudflare Page Function rapidly.
You can see demo site on https://cloudflare-pages-plugin-trpc.pages.dev.
Warning
This plugin is on
tRPC@10.x. It's still in alpha, expect bugs and there're lots of breaking changes.
If you have any tRPC router, just set it into this plugin!
For example, you have router as like as below:
// router.ts
import * as trpc from "@trpc/server";
export const router = trpc.router().query("hello", {
input: z.string().nullish(),
resolve: ({ input }) => {
return `hello ${input ?? "world"}`;
},
});
export type AppRouter = typeof appRouter;
You can deploy it to Cloudflare Pages Function right now.
import { router } from "./router.ts";
import tRPCPlugin from 'cloudflare-pages-plugin';
// That's it!
export const onRequest: PagesFunction = tRPCPlugin({ router });
More practical code deployed to the demo site can be found in the /examples folder.
tRPC is library that allows End-to-end typesafe APIs made easy. There are many resource to explain tRPC concept, history and what it try to resolve, but I highly recommend that you try to quick demo first.
Of course, you can see tRPC document on trpc.io.
I've sometimes contributed tRPC, so I also created a pull request that this plugin into tRPC package, and I discussed @KATT who creator of tRPC and @sachinraja who maintainer of tRPC, and result, it's prefer to provide as individual package.
So, I'll continue to actively follow and maintain tRPC updates.
Write documents
Integrate Cloudflare resources
Testing
I'm considering how test it.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.0.1Registry latest | 6 Oct 2022 | 6 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 21:12 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:e4dc97240423b9372c1b10a382a537ac29a07a40e0c21dde9b4b82c647841cdd