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

Vite Dev Server #1

Open
ralphschindler opened this issue Nov 30, 2022 · 3 comments
Open

Vite Dev Server #1

ralphschindler opened this issue Nov 30, 2022 · 3 comments

Comments

@ralphschindler
Copy link

Hi! Thank you for this repository- I learned a lot from it. This is more of a discussion, but do you know what is entailed in making the Vite dev server (not the vite build --watch) work? That basically means Nova would have to be made to work with modules and/or the hot module server part of Vite would have to output modules that know how to _resolveComponent correctly (which I cannot figure out.

@Rezrazi
Copy link
Contributor

Rezrazi commented Dec 3, 2022

Hi Ralph

Thank you for your feedback.

I actually tried tinkering with Vite to get the actual dev server to work. But unfortunately I do not have in depth knowledge about the inner workings of Vite. I have tried just running the server however the file watcher did not seem to pick up my files, so it was useless.
Somehow, with everything set up the way it is in the template, the build --watch works but the vite dev isn't able to watch the files under resources and at some point I just gave up on it as I wasn't able to truly debug the web server and see the files it serves.
Another setback was when I was able to load the tool.ts in the server, but I was unable to use it in Nova as it loads all scripts as regular scripts in the layout.blade.php without any modern transpilation capabilities (the stuff behind the cjs umd esm amd and other stuff which are some things I do not fully understand yet, the JS realms are still a mystery to me)

That being said, I would love for someone to pick it up, and I'd be curious to see them go and try to figure out how to get the Vite dev server to work as we'd really benefit from the HMR features in our dev workflows.

All the best,
Charaf

@ralphschindler
Copy link
Author

I made a repo that demonstrates this problem without Nova so that I could find someone with a deeper knowledge of Vite dev server could help, more notes here: https://github.com/ralphschindler/demo-nova-vite-issue/

@Rezrazi
Copy link
Contributor

Rezrazi commented Dec 5, 2022

This a great in depth dive into this particular behavior. Perhaps opening an issue on the Vite repo can help shed some light into this ?
As you already have a demo repo set up, an answer should be given more efficiently over there.

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

2 participants