-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: reload controllers on change during development #76
Conversation
72d178e
to
893855d
Compare
Codecov Report
@@ Coverage Diff @@
## master #76 +/- ##
==========================================
- Coverage 92.22% 92.01% -0.22%
==========================================
Files 5 5
Lines 579 576 -3
==========================================
- Hits 534 530 -4
- Misses 45 46 +1
Continue to review full report at Codecov.
|
Codecov is failed for some reason |
Not sure what is that about. 3 lines or so lost coverage but it doesn't seem very relevant. Unless the Nuxt reload triggers during testing and somehow messes with coverage but then I would expect a lot more misses. Also note that this fix is not ideal as changes in imports that the controllers depend on won't trigger reload thus those won't be reflected. But it's still somewhat of an improvement for DX. |
You want to merge it anyway? I can bypass the checks failing and still merge. Let me know |
I'm a bit on the fence. It semi-fixes the issue. Ideally it should be fixed completely but I'm not sure how. I think the imports would have to be static for it to work automatically but that means that those would have to be pre-generated before Nuxt is started or something... I'm fine with not merging this or leaving it open until I have more time to investigate. @pi0 suggested that we talk about solving this for Nitro but not sure in what form the discussion should be. |
Add a watcher so that whole Nuxt is reloaded on changing API routes and changes are applied at runtime.
Also switched to Nuxt's own
resolveAlias
helper instead of custom solution. This is not strictly related to the fix though.Fixes #16