@everyone, convex@1.25.0 is out and there are some important things to know when upgrading!
See https://github.com/get-convex/convex-js/blob/main/CHANGELOG.md#1250 for full details but I wanted to make sure everyone knows about some changes that could have an impact when upgrading:
🧩 You'll need to upgrade any Convex components you use as well when you upgrade to this client version.
🗜️ Deployed code will be smaller via minifying code and setting
NODE_ENV
to "production" during bundling, which means different (usually smaller, faster) code will now be deployed in Convex functions if you use a library that uses separate development and production bundles
🫷 ConvexHttpClient mutations are now queued by default (they are requested one after another) making it safer to switch between the HTTP client and WebSocket clients which have always had this behavior. It's still possible to run mutations in parallel if you need this, see the changelog for how if you see a slowdown in e.g. admin scripts that use the ConvexHttpClient to make many dozens of requests at once.
🔒 A console.warn() fires when convex function implementations are imported in the browser; this is something you ~never want (and may want to avoid: users could see possible secret implementation details in your code if it's bundled into the browser) and it should be easy to prevent, but you may need to trace through imports to see why this is happening.
🔎 New TypeScript types require that optimistic updates do not return promises. This makes optimistic updates harder to use incorrectly but could cause red squigglies in existing code if you're already doing this.
If you run into anything unexpected please let us know. We tested this one as an alpha for a while but with the diverse ways the community uses Convex it's likely there's something we haven't anticipated. Thanks all!GitHub
convex-js/CHANGELOG.md at main · get-convex/convex-js
TypeScript/JavaScript client library for Convex. Contribute to get-convex/convex-js development by creating an account on GitHub.
2 Replies
A console.warn() fires when convex function implementations are imported in the browserThis is a great safeguard—I’d definitely want to avoid this in production. For tests, though, I have a use case where I run UI tests in the browser using a mock convex client with the convex-test library. This lets my UI components exercise the real API in an actual browser environment, but it also means my convex server code ends up running in the browser during testing. Would it be possible to provide a way to suppress this warning (and any future error) in test environments? That would make it easier to maintain these types of tests without extra noise.
Yep there's a way to do this, see https://github.com/get-convex/convex-js/blob/09388286f91bf9cb82688dcca40533fe90c98c3a/src/server/impl/registration_impl.ts#L124-L130, didn't announce it because for most users the correct action is to fix it.