-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
[Question] how to share code between {N} and web apps within Nx workspace #18
Comments
Hi @sergegl - the approach @nativescript/nx and xplat both take is just pure folder/code organization for shared web/mobile codebases. We strongly believe that using custom file extensions (.tns) for pure sake of code sharing is not a good scalable way to go from practical experience in that area and do encourage others to not go down that path. If you need tips on how to use @nativescript/nx within Nx workspace alongside a web app and share code effectively let us know. Perhaps there's couple pointers we could provide there - Nx in general provides a lot of flexibility in this area. |
Hi @NathanWalker, thank you for a quick reply! Defiantly tips would be greatly appreciated. I was thinking either inherit current web components or just yank some logic into base classes that each web & mobile components would extend from. Please let me know. Thanks again, |
@sergegl, this might interest you: #20 (comment) |
Some tips would definitely help. Right now I have a NativeScript 7 Angular 11 mobile/web shared project. I am currently using the method that the NS v7 docs outlined using .tns.ts extensions or .web.ts extensions for platform specific code. I want to upgrade to NativeScript 8 and Angular 12 but with the new webpack config I have not been able to figure it out. If starting to use an nx workspace would still allow me to have a shared mobile/web project I would definitely convert the project to an nx workspace but I am not sure how to do that. Are there any examples or documentation available for using an Nx workspace with NativeScript 8 Angular 12 shared mobile/web project? Thank you! |
Hi there,
I noticed --shared option is not available.
Is it something coming down the pipeline or is it better to look at other solutions?
I guess one way is extend original .ts files, but it doesn't look too clean as it could've been done with .tns. files.
Do you have other suggestion on how to use nativescript web & mobile in NX besides xplat?
Thank you,
Sergei.
The text was updated successfully, but these errors were encountered: