Can we make Document.svelte.js a general purpose tool, that can be used outside of Svelte too?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- node.js, typescript
- Domain
- tooling
Research direction
Start by reading Document.svelte.js and the migration script that calls new Document(schema, serialized_doc), then identify which Svelte-specific state and derivation APIs it requires. The issue does not choose between a plain Document.js, separate implementations, or runtime integration, so the completion criteria are not yet defined.
Written by the indexing model from the issue text.
Description
I'd like to use new Document(schema, serialized_doc) from the migration script in Node. However Document.svelte.js requires Vite and the Svelte compiler in place.
To make Document available outside of the Svelte context, we have a few options:
- Turn Document.svelte.js into Document.js (removing all svelte-specific code $state $derived etc.)
- Provide a way to reliably run a "svelte script" (however, I tried vite-node and it has issues as it doesn't exactly replicate the environment of the sveltekit server)
- Move everything into an API endpoint (/api/migrate), so we always stay in the sveltekit environment
- Have migrations hooked up into the server boot process (like when you start the server that it runs migrations, this way we would also stay in the sveltekit environment, but it's a bit implicit, if something breaks you might be stuck)
Aside from our migration script, we may want to provide a toolchain for integration into other frameworks (especially just for displaying Svedit documents) and then a Sveltekit-agnostic Document.js would be amazing.
So here's a few ideas:
- model a "document state POJO" that we can pass from outside to the Document constructor
- OR create an interface AbstractDocument, that has two implementations: ReactiveDocument (for Svelte and the UI), and Document (for plain Node.js)
- Dominant language
- TypeScript
- Stars
- 691
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from michael/svedit
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
bug data-types
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/clickhouse-js#1293 ·
Maintainers usually reply within 1 day
-
area: middleware enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
agent/quality testing
Difficulty 1/5 Under an hour Newbie friendliness 95/100
Maintainers usually reply within 1 day
-
GitHub registry install via `gh` credentials rewrites `\u0000`–`\u001f` escapes in source files to `^@`–`^_`Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
juspay/agent-distro#203 ·
Maintainers usually reply within 1 day