Blitz: Integrate superjson serialization & deserialization to the RPC layer

Created on 22 Jul 2020  路  9Comments  路  Source: blitz-js/blitz

What do you want and why?

Switch to use superjson instead of JSON.stringify and result.json().

Possible implementation(s)

Relevant files:

Additional context

Related #700

good second issue statudone

All 9 comments

This sounds interesting, I'd love to take it as second issue if everything works as expected in my previous PR :)

@robertgrzonka awesome!

While SuperJSON is a lot more capable than normal JSON, there's still some stuff that's not supported:

  • Map with non-uniform key types
  • Map with complex key types
  • ES6 Classes
  • potentially more ...

We'll have to address these limitations in the Docs to prevent high expectations to burn. I'd be down to write the Docs for this! :D

No problem, because they will be able to do a lot more than they can now!! :)

@robertgrzonka How鈥檚 this going? 馃槃

Btw, I just published superjson 1.1.0 which has bug fixes you will want :)

@robertgrzonka have you started on this? I need it finished within a day, so I can take over if you want!

While SuperJSON is a lot more capable than normal JSON, there's still some stuff that's not supported:

Forget about this - SuperJSON will support all of these in the coming days ^^ Maybe I'm a bit over-confident, but I don't think users will notice any edge cases once Blitz.js properly integrated SuperJSON. No Docs required then ;D

Hey @robertgrzonka, I'm going ahead and working on this. Hopefully you hadn't started 馃槵 I'm really sorry about this. I didn't realize I needed this so suddenly this week 馃槙. Hopefully there's no hard feelings!

Was this page helpful?
0 / 5 - 0 ratings