Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate to latest sveltekit #70

Closed
mihar-22 opened this issue Jan 5, 2023 · 5 comments
Closed

migrate to latest sveltekit #70

mihar-22 opened this issue Jan 5, 2023 · 5 comments

Comments

@mihar-22
Copy link
Contributor

mihar-22 commented Jan 5, 2023

Re-opening as a new issue (continuation of this PR) because I was unable to fix the Vite server repeatedly restarting. On top of that I can't release because of a bunch of TS issues as few things in SvelteKit are not playing nice with API Extractor.

This migration has been a huge pain and because of my super limited time it's hard to work through it. If anyone wants to have an attempt at fixing it there are some intstructions in linked PR above. The type issues can be seen if run npm run build.

@joshnuss
Copy link

joshnuss commented Jan 5, 2023

Maybe try running vite with debug enabled:

DEBUG=vite:* pnpm dev

davej added a commit to davej/kit-docs that referenced this issue Jan 11, 2023
This still needs to be root caused because I have no idea why this is needed.
It works reliably for me and gets this lib into a usable state with recent versions of Svelte.
@ghost
Copy link

ghost commented Jan 17, 2023

Hey @mihar-22,

I would REALLY love to contribute here, and to the project as a whole, do you have any place that development of this project can be discussed, A discord server, slack channel, or discussions here on GitHub?

I am extremely interested in the goal here, and there is so much potential in this project, I'm going to take a look under the hood at this PR and see if I can help at all, but otherwise is there anything specific you want help with?

@carstenlebek
Copy link
Contributor

carstenlebek commented Feb 2, 2023

Hi @mihar-22,

I have been investigating the issue with the vite server loop and I think I have found the source of the problem. It appears that SvelteKit creates the generated types when the dev server starts and the markdown vite plugin restarts the vite server every time a file is added.

In the markdown vite plugin, the server.watcher is listening for file additions or removals and if either of those events occurs, it will trigger a restart of the vite server.

      server.watcher
        .add(globalComponents)
        .on('add', (path, stats) => {
          console.info('File added', path);
          restart();
        })
        .on('unlink', () => {
          console.info('File removed');
          restart();
        });

The logs indicate that upon initiation of the process to generate types by SvelteKit, the vite server consistently undergoes a restart.

16:06:36 [vite] server restarted.
File added /Users/carsten/Desktop/EigeneProjekte/kit-docs/packages/kit-docs/.svelte-kit/types/src/routes/docs/proxy+page.js
Restarting the server

16:06:36 [vite] server restarted.
File added /Users/carsten/Desktop/EigeneProjekte/kit-docs/packages/kit-docs/.svelte-kit/types/src/routes/docs/proxy+page.js
Restarting the server

16:06:36 [vite] server restarted.
File added /Users/carsten/Desktop/EigeneProjekte/kit-docs/packages/kit-docs/.svelte-kit/types/src/routes/kit-docs/[slug].meta/$types.d.ts
Restarting the server

I have tried commenting out the restart() on the add event and it seems to be working fine, except for the sidebar. Currently, you have to manually refresh the page to make changes to the sidebar visible.

Let me know if this information helps or if you have any further questions. I am here to assist.

@carstenlebek
Copy link
Contributor

@mihar-22 I have submitted a PR #73

kit-docs and kit-docs-demo are successfully building on Vercel.

@mihar-22
Copy link
Contributor Author

mihar-22 commented Feb 4, 2023

We're now officially working with SvelteKit 1.0!!!!!!!!!!!

Thank you so much to:

❤️

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

No branches or pull requests

3 participants