Skip to content

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

Merged
mafredri merged 3 commits into
mainfrom
mafredri/refactor-examples-gen
Sep 4, 2023
Merged

mafredri merged 3 commits into
mainfrom
mafredri/refactor-examples-gen

Conversation

@mafredri

@mafredri mafredri commented Sep 4, 2023 •

Copy link
Copy Markdown
Member

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

@mtojek mtojek left a comment

Copy link
Copy Markdown
Member

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