-
Notifications
You must be signed in to change notification settings - Fork 7
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
modernize tooling #50
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
Thanks, I'll still wait for Tyler's review before merging EDIT: hang on, there's some weird issue with webpack, with Vite it works. Converting to draft to figure it out EDIT 2: Webpack is so stupid Edit 3: Figure it out, now we bundle all our deps into the index.js. Solves it for webpack as well |
cc @gefjon could you test some of the stuff manually? I think you know it the best |
Putting it back to draft as putting it on |
- Integrate protobufectomy, which replaces our protobuf and json WS message schemas with a SATS-ful schema for both BSATN and JSON. - Notice that this SDK's implementation of JSON had diverged significantly from SpacetimeDB's use of `serde_json` leading to incompatible encodings. Rather than fixing this, remove JSON support in favor of only BSATN. - Rewrite tests to use BSATN WS format. - Also rewrite tests to be closer to legal in a few ways, but not entirely. E.g. don't put floats for `Point` fields with declared type `U16`. - Hoist compression into a WS wrapper so that tests can bypass it. - Update quickstart example for consistent filtering rules changes. - Add `__identity_bytes`/`__address_bytes` getters to `Identity` and `Address` so serialization doesn't need to special-case them. - Run prettier, which inflates this diff somewhat. If I had planned ahead I would have done this separately, but I didn't, and it's too late to separate the functional changes from the formatting now. --------- Co-authored-by: Piotr Sarnacki <[email protected]>
merge conflicts, nuking and going with PR train |
Closes #49.
Builds on top of Phoebe's PR. We can merge it into the PR, or into main once Protobuffectomy's merged into main
Advantages
Reduced files
Before we were shipping entire project structure as is. Now we're shipping just 5 files:
More deterministic
All the dependencies are now moved to devDependencies, which means end-users will not be installing those deps, they're bundled in the index.js file itself.
Required for webpack, and has the benefit of more deterministic end-user installations(If we specify brotli ^1.3 and are using 1.3.3, then only that very specific version gets shipped, whereas before, a user could have been gotten 1.3.4 which could have had a regression and cause errors)
Smaller
Our bundle size as reported was 109KB min+brotli. Now that we control the minification and tree-shaking, it's down to just 85KB min+br. In dev mode, user's bundler will use our unminified build. When building for prod, it will use the existing minified file, which can't get much smaller, so bundler-inconsistencies while minifying are also eliminated. All this is Vite and Parcel specific off-course, Webpack isn't advanced enough for this behavior yet, it will always get the unminified build and try to minify that.
It also uses standard import/export syntax.
What I didn't do: