tidev / liveview

Titanium LiveTi (live preview of Titanium applications on device)
Other
7 stars 3 forks source link

[TIMOB-27206] Unable to require files under node_modules #131

Open brentonhouse opened 4 years ago

brentonhouse commented 4 years ago

Note:

There are several areas that I need to investigate to improve performance of this. Right now, it is checking to see if a file exists but is having to do it multiple times for each request because it doesn't know what files exists. I need to get access to (or create) a cache of JS files and native modules so that LiveView can just check this instead of the more time consuming check I implemented.

brentonhouse commented 4 years ago

@ewanharris - Is this PR waiting on anything? LiveView doesn't work without it if you use npm modules at all.

ewanharris commented 4 years ago

@brentonhouse, I just haven't had time to review it yet. I gave preference to Ebenezer's PRs as he will be finishing on our team at the start of next week and I wanted to get him some product development before switching.

What ticket is this PR associated with?

brentonhouse commented 4 years ago

associated with: https://jira.appcelerator.org/browse/TIMOB-27206

ewanharris commented 4 years ago

@brentonhouse I've been trying this out in classic and there seems to be some issues around requiring files. If I create Resources/test.js and then do require('test') an error gets thrown, but require('test.js') works ok.

However if I then rebuild require('test') will work just fine, I'm guessing this is down to the on-device lookup that's performed in the liveview runtime and there being a difference in what gets sent to the liveview server.

I haven't tested yet but I'm going to guess that'll extend to alloy libs too

brentonhouse commented 4 years ago

@ewanharris - I have had to change this around significantly in order for it to work with all the latest code. I ended up just doing the changes in the combined file instead of the split code files so I would work faster and test things easier. I would have to back track this to each of the separate files unless we are finally ready to get rid of those.

ewanharris commented 4 years ago

@brentonhouse, I think I'm fine with removing the multiple files + concat build process. However I don't think it should be done in this PR as it would just add a ton of noise and make it difficult to review the require resolution changes

ewanharris commented 4 years ago

@brentonhouse, if you want. Send me the build/liveview.js you have that's working and I can work on applying the changes back to the right places