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

fix(zero): Do not "bundle" change-protocol #3517

Merged
merged 1 commit into from
Jan 13, 2025
Merged

fix(zero): Do not "bundle" change-protocol #3517

merged 1 commit into from
Jan 13, 2025

Conversation

arv
Copy link
Contributor

@arv arv commented Jan 13, 2025

The server part of zero is not bundled using esbuild. It is just compiled using tsc and the code structure maps the source code structure.

Followup to #3491

The server part of zero is not bundled using esbuild. It is just
compiled using tsc and the code structure maps the source code
structure.

Followup to #3491
@arv arv requested a review from darkgnotic January 13, 2025 09:28
Copy link

vercel bot commented Jan 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
replicache-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 13, 2025 9:29am
zbugs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 13, 2025 9:29am

Copy link

🐰 Bencher Report

Brancharv/zero-build-fix
Testbedlocalhost
Click to view all benchmark results
BenchmarkFile SizeBenchmark Result
kilobytes (KB)
(Result Δ%)
Upper Boundary
kilobytes (KB)
(Limit %)
zero-package.tgz📈 view plot
🚷 view threshold
961.55
(-1.14%)
1,021.25
(94.15%)
zero.js📈 view plot
🚷 view threshold
186.10
(-1.64%)
198.66
(93.68%)
zero.js.br📈 view plot
🚷 view threshold
52.05
(-0.94%)
55.18
(94.34%)
🐰 View full continuous benchmarking report in Bencher

@arv
Copy link
Contributor Author

arv commented Jan 13, 2025

image

@arv arv merged commit 9f3a68b into main Jan 13, 2025
10 checks passed
@arv arv deleted the arv/zero-build-fix branch January 13, 2025 09:42
Copy link
Contributor

@darkgnotic darkgnotic left a comment

Choose a reason for hiding this comment

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

The change-protocol is intended to be an interface between zero-cache and custom upstream providers (like the one @cbnsndwch is building for Mongo). So the intention is allow developers to reference these classes in their implementations, like:

Screenshot 2025-01-09 at 11 15 10

What's the right way to do that?

@arv
Copy link
Contributor Author

arv commented Jan 13, 2025

The code in your screenshot works with this PR.

I think we should change it to:

import {ChangeSourceDownstream} from '@rocicorp/zero/change-protocol/v0';

@darkgnotic
Copy link
Contributor

darkgnotic commented Jan 13, 2025

The code in your screenshot works with this PR.

Ah, got it. So the "exports" in the package.json is all that's needed. Thanks @arv!

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