-
-
Notifications
You must be signed in to change notification settings - Fork 49
feat: add initial HMR support for plain JS/TS apps #645
Conversation
@sis0k0 Hey I just tried HMR with {N} + JS.
|
Archive.zip |
File change detected. Starting incremental webpack compilation...
Hash: 729d53ea7a6be0c9c297
Version: webpack 4.6.0
Time: 523ms
Built at: 09/10/2018 6:01:25 PM
Asset Size Chunks Chunk Names
bundle.js 39 KiB bundle [emitted] bundle
bundle.f5f9e0f902bb105191cb.hot-update.js 995 bytes bundle [emitted] bundle
f5f9e0f902bb105191cb.hot-update.json 48 bytes [emitted]
+ 1 hidden asset
[./ sync ^\.\/app\.(css|scss|less|sass)$] . sync nonrecursive ^\.\/app\.(css|scss|less|sass)$ 174 bytes {bundle} [built]
[./ sync recursive (root|page)\.(xml|css|js|ts|scss)$] . sync (root|page)\.(xml|css|js|ts|scss)$ 218 bytes {bundle} [built]
[./main-view-model.js] 769 bytes {bundle} [built]
+ 162 hidden modules
Webpack compilation complete. Watching for file changes.
Webpack build done!
Executing before-shouldPrepare hook from /Users/bradmartin/test-js/hooks/before-shouldPrepare/nativescript-dev-webpack.js
Preparing project...
Executing before-prepareJSApp hook from /Users/bradmartin/test-js/hooks/before-prepareJSApp/nativescript-dev-webpack.js
Project successfully prepared (Android)
Executing after-prepare hook from /Users/bradmartin/test-js/hooks/after-prepare/nativescript-dev-webpack.js
Successfully transferred bundle.js.
Successfully transferred bundle.f5f9e0f902bb105191cb.hot-update.js.
Successfully transferred f5f9e0f902bb105191cb.hot-update.json.
JS: LiveSyncing...
JS: Checking for updates to the bundle.
JS: Hashes don't match. Ignoring second update...
JS: The following modules were updated:
JS: ↻ ./main-view-model.js
JS: ↻ ./main-page.js
Refreshing application...
Successfully synced application org.nativescript.testjs on device emulator-5554.
09-10 18:01:27.446 4034 4034 E AndroidRuntime: at com.tns.Runtime.callJSMethodNative(Native Method)
09-10 18:01:27.446 4034 4034 E AndroidRuntime: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116)
09-10 18:01:27.446 4034 4034 E AndroidRuntime: at com.tns.Runtime.callJSMethodImpl(Runtime.java:996)
09-10 18:01:27.446 4034 4034 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:983)
09-10 18:01:27.446 4034 4034 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:967)
09-10 18:01:27.446 4034 4034 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:959)
System.err: com.tns.NativeScriptException:
System.err: Calling js method onClick failed
System.err:
System.err: TypeError: Cannot read property 'onNavigatingTo' of undefined
System.err: File: "file:///data/data/org.nativescript.testjs/files/app/vendor.js, line: 20084, column: 36
System.err:
System.err: StackTrace:
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame-common.js.FrameBase._onNavigatingTo', file:'file:///data/data/org.nativescript.testjs/files/app/vendor.js', line: 20084, column: 37
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame-common.js.FrameBase.performNavigation', file:'file:///data/data/org.nativescript.testjs/files/app/vendor.js', line: 20056, column: 14
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame-common.js.FrameBase._processNextNavigationEntry', file:'file:///data/data/org.nativescript.testjs/files/app/vendor.js', line: 20049, column: 22
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame.js.Frame._processNextNavigationEntry', file:'file:///data/data/org.nativescript.testjs/files/app/vendor.js', line: 20496, column: 58
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame-common.js.FrameBase.navigate', file:'file:///data/data/org.nativescript.testjs/files/app/vendor.js', line: 19953, column: 14
System.err: Frame: function:'viewModel.onTap', file:'file:///data/data/org.nativescript.testjs/files/app/bundle.f5f9e0f902bb105191cb.hot-update.js', line: 23, column: 19
System.err: Frame: function:'push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify', file:'file:///data/data/org.nativescript.testjs/files/app/vendor.js', line: 3485, column: 32
System.err: Frame: function:'push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit', file:'file:///data/data/org.nativescript.testjs/files/app/vendor.js', line: 3505, column: 18
System.err: Frame: function:'ClickListenerImpl.onClick', file:'file:///data/data/org.nativescript.testjs/files/app/vendor.js', line: 13223, column: 23
System.err:
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:996)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:983)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:967)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:959)
System.err: at com.tns.gen.java.lang.Object_vendor_13216_32_ClickListenerImpl.onClick(Object_vendor_13216_32_ClickListenerImpl.java:17)
System.err: at android.view.View.performClick(View.java:6294)
System.err: at android.view.View$PerformClick.run(View.java:24770)
System.err: at android.os.Handler.handleCallback(Handler.java:790)
System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
System.err: at android.os.Looper.loop(Looper.java:164)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6494)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
same to just confirm, adding a second 'page' (module) called Awesome stuff BTW everyone at NS ❤️ can't describe how happy I am to see this moving. |
@shiv19 and @bradmartin the attached project won't work with |
@vtrifonov please check the Archive I sent, I have tried to navigate to |
Hey @shiv19, we've used the app that you sent and changing the name of |
Oops, sorry about that! Edit: Yes indeed! changing it to |
No description provided.