-
-
Notifications
You must be signed in to change notification settings - Fork 245
HMR with typescript template #518
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
Comments
@jawa-the-hutt I'm asking you, since you have been working on TS support... Is this supposed to work - or do we need to work on HMR with TS? |
@rigor789 I've just reproduced the error. I will try to fix it tomorrow. |
@rigor789 @jawa-the-hutt, it's very weird, but I noticed that it fails also with the NS angular version. I did the following:
After changing the
|
I think it's time to talk to the NS core team, as maybe the |
I would agree with @msaelices on getting with the NS core team. The only other issue I've had with HMR is what's documented in #503 with changes in |
Issue present with NS6.0 and 2.3.0 as well. App does not refresh at all. |
Hi guys. Any update on this? |
J'ai le même souci avec NS6.0 et Vue2.4.0, la console m'indique ceci '{NSVue (Vue: 2.6.10 | NSVue: 2.4.0)} -> AppendChild(ElementNode(nativestacklayout), ElementNode(nativelabel))' mais dans mon émulateur, rien ne se passe. Si je ferme l'application puis l'ouvre de nouveau alors je vois le changement. Je ne peux pas vraiment travailler ainsi |
I've just checked that I can still reproduce the error with the latest NS versions, both with the Vue and NG bindings. |
Hello, |
I have just created a new project today, and I am receiving this error with latest versions of everything. |
last version still broken AF
either the emulator restart app ( which at least do something ) or it do nothing ( and you have to kill and relaunch debug ) but it never update live |
For me updating main.ts does not work. However... updating a scss file works |
Does it work in those cases without restarting the whole app? |
I had change the file "main.ts" to "main.js" and hmr work correctly |
I migrated a while back and assumed it was something to do with that. It seems to not be working at all now. I'm back to it just restarting the app. I don't really know why to be honest :( The only thing I can think after reading the above is that at one point I may have checked a setting in phpstorm to compile typescript to javascript. 🤷♂️ |
Is there any solution yet? |
@shirakaba mentioned on slack the other day about using From a clean vue typescript project, HMR works when I manipulate these file types:
|
I've done some tests and I've realised that any edits made to main.ts / main.js causes a full restart across all of the nativescript flavours. I didn't know this. 🤦♂️ If there is a .ts file that is then imported into say App.vue and main.ts, then any edit to that imported file will always cause a full restart because it is also in the main.ts file. So I guess that issue is a nativescript issue and not relative to nativescript-vue. It seems for now then it is best to avoid putting things in the main.ts / main.js file if you want HMR to work.
|
@7ammer , thank you for your contribution, I had to test and I was satisfied if we compare the situation before you bring us this clarification. |
Here's my Webpack Config for React NativeScript, in case it gives any inspiration.
In short, yes! I haven't dug into it, but I imagine it's less so an issue with NativeScript but more an issue with the limitations of Webpack HMR, and HMR in general (I believe the same would probably happen in a React DOM app, for example), for updates close to the entrypoint of the app. You could actually probably handle changes even to that file, with the right As a general background, any changes inside Vue components should typically be hot-reloadable; the main exception is when the code that is touched has dependencies on some other module that can't accept the hot update. Changes outside of Vue components (e.g. in the main body of a module) should be hot-reloadable too, again provided that the code that is touched has no dependencies on modules that can't accept the hot update. |
Version
2.2.2
Reproduction link
Just install the default typescript template
Platform and OS info
Android / nativescript 5.4.2
Steps to reproduce
Install typescript version.
Run
npm run android --hmr
.Edit the 'msg' value in the App.vue file.
What is expected?
It hot replaces the 'msg' text without reloading the app.
What is actually happening?
The app reloads.
It looks like it can't HMR because it doesn't understand
.ts
files.The text was updated successfully, but these errors were encountered: