-
-
Notifications
You must be signed in to change notification settings - Fork 24
feat(angular): v10 support #286
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
When I run Installing packages for tooling via npm.
Installed packages for tooling via npm.
Reading Project Settings
Project settings:
{
"root": "",
"sourceRoot": "src",
"mainName": "main",
"mainPath": "src/main.ts",
"prefix": "bm",
"tsConfig": "tsconfig.app.json",
"entryModuleClassName": "AppModule",
"entryModuleImportPath": "./app/app.module",
"entryModuleName": "App",
"entryModulePath": "src/app/app.module.ts",
"entryComponentClassName": "AppComponent",
"entryComponentImportPath": "./app.component",
"entryComponentName": "App",
"entryComponentPath": "src/app/app.component.ts",
"indexAppRootTag": "bm-root"
}
Adding @nativescript/schematics to angular.json
Adding {N} files
Adding App_Resources
Adding NativeScript specific exclusions to .gitignore
Adding NativeScript run scripts to package.json
Adding NativeScript Project ID to package.json
Modifying web tsconfig
File tsconfig.app.json could not be parsed! |
Here's a couple examples if starting fresh (which are already documented) but here for quick reference: A. Starting a new Angular web project and adding {N} to it afterwards:
B. Starting a new Angular NativeScript shared codebase from the start:
If updating existing @nativescript/schematics projects:
|
🥳 |
@NathanWalker, I just tried creating a new share app but web wouldn't start with the following error:
I've been getting this error in rc version as well, but even after upgrading to following versions:
I'm still getting the same error on skeleton new shared project. UPDATE: Just to assert this again. Web wouldn't work, but mobile does work. |
On some trial and error I was able to get this working by changing "noEmitHelpers": true, to "noEmitHelpers": false, then, adding the same value as This gets new projects to work, but upgrading current projects is not really working. I was able to make huge progress in upgrading one project following: NativeScript/nativescript-angular#2152 (comment), however, other parts are still broken. I'm trying to figure out if these are just project-specific, or more ns-ng-related issues. |
@mahmoudajawad thanks for report - possible to drop a project on github where experiencing the issues - if private you can send email to [email protected] and we can help take a look. |
@NathanWalker, appreciate your reply. I was working on this for more time and finally I figured out the specific steps to take into consideration for being able to upgrade a current project. I was testing this on a private project, but later confirmed the same steps on my repo (https://github.com/mahmoudajawad/nativescript-pokedex), which is:
These changes can be found on the last commit of the same project referenced earlier. On new projects, it seems something is causing That said, unit testing is still broken. I created an issue for rc version NS+NG10 (NativeScript/nativescript-angular#2201), however I'm now seeing different errors from the ones mentioned in the issue. I'll update the other issue with the new findings of release version of NS+NG10. Moreover, you mentioned earlier that you are developing this lib ( |
@NathanWalker hello, i'm follow A. Starting a new Angular web project and adding {N} to it afterwards:
I must comment out in .component 2: tns preview error -> it show ngModuleDef `LOG from device Galaxy S9: com.tns.NativeScriptException: Error calling module function StackTrace: Error: Type AppRoutingModule does not have 'ngModuleDef' property. |
@thientm, |
@mahmoudajawad just excellent 👏 - I wonder if dropping that up on a blog post would help provide more visible clarity to an upgrade? If you agree if possible to put that comment in some markdown and can send in Twitter perhaps then I can add some other details to it and can help provide better pointers to an update. We also are looking at writing an AST transformer to be used with @thientm we'll look at less, possible the loader needs adjustment. |
Hello @NathanWalker, I'm having the same problem 'Error: Type AppRoutingModule does not have 'ngModuleDef' property.'. I just installed: And I run: And the message above is showed. Must I do any kind of configuration? thank you in advance |
@NathanWalker, very well. I shall format the points as a post and send it across. @betosalvador, the thing seems to be related to using |
@mahmoudajawad , |
I tryed npm run preview but I got the same error. If you can give me any other tip, I'll try too. Thanks in advance: ================================ Webpack compilation complete. Watching for file changes. StackTrace: Error: Type AppRoutingModule does not have 'ngModuleDef' property. |
@betosalvador, I'm not having any authority here but I suggest you open an issue, and link it here to continue checking this with you. I believe we can have a look at your project to get some ideas on what's going on. Also, try running |
Thanks @mahmoudajawad I did open a new issue #290 👍 |
Thanks @mahmoudajawad - yep @betosalvador {N} Preview app just needs Angular 10 updates as well so we're working on getting that update in review 👍 |
@NathanWalker thanks man I:) 👍 |
Hello together, I am just trying to get a NS Angular 10 project set up. I followed the description here from @NathanWalker and the one on the nativescript schematics github page. Unfortunately I cannot get a seed running. What I did: npm i -g nativescript --> [email protected] create project: tried to run: Error message: I tried to add a baseUrl to tsconfig.json, but then I get a different error: Webpack build done! Did someone manage to get an Angular 10 project (ios and angular, no web) set up with scss support and can tell me how to do it? Thanks for your help. |
@cjohn001, have you tried creating NG project then adding NS to it? |
Hello @mahmoudajawad, |
I see. If you want mobile-only app, which I do all the time, then you can just go the following path: ns create --ng ns7ng10 though, this would create CSS-styled project, but I believe you can use the same method for migrating Angular projects to SCSS in this new project. |
@mahmoudajawad @NathanWalker I'm also having a problem with unit testing. I was using the docs as a reference but I get the error:
Is there any way to add The work around I am using right now is treating my components as EntryComponents so I can create my own module with Also, the docs say import the following but it does not exist in that place in NativeScript 7. Does anyone know where this file is located now?
Thanks! |
No description provided.