refactor(svelte): Improve integration with sg#64333
Conversation
There couldn't isn't a 'one step' way to start a local Sourcegraph instance with the SvelteKit app. This commit adds `sg start enterprise-sveltekit` to fix that. The changes in https://github.com/sourcegraph/sourcegraph/pull/64272 allow us to run the vite dev server in front of the Sourcegraph instance, instead of building the assets and having them served by frontend. This gives us the benefit of hot module reloading and in general seems to be a less fragile approach. It's basically the same what we do with the React app in development mode.
There was a problem hiding this comment.
I don't think this is necessary or was used a lot.
2254401 to
b5eda5e
Compare
| enterprise-sveltekit: | ||
| checks: | ||
| - docker | ||
| - redis | ||
| - postgres | ||
| - git | ||
| - dev-private | ||
| commands: | ||
| - frontend | ||
| - worker | ||
| - repo-updater | ||
| - web | ||
| - web-sveltekit | ||
| - gitserver-0 | ||
| - gitserver-1 | ||
| - searcher | ||
| - caddy | ||
| - symbols | ||
| - syntax-highlighter | ||
| - zoekt-index-0 | ||
| - zoekt-index-1 | ||
| - zoekt-web-0 | ||
| - zoekt-web-1 | ||
| - blobstore | ||
| - embeddings | ||
| env: | ||
| DISABLE_CODE_INSIGHTS_HISTORICAL: false | ||
| DISABLE_CODE_INSIGHTS: false | ||
| CADDY_FILE: dev/Caddyfile-sveltekit | ||
| # Proxy to the local server | ||
| SOURCEGRAPH_API_URL: http://localhost:3080 |
There was a problem hiding this comment.
I wish there was a better way to just add one command to the existing command set :-/
camdencheek
left a comment
There was a problem hiding this comment.
This looks great -- thank you!
I would really love it if we could get sg start to "just work" as well (including both react and svelte versions of the webapp). Even if HMR doesn't work, it would be nice to have that better represent a real instance.
Yeah. We could certainly just run |
There currently isn't a 'one step' way to start a local Sourcegraph instance with the SvelteKit app.
This commit adds
sg start enterprise-sveltekitto fix that.The changes in https://github.com/sourcegraph/sourcegraph/pull/64272 allow us to run the vite dev server in front of the Sourcegraph instance, instead of building the assets and having them served by frontend.
This gives us the benefit of hot module reloading and in general seems to be a less fragile approach.
It's basically the same what we do with the React app in development mode.
Test plan
sg start enterprise-sveltekitstarts the vite dev server as well as the sourcegraph instance. Navigating tohttps://sourcegraph.test:3443/searchopens the Svelte app (when enabled and logged in). Making a change in a source file updates the web page immediately.sg start web-sveltekit-standalonestill works