Skip to content

Commit f44a825

Browse files
author
Zdravko
authored
Merge pull request #79 from NativeScript/zbranzov/ns3.4
add support for ns 3.4 and dev-webpack 0.9.0
2 parents eb56c2b + 68e2a50 commit f44a825

18 files changed

+96
-112
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ branches:
44
env:
55
global:
66
- ANDROID_PACKAGE='demo-debug.apk'
7-
- ANDROID_PACKAGE_FOLDER=$TRAVIS_BUILD_DIR/demo/platforms/android/build/outputs/apk
7+
- ANDROID_PACKAGE_FOLDER=$TRAVIS_BUILD_DIR/demo/platforms/android/app/build/outputs/apk
88
- ANDROID_SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER/$ANDROID_PACKAGE?overwrite=true"
99
- IOS_PACKAGE='demo.zip'
1010
- IOS_PACKAGE_FOLDER=$TRAVIS_BUILD_DIR/demo/platforms/ios/build/emulator
@@ -25,14 +25,14 @@ matrix:
2525
language: node_js
2626
node_js: "6"
2727
jdk: oraclejdk8
28-
script: cd demo && npm run build.plugin && npm i && npm run ns-bundle --ios --build-app --uglify && cd ../demo-angular && npm run build.plugin && npm i && npm run ns-bundle --ios --build-app --uglify
28+
script: cd demo && npm run build.plugin && npm i && tns build ios --env.uglify && cd ../demo-angular && npm run build.plugin && npm i && tns build ios --env.uglify --env.aot
2929
- language: android
3030
os: linux
3131
env:
3232
- WebpackAndroid="26"
3333
jdk: oraclejdk8
3434
before_install: nvm install 6.10.3
35-
script: cd demo && npm run build.plugin && npm i && npm run ns-bundle --android --build-app --uglify --snapshot && cd ../demo-angular && npm run build.plugin && npm i && npm run ns-bundle --android --build-app --uglify --snapshot
35+
script: cd demo && npm run build.plugin && npm i && tns build android --env.uglify --env.snapshot && cd ../demo-angular && npm run build.plugin && npm i && tns build android --env.uglify --env.snapshot --env.aot
3636
- language: android
3737
env:
3838
- BuildAndroid="26"

demo-angular/app/app.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ In many cases you may want to use the NativeScript core theme instead
99
of writing your own CSS rules. For a full list of class names in the theme
1010
refer to http://docs.nativescript.org/ui/theme.
1111
*/
12-
@import 'nativescript-theme-core/css/core.light.css';
12+
@import '~nativescript-theme-core/css/core.light.css';
1313

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const AppModuleNgFactory: any;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.login-buttons {
22
margin-left: 30;
33
margin-right: 30;
4-
margin-top: 80%;
4+
margin-top: 70%;
55
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
require("tns-core-modules/application");
1+
require("application");
22
if (!global["__snapshot"]) {
3-
/*
4-
In case snapshot generation is enabled these modules will get into the bundle but will not be required/evaluated.
5-
The snapshot webpack plugin will add them to the tns-java-classes.js bundle file. This way, they will be evaluated on app start as early as possible.
6-
*/
7-
require("tns-core-modules/ui/frame");
8-
require("tns-core-modules/ui/frame/activity");
3+
// In case snapshot generation is enabled these modules will get into the bundle
4+
// but will not be required/evaluated.
5+
// The snapshot webpack plugin will add them to the tns-java-classes.js bundle file.
6+
// This way, they will be evaluated on app start as early as possible.
7+
require("ui/frame");
8+
require("ui/frame/activity");
99
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// There is a bug in angular: https://github.com/angular/angular-cli/pull/8589/files
2+
// Legendary stuff, its webpack plugin pretty much doesn't work with empty TypeScript files in v1.8.3
3+
void 0;

demo-angular/app/vendor.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
// Snapshot the ~/app.css and the theme
2+
const application = require("application");
3+
require("ui/styling/style-scope");
4+
const appCssContext = require.context("~/", false, /^\.\/app\.(css|scss|less|sass)$/);
5+
global.registerWebpackModules(appCssContext);
6+
application.loadAppCss();
7+
18
require("./vendor-platform");
29

310
require("reflect-metadata");

demo-angular/package.json

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,56 @@
33
"license": "MIT",
44
"nativescript": {
55
"id": "org.nativescript.demoangular",
6-
"tns-android": {
7-
"version": "3.0.1"
8-
},
96
"tns-ios": {
10-
"version": "3.0.1"
7+
"version": "3.4.0"
8+
},
9+
"tns-android": {
10+
"version": "3.4.0"
1111
}
1212
},
1313
"dependencies": {
14-
"@angular/common": "~4.0.0",
15-
"@angular/compiler": "~4.0.0",
16-
"@angular/core": "~4.0.0",
17-
"@angular/forms": "~4.0.0",
18-
"@angular/http": "~4.0.0",
19-
"@angular/platform-browser": "~4.0.0",
20-
"@angular/platform-browser-dynamic": "~4.0.0",
21-
"@angular/router": "~4.0.0",
22-
"nativescript-angular": "^3.0.0 || ^2.0.0-rc.1",
14+
"@angular/common": "~5.0.0",
15+
"@angular/compiler": "~5.0.0",
16+
"@angular/core": "~5.0.0",
17+
"@angular/forms": "~5.0.0",
18+
"@angular/http": "~5.0.0",
19+
"@angular/platform-browser": "~5.0.0",
20+
"@angular/platform-browser-dynamic": "~5.0.0",
21+
"@angular/router": "~5.0.0",
22+
"nativescript-angular": "^5.0.0",
2323
"nativescript-facebook": "../src",
2424
"nativescript-theme-core": "^1.0.2",
2525
"nativescript-unit-test-runner": "^0.3.4",
26-
"rxjs": "~5.3.0",
27-
"tns-core-modules": "^3.0.0",
26+
"rxjs": "^5.5.0",
27+
"tns-core-modules": "^3.4.0",
2828
"zone.js": "^0.8.4"
2929
},
3030
"devDependencies": {
31-
"@angular/compiler-cli": "~4.0.0",
32-
"@ngtools/webpack": "~1.5.0",
31+
"@angular/compiler-cli": "~5.0.0",
32+
"@ngtools/webpack": "~1.8.2",
3333
"babel-traverse": "6.12.0",
3434
"babel-types": "6.11.1",
3535
"babylon": "6.8.4",
3636
"copy-webpack-plugin": "~4.0.1",
37-
"extract-text-webpack-plugin": "~2.1.0",
37+
"css-loader": "~0.28.7",
38+
"extract-text-webpack-plugin": "~3.0.0",
3839
"filewalker": "0.1.2",
3940
"jasmine-core": "^2.5.2",
4041
"karma": "^1.3.0",
4142
"karma-jasmine": "^1.0.2",
4243
"karma-nativescript-launcher": "^0.4.0",
4344
"lazy": "1.0.11",
4445
"nativescript-css-loader": "~0.26.0",
45-
"nativescript-dev-typescript": "^0.4.0",
46-
"nativescript-dev-webpack": "^0.8.0",
46+
"nativescript-dev-typescript": "^0.6.0",
47+
"nativescript-dev-webpack": "^0.9.0",
48+
"nativescript-worker-loader": "~0.8.1",
4749
"raw-loader": "~0.5.1",
48-
"resolve-url-loader": "~2.0.2",
49-
"typescript": "~2.3.4",
50-
"webpack": "~2.6.1",
51-
"webpack-sources": "~1.0.1",
50+
"resolve-url-loader": "~2.1.0",
5251
"tslint": "~5.4.3",
52+
"typescript": "~2.4.2",
53+
"webpack": "~3.8.1",
5354
"webpack-bundle-analyzer": "^2.8.2",
54-
"nativescript-worker-loader": "~0.8.1"
55+
"webpack-sources": "~1.0.1"
5556
},
5657
"scripts": {
5758
"ns-bundle": "ns-bundle",
@@ -60,10 +61,10 @@
6061
"ci.android.build": "npm run build.plugin && tns build android",
6162
"ci.ios.build": "npm run build.plugin && tns build ios",
6263
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
63-
"start-android-bundle": "npm run ns-bundle --android --run-app --uglify --snapshot",
64-
"start-ios-bundle": "npm run ns-bundle --ios --run-app --uglify",
65-
"build-android-bundle": "npm run ns-bundle --android --build-app --uglify --snapshot",
66-
"build-ios-bundle": "npm run ns-bundle --ios --build-app --uglify",
67-
"generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install"
64+
"generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install",
65+
"start-android-bundle": "npm run ns-bundle --android --run-app",
66+
"start-ios-bundle": "npm run ns-bundle --ios --run-app",
67+
"build-android-bundle": "npm run ns-bundle --android --build-app",
68+
"build-ios-bundle": "npm run ns-bundle --ios --build-app"
6869
}
6970
}

demo-angular/tsconfig.aot.json

Lines changed: 0 additions & 39 deletions
This file was deleted.

demo-angular/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
},
3636
"exclude": [
3737
"node_modules",
38-
"platforms",
39-
"**/*.aot.ts"
38+
"platforms"
4039
],
4140
"compileOnSave": false
4241
}

0 commit comments

Comments
 (0)