Skip to content

Combine JavaScript files in a single file in release builds #489

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
jasssonpet opened this issue May 19, 2015 · 9 comments
Closed

Combine JavaScript files in a single file in release builds #489

jasssonpet opened this issue May 19, 2015 · 9 comments
Labels

Comments

@jasssonpet
Copy link
Contributor

On iPhone 5 about 50ms of 980ms of the startup time of the Cuteness sample (and similar on Android) is spent for requiring JavaScript modules.

This could be reduced if we combine (and optionally minify) all used JavaScript modules in release build.

@ligaz
Copy link

ligaz commented May 24, 2015

This could be somehow related to the transpilers support #493

@teobugslayer
Copy link
Contributor

Maybe we can work with @mishoo and use the excellent Uglify.js lib?

@Alphapage
Copy link

The problem seems to come from how page.xml code behind is managed.
From my test, it seems page.xml needs page.js (ie page.css) to find methods...

So the limitation is how to tell page.xml where to get navigatedTo for example.
Something like this:
< Page codeFile="path/to/the/bundlefile.js" codeClass="Mynamespace.Myclass" navigatedTo="pageNavigatedTo" />
or:
< Page codeFile="path/to/the/bundlefile.js" navigatedTo="Mynamespace.Myclass.pageNavigatedTo" />

For now, I'm unable to use this kind of folder structure in my app:

  • scripts (all .js files)
  • views (all .xml files)
  • styles (all .css files)

this could solve my problem too.

@blagoev
Copy link
Contributor

blagoev commented Jul 1, 2015

This can probably negativly reflect on how you debug and/or/when get error reports from production apps

@PanayotCankov
Copy link
Contributor

Source Maps, Source Maps everywhere... We need to support these for obfuscators, transpilers etc.
Meanwhile we've spent some time profiling the app and improved our caching.

XML code-behind will be interesting, source maps won't handle that easily. They map the location in the generated JavaScript to the original source, however for the XMLs we will need a mapping that works the other way around.

@jasssonpet
Copy link
Contributor Author

@jasssonpet jasssonpet reopened this Jul 5, 2016
@jasssonpet jasssonpet added this to the 2.2.0 milestone Jul 5, 2016
@jasssonpet
Copy link
Contributor Author

jasssonpet commented Jul 11, 2016

Further things to research:

  • Research integration with Core NativeScript apps
  • HotReload (https://github.com/webpack/docs/wiki/hot-module-replacement-with-webpack)
  • Debugger integration (including TypeScript and source maps)
  • Packing and requiring other resources (XML, CSS) from within the bundle
  • LiveSync - how will it work with the bundle
  • Encryption - verify the plugin works with the bundler
  • Android snapshot - how will it work with the bundle and encryption
  • Android static binding generator - how will it work with the bundle and encryption

@jasssonpet
Copy link
Contributor Author

jasssonpet commented Jul 12, 2016

Debugging issues:

Encryption issues:

Other issues:

Running webpack with core NativeScript apps:

@hdeshev hdeshev removed this from the 2.2.0 milestone Aug 10, 2016
@jasssonpet jasssonpet removed their assignment Dec 7, 2016
@dtopuzov
Copy link
Contributor

dtopuzov commented Aug 2, 2017

This should be resolved by nativescript-dev-webpack.

@dtopuzov dtopuzov closed this as completed Aug 2, 2017
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

8 participants