Skip to content

Conversation

@Gerbuuun
Copy link
Collaborator

@Gerbuuun Gerbuuun commented Dec 1, 2025

Zero uses unique symbols for queries on the client and the server.
Running two different versions of zero (the one included in zero-vue and the one of the project) results in different symbols being used on the client and server thus breaking during SSR.

Also removes code to support older zero versions -> min version is 0.24.3... anyways

@socket-security
Copy link

socket-security bot commented Dec 1, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedknip@​5.70.2 ⏵ 5.71.099 +110092 +196 +1100

View full report

@Gerbuuun Gerbuuun changed the title fix: double zero instance fix: double zero instance and drop support for older zero versions Dec 1, 2025
@Gerbuuun Gerbuuun requested review from danielroe and maxstevens-nl and removed request for maxstevens-nl December 1, 2025 20:26
@danielroe
Copy link
Owner

I think the concept was that the user wouldn't install an additional zero version, to ensure this lib was compatible.

I'm happy to move to peer dep though - was there an issue or reason a user would need to access zero separately from this lib?

export { createZeroComposables } from './create-zero-composables'
export type { QueryResult, UseQueryOptions } from './query'
export { useQuery, useQueryWithZero } from './query'
export { useQuery } from './query'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Fine to remove useQueryWithZero, but do we still want to export useQuery? Wouldn't it be confusing that the signature of this useQuery is different than the signature of useQuery returned from createZeroComposables?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, could be. But if you don't want to use / need createZeroComposables then you want to use that import.

@Gerbuuun
Copy link
Collaborator Author

Gerbuuun commented Dec 1, 2025

See my struggles here: https://discord.com/channels/830183651022471199/1444389536766492843

I do now realise this is only because of how a locally installed package is linked (the whole project and thus it's own installed zero).
When released it shouldn't make a difference so I'll revert the peer dep change.

@Gerbuuun Gerbuuun changed the title fix: double zero instance and drop support for older zero versions refactor: remove code for older zero versions Dec 1, 2025
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.

4 participants