-
Notifications
You must be signed in to change notification settings - Fork 445
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
Recommendations on multi-platform dev #474
Comments
Hi @NathanWalker, Are you planning to stop supporting this seed? All this work is awesome, I consider the only ones topics to improve are AOT, webpack bundle, and lazy load for {N}. |
Hi @exeleon thank you for the input 👍 I have often longed for far greater simplicity in build tooling, more intuitive out of box extensibility pathways and more elegant platform separation with less danger of pitfalls. The Nx direction is where I am putting all my energy at moment in regards to this. At the moment I don't plan to extend this seed any further from where it is. It stands as one way to achieve multi-platform in a monorepo and I'd leave it up to those who find it to evaluate on their own. However I feel a responsibility to leave my impressions and thoughts after working in the space for over 2 years now. The helpful guides on Nx and more to come will prove to be the culmination of a lot of those thoughts and desires. The topics you mention are some of the reasons I would probably not recommend continuing with the seed as it exists today. The webpack/AoT bundling with {N} is best served by having clear separation in decorated counterparts (not sharing a At this point in time, sharing code which is intended to be compatible with all aspects of AoT compilation are served better by an abstract class approach as mentioned above. I should mention that the videos shared regarding Nx offer a {N} app template which offers lazy loading out of the box for {N}, fully AoT compatible production webpack configuration with parallelization when uglifying which are the top topics you mention :) I'd love to hear other's thoughts but that's where I'm at and feel a necessity to state it clearly. |
Hi Nathan, I am using your seed for quite a while now and in several application and love it. As you I am excited by Angular 5, Ngrx v4, Nx and now angular-ci given what Nx brings to the table for large application development. Nevertheless, I must admit that I am a little bit lost when you write in your statement above that « If you are currently working in this seed you can likely drop your code in without much hassle ». Conventions used are drastically different and I am wondering if simply dropping the code of an existing app and adjusting path will be sufficient to make it work. I will try but would love to hear from you what you believe are the steps to follow to be succeed. Thanks in advance |
@rernens I am happy to hear you are having success and enjoying it. If you could provide an example of something in your existing app that you might be curious about how to drop in, please let me know and I'll try my best to help guide you. |
Hi I have been successful at moving my project to Angular-cli and NX. I followed the step by step guide that I found https://github.com/angular/angular-cli/wiki/stories-moving-into-the-cli making additional changes to cope with the way environment dependencies are handled in angular-cli vs your seed. had some hard time to address fonts dependencies and found out that they needed to be stored in the asset folder to be used in url() or relative path would not work. I still have to find a way to integrate index.html file changes based on build . But apart from that everything works like a charm including hmr and aot. Thanks |
@NathanWalker is there any tutorial for how to do what you've done here with the 3: Angular, Electron & Nativescript using Nx Workspace(s)? |
I’ll be doing more with Electron and Nx in the new year but nothing formalized yet. |
@rernens this is extremely late, but you don't actually have to store all static files (i.e. fonts) in an assets folder.
You could change the input to only be .woff* for example. As for different environments, leveraging Cheers |
I want to ensure all of those who come across this seed and/or are using it currently are successful in their multi-platform goals. I welcome and introduce you to a natural and exciting evolution:
If you are using this seed and experiencing frustrations, I would highly recommend looking at Nx from Nrwl. It provides a setup which will make your development with multiple platforms and sharing code pleasant with less overhead. If you are currently working in this seed you can likely drop your code in without much hassle. Instead of using
.tns.html
/.tns.ts
files (for {N} views - don't worry, you can use everything you have already done!), use abstract base classes in shared libs which are extended by their decorated counterparts in your targeted apps.Please take a look at these starting videos:
https://egghead.io/playlists/use-nativescript-with-nx-from-nrwl-161bd3e2
The setup and videos will help get you started with ngrx 4, latest/greatest Angular and NativeScript versions out of the box.
More helpful guidance around multi-platform development with Nx will be out this fall/winter covering Electron integration, advanced code sharing techniques, testing, webpack/Aot, CI integration and deployment.
With Nx, you can have many
apps
which all share a combination of manylibs
.Example
Let's say our Nx workspace is called
my-company
.Here's an example of a base abstract class which is shared with a target web and mobile NativeScript app for maximum code reuse:
libs:
@my-company/shared
libs/shared/components/nav.base-component.ts
libs/shared/index.ts
:apps: NativeScript mobile app
apps/mobile/app/nav.component.ts
:apps: Web app
apps/web/src/app/nav.component.ts
:The text was updated successfully, but these errors were encountered: