Skip to content

Support livesync with webpack #3317

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

Closed
rosen-vladimirov opened this issue Jan 11, 2018 · 9 comments
Closed

Support livesync with webpack #3317

rosen-vladimirov opened this issue Jan 11, 2018 · 9 comments
Assignees
Labels
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

Please, provide the details below:

We need to support LiveSync functionality with webpack builds. The idea is to use the webpack's watcher and rebuild the .js files when a change occur.

Which platform(s) does your issue occur on?

Both

@rosen-vladimirov
Copy link
Contributor Author

You can now use LiveSync + Webpack with the following command:

$ tns run <platform> --bundle

NOTE: This requires using the latest version of nativescript-dev-webpack

@IAMtheIAM
Copy link

tns debug <platform> --bundle can we do that? It doesn't seem to support livesync with webpack during Debug sessions

@NickIliev
Copy link
Contributor

@IAMtheIAM the livesync with tns debug <platform> --bundle should work as expected (at least it works on my side with this test application) - let us know if you have troubles and post any details about the used platform and environment details.

@IAMtheIAM
Copy link

@NickIliev Hi again. I cloned that app and did
npm i
tns debug android --bundle

the app then started.

I opened main-page.xml and changed the label text from "Tap the button" to "Tap the button!!"
Saved

The CLI then detected the changed, webpack incrementally compiled, then the app did all its hooks, reinstalled the app on the emulator, and opened the app.

The text unfortunately did not change, so my livesync is busted somehow.

Here is my environment:
tns 4.1.2
nativescript 4.1.2
webpack 4.16.1
typescript 2.7.2
nativescript-angular 6.1.0-rc.0
windows 10
android studio emulator latest, api 28

Is there something else that has to be done to get this working? Thanks for the help again!

@NickIliev
Copy link
Contributor

@IAMtheIAM You are probably hitting this known bug related to API 27 and above. Can you try the same workflow by using a lower API level emulator (e.g API 25).

@IAMtheIAM
Copy link

IAMtheIAM commented Aug 2, 2018

That's great to know! I downgraded to API 25 and it fixed the issue! thanks once again. Incremental compile and reload takes about 30 seconds - better than 3 minutes for a full build, and better than a clean build which takes almost 10 minutes.

Are there any optimizations that could be done to speed up these incremental compilations, such as multi threaded webpack build (aka HappyPack / Thread-Loader) or gradle builds, to get down to around 2-5 seconds reload time?

@tomylee001001
Copy link

@NickIliev is there going to be fix for this issue?
As you know with this goole play do not accept API 25 or lower apps.

@dtopuzov
Copy link
Contributor

Hi @tomylee001001,

Live sync should be ok on all android versions with latest official release.

If you still experience issues, please log an issue and provide as much details as possible.

@NickIliev
Copy link
Contributor

@tomylee001001 Google Play will continue to accept applications that are working on lower API levels. What the blog says and what Google will require is that the targetSdkVersion should be set to API 26 from the 1st of November. This will not restrict the minSdkVersion or the compileSdkVersion and is not related to what device you will use for development (and respectivly for livesync).

The issue with targetSdkVersion is logged here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants