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

Remove more uses of fmt. #478

Merged
merged 4 commits into from
Mar 3, 2023
Merged

Conversation

zenhack
Copy link
Contributor

@zenhack zenhack commented Mar 2, 2023

This patch:

  • Drops a number of String() methods that require use of fmt, or importing the encoding/text subpackage.
  • Avoids use of fmt in the schemas package.

After this patch, tempest's UI only pulls in fmt as a dependency of errgroup. I may look to see if we can avoid errgroup or build a lightweight alternative...

@zenhack
Copy link
Contributor Author

zenhack commented Mar 2, 2023

Actually I think I see a way of doing this without dropping some of these; going to do another pass.

@zenhack zenhack force-pushed the more-fmt-reduction branch from cd4d2c5 to 51a76e4 Compare March 2, 2023 18:32
zenhack added 4 commits March 2, 2023 13:34
We don't really need this, and it pulls in fmt.
We know the type at generation time, so there's no need for this.
@zenhack
Copy link
Contributor Author

zenhack commented Mar 2, 2023

Ok, did another pass which should fix the tests; we now only get rid of the one String() method on StructList. Most others are left in place and instead we remove uses of fmt from encoding/text.

In addition to errgroup, the schemas package still transitively pulls in fmt via compress/zlib. #89 is related; we'd like to make embedding the schema at all optional.

@zenhack
Copy link
Contributor Author

zenhack commented Mar 2, 2023

Note also, this PR drops the size of tempest's WASM blob from 624K to 460K, so that's cool.

@lthibault lthibault merged commit d1d3651 into capnproto:main Mar 3, 2023
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.

2 participants