Skip to content

Library-agnostic core #61

Description

@buzinas

Now that the @rocicorp/zero-virtual doesn't depend on TanStack Virtual anymore and has a framework-agnostic core, would you be open to also make its core library-agnostic?

Right now the only thing on core that depends on an external library is types.ts depending on @rocicorp/zero. And the only type that depends on it is already a generic type:

/**
* Return type of a Zero query or query request.
*
* @typeParam TReturn - The type of the query return value
*/
export type GetQueryReturnType<TReturn> = QueryOrQueryRequest<
keyof DefaultSchema['tables'] & string,
// oxlint-disable-next-line no-explicit-any
any, // input
// oxlint-disable-next-line no-explicit-any
any, // output
DefaultSchema,
TReturn,
DefaultContext
>;

This is only used opaquely on core, so we could change it to accept whatever shape of query-return-type the consumer is using – Apollo, React Query, or any other fetching library.

I'm happy to open a PR if y'all are interested!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions