flightcontrolhq / superjson

Safely serialize JavaScript expressions to a superset of JSON, which includes Dates, BigInts, and more.
https://www.flightcontrol.dev?ref=superjson
MIT License
4.02k stars 87 forks source link

Fix example date type in README #237

Closed tylercollier closed 1 year ago

tylercollier commented 1 year ago

Hopefully it'll save someone else some time

Skn0tt commented 1 year ago

Ha, good catch! I'm curious, what are you using SuperJSON for where you depend on how meta works internally?

Skn0tt commented 1 year ago

@all-contributors please add @tylercollier for docs

allcontributors[bot] commented 1 year ago

@Skn0tt

I've put up a pull request to add @tylercollier! :tada:

tylercollier commented 1 year ago

@Skn0tt Thanks for superjson and accepting the pull request. To answer your question, I went all in on using trpc, including on a project with PHP as the backend, which perhaps is foolish. I didn't see any libraries for TRPC/JSONRPC for PHP so I'm creating the output myself. I added superjson to be able to handle dates, which was easy on the React side but then I had to know more about how superjson's internals to handle the PHP side. And I took that knowledge from the README :-)