gadicc / meteor-hmr

Hot Module Replacement for Meteor; in your app, with react, with build plugins
Other
143 stars 10 forks source link

kills cordova #33

Open markshust opened 8 years ago

markshust commented 8 years ago

Installing this module killed running this on Cordova through ios simulator:

2016-04-10 13:28:44.928 FLOW[4829:3786022] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/markshust/Library/Developer/CoreSimulator/Devices/CF28561C-A12F-4100-A5C7-D258DDA9FCB1/data/Containers/Data/Application/8190C74D-6B05-4993-89A3-C06C3AD8E3FC/Library/Cookies/app.binarycookies
2016-04-10 13:28:45.007 FLOW[4829:3786022] Apache Cordova native platform version 4.1.0 is starting.
2016-04-10 13:28:45.007 FLOW[4829:3786022] Multi-tasking -> Device: YES, App: YES
2016-04-10 13:28:45.013 FLOW[4829:3786022] 

Started backup to iCloud! Please be careful.
Your application might be rejected by Apple if you store too much data.
For more information please read "iOS Data Storage Guidelines" at:
https://developer.apple.com/icloud/documentation/data-storage/
To disable web storage backup to iCloud, set the BackupWebStorage preference to "local" in the Cordova config.xml file

2016-04-10 13:28:45.074 FLOW[4829:3786022] Using WKWebView
2016-04-10 13:28:45.076 FLOW[4829:3786022] [CDVTimer][handleopenurl] 0.096977ms
2016-04-10 13:28:45.078 FLOW[4829:3786022] [CDVTimer][intentandnavigationfilter] 2.270043ms
2016-04-10 13:28:45.079 FLOW[4829:3786022] [CDVTimer][gesturehandler] 0.083029ms
2016-04-10 13:28:45.189 FLOW[4829:3786022] Serving asset bundle version: 6997f1e1a4033b7f7110ed97c81f6babe65522c0
[INFO] GCDWebServer started on port 12296 and reachable at http://localhost:12296/
2016-04-10 13:28:45.192 FLOW[4829:3786022] [CDVTimer][webapplocalserver] 113.132000ms
2016-04-10 13:28:45.209 FLOW[4829:3786022] [CDVTimer][statusbar] 16.631007ms
2016-04-10 13:28:45.222 FLOW[4829:3786022] [CDVTimer][splashscreen] 12.573957ms
2016-04-10 13:28:45.224 FLOW[4829:3786022] [CDVTimer][keyboard] 1.572013ms
2016-04-10 13:28:45.225 FLOW[4829:3786022] [CDVTimer][TotalPluginStartup] 148.772001ms
2016-04-10 13:28:46.024 FLOW[4829:3786022] Start downloading asset manifest from: manifest.json -- http://192.168.1.66:3000/__cordova/
2016-04-10 13:28:46.046 FLOW[4829:3786490] Downloaded asset manifest for version: 6997f1e1a4033b7f7110ed97c81f6babe65522c0
2016-04-10 13:29:05.293 FLOW[4829:3786485] App startup timed out, reverting to last known good version

The app just loads black in Cordova after the splash screen is show. If I back out this module and put ecmascript back in, everything works properly.

gadicc commented 8 years ago

Thanks for the report. Regrettably I don't have a cordova setup here and am not familiar with Cordova at all. I'll gladly accept help on this and assist however I can in helping such a person track this down.

gadicc commented 8 years ago

Depending on which release of ecmascript-hot you're using, is it possible you need special permission for the extra port? (If you saw a message like => Starting gadicc:ecmascript-hot server on port 5002. on the server on startup).

markshust commented 8 years ago

@gadicc sorry, I'm a bit ignorant myself on how Cordova works. Given that this is a popular subject and will eventually lead to a true hot component reload developed by mdg, it might make sense to bring the cordova export @martijnwalraven into the loop, as they will probably eventually deal with the same issue.

markshust commented 8 years ago

Oh by the way, this module works pretty great! I've tried a few, and this is the only one that worked out of the box for me. Big 👍

gadicc commented 8 years ago

Thanks! There are still a few smaller issues which are gradually getting fixed up (the fast releases include most of them).

Unfortunately I'm not sure how much @martijnwalraven will be able to help without knowing the meteor-react-hotloader code better, in the same way that this is a problem for me not knowing cordova better. Ideally we need someone who knows both projects quite well. Nevertheless, I'll accept any help I can get :)

P.S. I think the .babelrc support is a prime candidate for inclusion in Meteor. The hotloading stuff however it a bit more complicated. The client side part could be eligible after a lot more work, but the server side stuff, I'm not sure if it's the route I'd recommend for official Meteor.

martijnwalraven commented 8 years ago

@markoshust: Have you tried remote debugging using Safari? I suspect there may be some JavaScript or network errors that cause the app startup to time out.

I don't know the meteor-react-hotloader code, but since it uses an extra port, you should add an App.accessRule for it. Also, because Cordova apps run from localhost on the device, you'll want to make sure to use ROOT_URL to decide what machine to connect to.

markshust commented 8 years ago

@martijnwalraven unfortunately I can't start simulator until the app starts, so that doesn't help here at all.

i tried adding an App.accessRule:

App.accessRule('http://*:3002');

however, it had no effect. I believe these two lines are telling me it's able to connect to port 3000 though?

2016-04-10 13:28:46.024 FLOW[4829:3786022] Start downloading asset manifest from: manifest.json -- http://192.168.1.66:3000/__cordova/
2016-04-10 13:28:46.046 FLOW[4829:3786490] Downloaded asset manifest for version: 6997f1e1a4033b7f7110ed97c81f6babe65522c0

Adding a ROOT_URL=http://localhost:3000 also had no effect.

gadicc commented 8 years ago

I'm also wondering if there could be a false positive on the transform stateless code that could be causing this error. Can you try the latest experimental release gadicc:ecmascript-hot@=1.3.2-fast.13, confirm that it's still not working (there have been a bunch of other changes), and then modify your package.json like:

{
  "ecmascript-hot": {
    "transformStateless": {
      "pathMatch": "NOMATCH",
    }
  }
}

to see if that makes any difference?