Skip to content

[TRI-1375] [TRI-1376] Svelte hooks (like the @trigger.dev/react package) #580

@matt-aitken

Description

@matt-aitken

We have a SvelteKit package (@trigger.dev/sveltekit) which allows you to use Trigger.dev easily with SvelteKit.

We want to add a Svelte package (@trigger.dev/svelte) that adds hooks that can be used from your UI. The functionality will be exactly the same as the React package.

Existing branch that should be used as a starting point

There is a branch where 90% of the work has already been done by @Chigala: https://github.com/triggerdotdev/trigger.dev/tree/feat/svelte-package

What needs to be done still

The current package won't publish to npm

When publish is called, it runs the package script:

"package": "svelte-kit sync && svelte-package && publint",

This fails with an error, which means the package can't be published to npm.

Someone who has experience creating Svelte packages would be ideal, as I'm not sure the best to approach this. How does this relate to tsup which we also have in here? I'm guessing we don't need both but not sure how to achieve this.

  • Get the packaging working, so it can be published to npm

Adding guide docs for the hooks

  • Add a new group to the docs called "UI hooks" that lives in the same place as "React hooks" does now.
  • Add an Introduction page inside UI hooks, that gives an overview of what the UI hooks are (taking contact from the React hooks intro) and then links using two components to the child groups: React hooks and Svelte hooks
  • Add a Svelte hooks guide that is based on the existing React hooks guide pages

Reference in the docs:

Adding SDK reference for the Svelte package

  • Create a reference for the Svelte package that is equivalent to the React package

References:

TRI-1376

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions