-
-
Notifications
You must be signed in to change notification settings - Fork 240
feat: add Angular 9 and Ivy support #2065
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
Conversation
chore: add ngcc execution during npm prepare
chore: update deps and peer deps to 9.0.0 rc1
chore: add top plugins to Ivy example
chore: add app-wide ngcc.cofnig.js in Ivy example for all included {N} plugins
MattRiddell
commented
Feb 9, 2020
Any idea when this will be merged?
@MattRiddell I took over from where @VladimirAmiorkov left off and got things working with Ivy enabled here:
#2124
So everyone here does not need to wait until that new PR is merged, you can do the following to try the new v9 by doing the following:
- Download a prepacked
@nativescript/angularv9 here:
https://drive.google.com/file/d/1MyKOetI5aLc7gA_M3rKrNS-1RqztOwDs/view?usp=sharing
Put the .tgz file at root of your {N} project.
- Download a prepacked
nativescript-angularcompatibility reference here (this is mainly to allow other plugins which may not use the new @NativeScript scope to still work):
https://drive.google.com/file/d/1xQ7O66qE2hmTbeChL1nbFqh4rCEEaor0/view?usp=sharing
Put the .tgz file at root of your {N} project.
- Then modify you package.json as follows:
- Add to your
scriptssection:
"scripts": {
"ngcc": "ngcc",
"postinstall": "ngcc"
}
- Modify
dependenciesas follows:
"@nativescript/angular": "file:nativescript-angular-v9.tgz",
"nativescript-angular": "file:nativescript-angular-compat.tgz",
Then just make sure all your @angular dep's are updated to ~9.0.0, for example:
"@angular/core": "~9.0.1"
Also make you are using at least 1.4.0 or 1.5.0 of nativescript-dev-webpack in devDependencies.
- Modify your
tsconfig.jsonto include this (parallel tocompilerOptions):
"compilerOptions": {
...your various options, etc.
},
"angularCompilerOptions": {
"enableIvy": true
}
Then clean you project completely:
rm -rf node_modules/ platforms/ package-lock.json hooks
Then run with the following:
tns run ios --emulator --env.aot --no-hmr
Best to always use AoT all the time since Ivy works with it by default and also good to disable hmr as seems there's some other things to get hmr working with ivy.
If you end up seeing an error like this:
ERROR in The target entry-point "nativescript-ngx-fonticon" has missing dependencies:
- file-system
You can add a new file ngcc.config.js to the root of your project with contents like this which helps the ngcc compiler for Ivy:
module.exports = {
"packages": {
"@nativescript/angular": {
"entryPoints": {
".": {
"override": {
"main": "./index.js",
"typings": "./index.d.ts",
},
"ignoreMissingDependencies": true,
}
}
},
"nativescript-ngx-fonticon": {
"entryPoints": {
".": {
"override": {
"main": "./nativescript-ngx-fonticon.js",
"typings": "./nativescript-ngx-fonticon.d.ts",
},
"ignoreMissingDependencies": true,
}
}
},
"@nota/nativescript-accessibility-ext": {
"entryPoints": {
".": {
"override": {
"main": "./index.js",
"typings": "./index.d.ts",
},
"ignoreMissingDependencies": true,
}
}
}
}
}
Then try cleaning project and rebuild/run again after adding the ngcc.config.js file.
thegnuu
commented
Mar 3, 2020
Is there an estimated date when this will be available?
We are using immer in our application and we need typescript 3.7 that we are able to create our next release ;)
I know that I am able to patch this version into our project, but I am not really under pressure to create a new release and if it takes just a few weeks to publish this I would like to wait for the release...
If it will take months I am happy to follow the instructions to patch it!
Thank you for your help!
mavaanan
commented
Mar 3, 2020
We would also need this support ASAP. Can you give some time estimate for Angular 9.0.2+ support?
abcfoundry
commented
Mar 4, 2020
Is this progressing? Releases used to be aligned with Angular, has something changed in the relationship with working with the google team?
With deep sadness I must inform you that I am no longer working on the NativeScript project. It has been a great journey and my work on the Angular 9 Ivy implementation in NativeScript has been taken over in the this PR #2124 . Please follow it and contribute to it as you can.
PR Checklist
What is the current behavior?
Current package does not work with Angular 9.0.0-rc.1 version.
What is the new behavior?
Current package does works with Angular 9.0.0-rc.1 version.
Fixes/Implements/Closes #[Issue Number].
Resolves #2060