Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve serialization #29

Closed
sdorra opened this issue Mar 30, 2024 · 2 comments · Fixed by #125
Closed

Improve serialization #29

sdorra opened this issue Mar 30, 2024 · 2 comments · Fixed by #125
Labels
enhancement New feature or request

Comments

@sdorra
Copy link
Owner

sdorra commented Mar 30, 2024

At the time of writing, content-collections serialize the generated documents as JSON. The problem with this approach is that JSON has a limited set of data types (string, number, boolean, null, object, or array), and this is why the generated documents have only those data types as well (#21).

It would be nice if data types such as Date could be used as part of the document as well. We could possibly achieve this by using a library such as serialize-javascript instead of JSON.stringify.

@sdorra sdorra added the enhancement New feature or request label Mar 30, 2024
@sdorra sdorra changed the title Improve serialisation Improve serialization Mar 30, 2024
@mustaqimarifin
Copy link

would structuredClone() work?

@sdorra
Copy link
Owner Author

sdorra commented May 27, 2024

I'm not sure what you mean. Do you mean the use of structuredClone() instead of a switch to a another serialization method? Or if it work after the switch?

sdorra added a commit that referenced this issue Jun 1, 2024
Bundle all json serialization related code into its own module
sdorra added a commit that referenced this issue Jun 6, 2024
Bundle all json serialization related code into its own module
sdorra added a commit that referenced this issue Jun 6, 2024
Bundle all json serialization related code into its own module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants