-
-
Notifications
You must be signed in to change notification settings - Fork 241
feat(angular): v9 with ivy support #2124
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
@VladimirAmiorkov can you approve again to kick jenkins build? I cleared the lint related issues. |
+1 |
@NathanWalker This one for example has been open since 2018 -> #1367 |
@NathanWalker This one hasn't been open for long but I'm curious if you have a patch ready NativeScript/NativeScript#8551 It was closed because the original wording of the issue was due to an issue in my own code, however I discovered another bug that's related. |
@SmailHammour thanks! yep definitely familiar with that one :) - In short there's a lot of angular router paradigms that are well suited for web scenarios which don't necessarily present 1-1 in mobile scenarios and believe a lot of issues like that can often be solved by taking a good look at the overall mobile route setup and often simplifying the approach. Additionally I've been considering writing an alternate angular router for {N} which would avoid a lot of the trouble that issue represents. It's definitely an ongoing debate however the Vue integration took a similar approach where integrating the vue-router didn't make sense 1-1 and instead introduced a much simpler and vastly more stable Navigation service to handle mobile scenarios better with vastly better results. @cdmistman Have not seen that one - thanks for raising it here; I'll be interested to dig into that one in the coming weeks. If you have an immediate blocker due to that you may could email team@nstudio.io to see if more immediate assistance could be possible. |
So I created a repo similar to the one @NathanWalker posted above for others who want to dabble in the move to Angular 9/Ivy. It's located here. In the master branch I was able to successfully make a simple app to display a dialog. But in the side-drawer branch I am trying to use the |
@crowmagnumb I was seeing that too, this fixed it for me: ProgressNS/nativescript-ui-feedback#1355 (comment). |
@kmmccafferty96 Thanks for that! That gave me hope but then I ran into other issues that are documented in my project README and a little too wordy to recreate here. It boils down to the fact that the |
I have 3 projects with sidedrawer working with ivy. Just keep trying :) did
you follow Nathan's recommendations regarding the ngcc file? That did the
trick for me.
…On Sat, 09 May 2020, 1:12 am Ken Southerland ***@***.***> wrote:
@kmmccafferty96 <https://github.com/kmmccafferty96> Thanks for that! That
gave me hope but then I ran into other issues that are documented in my
project README <https://github.com/animalus/testns-app> and a little too
wordy to recreate here. It boils down to the fact that the
nativescript-ui-sidedrawer is not Ivy compatible, but disabling Ivy I
still can't complie my simple little tiny project. :(
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2124 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHNDDIFY23Y7KHPPDQVM5STRQSGV5ANCNFSM4KW4X6VA>
.
|
@Meyer-dev That's encouraging! Thank you. I do indeed have a
|
here is me ngcc.config.ts file which is slightly different and working.Let
me know if this helps.
module.exports = {
"packages": {
"@nativescript/angular": {
"entryPoints": {
".": {
"override": {
"main": "./index.js",
"typings": "./index.d.ts",
},
"ignoreMissingDependencies": true,
}
}
},
/*
"dataform-directives": {
"entryPoints": {
".": {
"override": {
"main": "./dataform-directives.js",
"typings": "./dataform-directives.d.ts",
},
"ignoreMissingDependencies": true,
},
"angular": {
"override": {
"main": "./dataform-directives.js",
"typings": "./dataform-directives.d.ts",
},
"ignoreMissingDependencies": true,
}
}
},
*/
"nativescript-ui-dataform": {
"entryPoints": {
"angular": {
"override": {
"main": "./dataform-directives.js",
"typings": "./dataform-directives.d.ts",
},
"ignoreMissingDependencies": true,
}
}
},
"nativescript-ui-sidedrawer": {
"entryPoints": {
".": {
"override": {
"main": "./ui-sidedrawer.ios.js",
"typings": "./index.d.ts",
},
"ignoreMissingDependencies": true,
},
"angular": {
"override": {
"main": "./side-drawer-directives.js",
"typings": "./side-drawer-directives.d.ts",
},
"ignoreMissingDependencies": true,
}
}
},
"nativescript-ui-listview": {
"entryPoints": {
".": {
"override": {
"main": "./ui-listview.ios.js",
"typings": "./index.d.ts",
},
"ignoreMissingDependencies": true,
},
"angular": {
"override": {
"main": "./listview-directives.js",
"typings": "./listview-directives.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,
}
}
},
}
}
…On Sat, 9 May 2020 at 02:06, Ken Southerland ***@***.***> wrote:
@Meyer-dev <https://github.com/Meyer-dev> That's encouraging! Thank you.
I do indeed have a ngcc.config.js in the root of my directory in the
side-drawer branch. It might be set to DISABLED by the time you get there
because I'm experimenting but its contents are and it doesn't seem to do
anything. This is automatically seen by ngcc right, I don't have to set
anything else? What do yours look like? Cheers.
module.exports = {
packages: {
***@***.***/angular": {
entryPoints: {
".": {
override: {
main: "./index.js",
typings: "./index.d.ts"
},
ignoreMissingDependencies: true
}
}
},
"side-drawer-directives": {
entryPoints: {
".": {
override: {
main: "./side-drawer-directives.js",
typings: "./side-drawer-directives.d.ts"
},
ignoreMissingDependencies: true
}
}
}
}
};
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2124 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHNDDIGGEUIVGMQCEFPX7LTRQSM6ZANCNFSM4KW4X6VA>
.
|
I'll say up-front, because maybe we are annoying others :), if anyone would like to start a small group of some kind that we can bounce ideas and little gotchas that we all experience off each other please let me know. I would love that. We would all like to just get to coding and not dealing with setup. :) Email me at my github username at gmail. @Meyer-dev I have made a modification based on yours mine now reads like that below. But what I get with this gcc config set is ...
But I get that even if I disable the ngcc.config.js file, so it doesn't appear to have any effect.
|
So, I switched over to my MAC to run it in the ios simulator and it works! Without any ngcc.config.js file even! So its just running android (I run under Ubuntu) that I'm getting all my issues. :( Any thoughts on that? |
UPDATE: If I don't set the |
An alternative is switching to a framework that already supports v9 https://twitter.com/LiamDeBeasi/status/1261298258506375169 |
@iameduardod I should update here that I am now having success with the above "workaround" and would gladly help others with their transition to it as well with some of the knowledge that I've gained from this exercise. And I have intel that the workaround is very temporary and will be made permanent in a short while. |
A migration case would be very helpful and what steps are to be followed. |
I was able to get my application working (partially) with this workaround, but we are using a custom dynamic component loader from an external url in our electron application and I want to rebuild this feature for our new NativeScript application, everything works until I want to build the angular module within our application. If I try to use Has anyone an idea how to fix that? |
Never mind, I found a solution for my issue, I just had to enable Ivy in my case... I did not double check this while copying the files, since my externals modules are built with Ivy enabled the app it self of course has to be built with Ivy as well. |
@NathanWalker '** ERROR in The given rootPath undefined is not a file of the program **.' Could you provide any solution to fix this |
@NathanWalker Much appreciate your effort. It will be great if you could explain, what is currently between us and getting this PR merged and finished? Asking because I will be happy to be involved in contributing. |
This PR will be merged and published next week no later than Wednesday 👍 |
Published in |
Great work! :) |
This still doesn't work on a brand new code sharing project |
@westlakem could you share the exact commands you’re using to create? |
I followed the instructions on |
Everything works fine until i installed a plugin with element-registry. i think it is the nativescript-ui-dataform. my error goes like this :::::
i followed all the instruction and placed the recommended code inside ngcc.config.js still that dang error exists. -_- |
@kukurt123 we’d recommend updating to Angular 10 and using UI-dataform |
I took over from where @VladimirAmiorkov left off on this pr and got things working with Ivy enabled here.
Everyone who sees this does not need to wait until this PR is merged.
You can do the following to try the new v9 by doing the following:
Modify you package.json dependencies as follows:
Then just make sure all your @angular dep's are updated to ~9.1.0, for example:
Make you are using at least 1.5.0 of nativescript-dev-webpack in devDependencies.
Add this to your package scripts:
Then clean you project completely:
Then run with the following:
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:
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:Then try cleaning project and rebuild/run again after adding the ngcc.config.js file.
Here's a sample project configured correctly for Angular 9 with Ivy enabled you can reference (the tns-ios and tns-android runtimes can be 6.4.0 - they are set to specific version just because those are what was installed globally but works fine with 6.4 as well):
https://github.com/vinckobb/nativescript-angular-demo
Lastly if you have a large number of plugins and are encountering too many Ivy/ngcc related issues surrounding various plugins which may not be compatible yet, you can simply set:
Modify your tsconfig.json to include this (parallel to compilerOptions):
in your tsconfig. then clean and rebuild.
That simply disables Ivy and allows you to still build and develop with Angular 9 and then once you have brought all other dependencies up to date with various complier issues, you can then reenable later 👍