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

Embed theme contents instead of bundle #5443

Merged
merged 6 commits into from
Jan 24, 2025

Conversation

Jacalz
Copy link
Member

@Jacalz Jacalz commented Jan 20, 2025

Description:

This has code modernisation has various benefits. A shallow git clone of the project no longer includes all icons twice (in source and .go file), opening the huge files with bundled stuff no longer cause editors to grind to a halt but most importantly, just editing the file makes the data in the binary change without needing to do anything at all. It is all automatic and cached by the compiler. There is also less text for the compiler to parse so there might be faster compile times (assuming it can just copy the file directly into the binary) but that's just speculation.

Building fyne_demo using go build -ldflags="-s -w" yields:

  • Before: 24224176
  • After: 24255312

Binaries are ever so slightly larger but we are just talking ~30kb so nothing much to write home about.

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

@coveralls
Copy link

coveralls commented Jan 20, 2025

Coverage Status

coverage: 59.117% (+0.08%) from 59.035%
when pulling 346ab2d on Jacalz:embed-theme-contents
into 8726c8b on fyne-io:develop.

@Jacalz
Copy link
Member Author

Jacalz commented Jan 20, 2025

I don't know if it's just me but the workflows did seem to be done quite quickly. I suppose the double file download for that shallow git clone already is paying off? If we can do the same for the font, then I'm quite enthusiastic.

The icons are just a few kilobytes but the emoji font is 4.2mb so that might change something on slow CI runners.

Save the generated file in the repository and only have the script generate it instead of bundling. It is very small anyway.
@andydotxyz
Copy link
Member

Merging to avoid a re-base due to the branch settings change

@andydotxyz andydotxyz merged commit e9ceede into fyne-io:develop Jan 24, 2025
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants