Web Serialization and SvelteKit: JSON.stringify, Devalue, and Beyond

What is “Web Serialization?”

What is “Web Serialization?”

  • Moving structured data between the client and a web server.

What is “Web Serialization?”

  • Moving structured data between the client and a web server.
  • Transmitting structured data between the client and a web server.

What is “Web Serialization?”

  • Moving structured data between the client and a web server.
  • Transmitting structured data between the client and a web server.
  • Not talking about serialization for data storage.

Who am I?

  • My name is Robert Ismo.
  • I previously did software and machine learning work for a variety small startup companies.
  • I am a board member for a non-profit Agency Economy.
  • Primarily, I work on Email technology. More on that later…

References

What is Serialization?

References

Let’s Make a Banking Application

$1

$1,459,433,188

-$1,376,100,920

We that definitely is not correct…

References

We need some type of contract to solve this!

  • This is called your “Scheme.”

References

References

This is a bigger issue than your types

JavaScript Object Notation (JSON)

References

JSON.stringify and JSON.parse are fast

Why not JSON?

  • Because you are sending some pretty plain data and that is it…

Why is this a problem for SvelteKit?

Devalue

References

Devalue

  • cyclical references
  • repeated references
  • undefined, Infinity, NaN, -0
  • regular expressions
  • dates
  • Map and Set
  • BigInt
  • ArrayBuffer and Typed Arrays
  • URL and URLSearchParams
  • Temporal
  • [[REDACTED]]

Hop into Node!

Limitations of Devalue

  • No Functions
  • No jank prototypes
  • Classes(by default; but also classes suck anyway)

SvelteKit

  • Devalue is actually older than SvelteKit.
  • SvelteKit initially shipped with Devalue v2.0.1.
  • However, this was not integrated into SvelteKit how it is now.

History and some Drama 👀

Warning! EXTREMELY IRRELAVENT NEWS INCOMING

Heavy Free Software user entitlement approaching

If you are a maintainer of any Free and or Open Source Software avert your eyes…

References

This marks the time I first used Svelte for my first professional programming job🎉

Others

References

Until, Finally!

References

This was Already a Feature in Devalue

Funny enough, custom serialization and deserialization in Devalue is actually older than Sveltekit itself.

References

That Concludes My Talk on Devalue

Questions?

Do You Use Email?

Do You Like WebAssembly?

Femail is Launching in Closed Alpha This April

The Femail Email System is a Mail Transfer Agent Powered by WebAssembly

  • Mail Transfer Agent
  • Web Server
  • Name Server

Fully extendable