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

V2: Introduce connect-query-core package #357

Merged
merged 14 commits into from
Oct 31, 2024
Merged

Conversation

paul-sachs
Copy link
Collaborator

@paul-sachs paul-sachs commented Apr 4, 2024

A dedicated connect-query-core package makes it much easier to integrate non-react integrations.

The public API of @connectrpc/connect-query hasn't changed at all, all the same methods and types are exposed, we've just separated them into a distinct package that gets reexported from @connectrpc/connect-query.

This change allows others to depend on connect-query without necessarily depending on react and react-query.

Partially addresses #324

@paul-sachs
Copy link
Collaborator Author

I removed CI support for node 16 since it seems to have a bug with pnpm when running on CI fails due to what I suspect is a weird concurrency issue. I may reintroduce node 16 CI but since it was eol as of 09/2023, it shouldn't be a priority anyways.

@paul-sachs paul-sachs requested a review from smaye81 April 5, 2024 22:46
@paul-sachs paul-sachs marked this pull request as draft April 8, 2024 13:55
@plunkettscott
Copy link

Any idea what it'll take to get this one released? Starting an app that uses Svelte, and I would really love to use the Query package with Svelte, but in the current state it does not work.

@timostamm
Copy link
Member

Any idea what it'll take to get this one released? Starting an app that uses Svelte, and I would really love to use the Query package with Svelte, but in the current state it does not work.

@plunkettscott, we're currently working on support for protobuf-es v2 (see #389). We'll try to get this PR in the next release.

@paul-sachs paul-sachs changed the base branch from main to v2 October 21, 2024 21:10
Signed-off-by: Paul Sachs <psachs@buf.build>
@paul-sachs paul-sachs force-pushed the psachs/connect-query-core branch 2 times, most recently from 0d1bd32 to 8a20cc3 Compare October 21, 2024 21:17
Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
@paul-sachs
Copy link
Collaborator Author

Rebased the branch against v2 so we can consider getting this into an rc.

@paul-sachs paul-sachs changed the title Introduce connect-query-core package V2: Introduce connect-query-core package Oct 21, 2024
Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
@paul-sachs paul-sachs marked this pull request as ready for review October 28, 2024 18:03
packages/connect-query-core/src/index.ts Show resolved Hide resolved
packages/connect-query-core/package.json Outdated Show resolved Hide resolved
packages/connect-query-core/README.md Outdated Show resolved Hide resolved
packages/connect-query-core/proto/bigint.proto Outdated Show resolved Hide resolved
packages/connect-query-core/package.json Show resolved Hide resolved
paul-sachs and others added 4 commits October 29, 2024 14:10
Co-authored-by: Timo Stamm <ts@timostamm.de>
Signed-off-by: Paul Sachs <psachs@buf.build>
Co-authored-by: Timo Stamm <ts@timostamm.de>
Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
Signed-off-by: Paul Sachs <psachs@buf.build>
Copy link
Member

@timostamm timostamm left a comment

Choose a reason for hiding this comment

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

Can we delete packages/connect-query-core/proto?

npx turbo run test -F ./packages/connect-query-core will not re-generate code if packages/test-utils/proto/* changes. Need to fix this. Can probably change turbo.json / generate / dependsOn to ["generate", "^generate"].

I'm not a fan of importing TypeScript from packages. It can have very weird side-effects, for example the tsconfig.json in the package doesn't apply to the code in the package, except for the IDE 🙈

Removed unused protos and made sure generate is triggered on tests

Signed-off-by: Paul Sachs <psachs@buf.build>
@paul-sachs
Copy link
Collaborator Author

@timostamm All good points. Updated and pushed changes.

@paul-sachs
Copy link
Collaborator Author

As for publishing typescript, yeah it can be finicky. I figured for an internal package, it would be fine (since they all inherit the same tsconfig) but i migrated to publish js+dts anyways. I'm just hoping for the deno+jsr based future when all i need to do is write TS and it just works 🪄

@timostamm
Copy link
Member

I'm just hoping for the deno+jsr based future when all i need to do is write TS and it just works 🪄

TypeScript doesn't even use semver, but yes. At least the extra build step is not very distracting with something like turbo.

@paul-sachs paul-sachs merged commit b9b0b8f into v2 Oct 31, 2024
6 checks passed
@paul-sachs paul-sachs deleted the psachs/connect-query-core branch October 31, 2024 18:15
@timostamm timostamm mentioned this pull request Nov 5, 2024
@timostamm timostamm mentioned this pull request Nov 19, 2024
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