Skip to content

refactor(examples): pre-parse frontmatter via scripts/examplegen #9514

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

Merged
merged 3 commits into from
Sep 4, 2023

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Sep 4, 2023

This removes 2 MB from the slim binary.

Ref: #9380

-rwxr-xr-x  2 coder coder  44M Sep  4 12:09 coder-slim_2.1.4-devel+b9f604c58_linux_amd64*
-rwxr-xr-x  1 coder coder  42M Sep  4 12:09 coder-slim_2.1.4-devel+de9b9eb9a_linux_amd64*

This is a proposal. We could decide that these 2 MB are not worth it, or we could look at more light-weight parsing of the frontmatter. This is a trade-off since generating the metadata will add complexity to our pipeline.

I'm also not sold on both calling this file .json and adding the generated by header since this will look like invalid JSON, open to suggestions.

This removes 2 MB from the slim binary.

Ref: #9380
@mafredri mafredri self-assigned this Sep 4, 2023
@mafredri mafredri requested review from kylecarbs and mtojek and removed request for kylecarbs September 4, 2023 12:13
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a nice improvement 👍

I'm also not sold on both calling this file .json and adding the generated by header since this will look like invalid JSON, open to suggestions.

I had a discussion with a fronted engineer some time ago who claimed that JSON comments are VERY normal in the "JavaScript world" :) I guess that we can leave it as is or remove the header comment (pity).

@mafredri mafredri force-pushed the mafredri/refactor-examples-gen branch from f1f56b5 to b3a3e3b Compare September 4, 2023 13:31
@mafredri mafredri merged commit a1025f9 into main Sep 4, 2023
@mafredri mafredri deleted the mafredri/refactor-examples-gen branch September 4, 2023 17:15
@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants