dbos-inc / dbos-transact

The Transactional TypeScript Framework
https://docs.dbos.dev
MIT License
278 stars 19 forks source link

implement and use DBOSJSON instead of JSON #490

Closed demetris-manikas closed 1 month ago

demetris-manikas commented 1 month ago

This PR address #450

I chose the getTime() over toUTCString() since it consumes less space.

demetris-manikas commented 1 month ago

What about using a library? This one looks alive and kicking https://github.com/yahoo/serialize-javascript

qianl15 commented 1 month ago

What about using a library? This one looks alive and kicking https://github.com/yahoo/serialize-javascript

Looks like this package doesn't support Buffer and:

For some use cases you might also need to deserialize the string. This is explicitly not part of this module.

We might find some better suited package later.

demetris-manikas commented 1 month ago

Updated to use DBOSJsonDate as prefix

demetris-manikas commented 1 month ago

Sure. are you sure about the data being a string instead of a number? and if so you want the toUTCString() to be used?

qianl15 commented 1 month ago

Sure. are you sure about the data being a string instead of a number? and if so you want the toUTCString() to be used?

Let's use toISOString() as this is the default format used by JSON.

demetris-manikas commented 1 month ago

Applied all recommendations