-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
WIP: add dev-server-hmr #685
Conversation
|
We already scan for module imports, you could use the I recommend https://www.npmjs.com/package/dependency-graph to build a graph, I'm using it in the test runner as well. |
2fa8ffd
to
544233c
Compare
small update: i got it all running and hooked up now server-side at least. added a bunch of debug logging and have been stepping through it locally. currently im stuck getting the file watcher to actually watch. i had p.s. the generate tsconfigs script re-ordered the file, if you wondered whats going on with the root tsconfig.json... |
I'm curious will this - if finished work out of the box with lit-elements idea? |
when talking to lars, the idea was that we should ship a base implementation where users can at least consume the HMR API in their client code ( then when peter finishes with his lit implementation we can automatically hook that in for lit consumers. |
Looks great! Would love to hear where you all matched the esm-hmr spec, and where you all differentiated We improved the spec a bunch when vite integrated it, would love to do the same based on your learnings. Can you create an issue on the repo detailing? https://github.com/pikapkg/esm-hmr Also since this is based on esm-hmr code, please license properly: https://github.com/pikapkg/esm-hmr/blob/master/LICENSE |
modern-web is licensed MIT as well, so that should be covered right? |
you can read the MIT license itself to understand what's required, but basically MIT means that the code is free to use however you like as long as you include the license of the original code in any projects that uses it. Including the license is the only requirement. |
in fact i didn't base it on esm-hmr so much in the end after all. so im not sure there's a lot to feedback in regards to the spec. i did however make use of similar models (so we should check the licensing i suppose). the esm-hmr repo doesn't exactly define a "spec" yet as such. it defines some of what the client should do, while defining nothing the server should do. I haven't yet done any of the clientside code for this. when i get around to implementing the client side of this i will open issues in your repo if there is anything we end up diverging on. |
just an update: the client looks to be implemented now. i haven't thoroughly tested it but i have seen it handle an couple of things im stuck with:
|
You should be able to do something along the lines of I want to create a generic HTML maniplation library, but that's something for later. You can write it as TS, and then read that file as a string using |
i rebased onto master and did any remaining pr comments. still need to write some tests and try it out more thoroughly. also tried to use parse5-utils but its types seem a bit weird, irregular exports so the ci build fails |
this now has some kinda docs and a demo which seems to work. i tried the demo, changed the css and saw it update. so all seems fine i would like if one of you can try this out before we merge, though. if anyone is up for that |
it isn't needed to enable the file watcher
a less hacky hack
if anyone does this before i do or better than i do, we can throw this away.
im just having a go and seeing what i end up with.
cc @LarsDenBakker
TODO:
this is heavily inspired by fred's snowpack work and his esm-hmr repo. its clearly not done but here it is to show you where i was heading.