-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Scoped packages for {N} 3.0 - @nativescript/core instead of tns-core-modules #4041
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
Comments
Actually this is not such a good idea. There is one substantial difference between scoped and the current submodules - You cant publish/install/update all packages inside a scope. So everything inside the {
"@nativescript/application-settings": "rc",
"@nativescript/application": "rc",
"@nativescript/color": "rc",
"@nativescript/connectivity": "rc",
....
"@nativescript/ui": "rc",
"@nativescript/utils": "rc",
"@nativescript/xhr": "rc",
"@nativescript/xml": "rc"
} Then when the time comes to update, you will have to update all those version to the correct new one. Basically what you have to do now when a new angular version hits and you need to update your angular deps. And if you miss to upgrade some package it could cause problems. And besides you do not need to type import { Page } from "ui/page"
import { Observable } from "data/observable" And it will work. |
@PeterStaev this could be solved simply by: |
@NathanWalker I agree with the points you made and IMO it looks better. I'm not sure if we can afford to make another big change so close before the 3.0 lunch and in the current delicate state that we have many folks already working on migrating plugins and apps. |
Ok, having |
@vakrilov @PeterStaev I wish I made suggestion a little earlier (I know timing is close - perhaps it's fairly simple to do) but yeah was just thinking since 3.0 was going to introduce breaking changes anyway, may be a perfect time to go ahead and do this - you could support both import paths as a way to ease transition with 3.0 - should be able to just publish under the scope and re-export everything in the target barrel. |
Currently the tns-core-modules npm package is treated special. When you require "ui/core/view" the runtimes will actually check the "tns-core-modules" package. Publishing the modules in "@nativescript/core" can keep the apps somewhat backward compatible if the runtimes are modified to look in "@nativescript/core" instead of in "tns-core-modules". I like the scopes, but I too think it is too late. |
If there is a way to support both - we can introduce |
I'm in favor of |
Core theme can be published as:
|
Hey - I noticed some activity in twitter around this issue, so lets continue the discussion here. ConcernsHere are the concerns that I have with such change (re-publishing the
Possible Alternatives
|
@vakrilov I'll revive this. I'm with the proxy package - in fact this is something we could introduce in xplat rather soon and could begin trying this out. No matter what it would be a gradual thing but would be great to have this already available so could introduce the proxy and allow others to start using it and eventually it would just become the norm/standard. I would start using it immediately for sure. |
Hey @NathanWalker - let's reiterate again on what the benefits of this will be.
Is there something else I'm missing. You mentioned bundling at the original post but I'm not sure how that is related? Also is there something |
That hits the nail on the head 👍 Nothing xplat specific (other than allowing more helpful and reliable schematics to auto update user's apps with various best practices, etc - Consistent and simpler import packaging helps make things like that possible). Whatever is done here let's be gradual so the old imports would be supported for another 1-2 years likely. However the new import pathing could start showing up - we would use it as default in our xplat tools as a way to introduce it to the angular workspace crowd. Slowly overtime the hope would be for it to make more sense to broader audience and intuitively folks would just use it. I could help document 1 single clear doc page which would just show every package and how it maps to the simpler import pathing for those that want to start using it. Current docs wouldn't need to be updated for awhile and again could be very gradual since both forms would work just fine. |
So I want to revive this with the recent "depreciation" of the short import paths in 5.2 and requiring users to type the full path "tns-core-modules". The current import paths are already a bit long and requiring to type an additional 31 symbols in front I think is a bit too much. Before fully removing short import paths this should be considered with high priority and shortening the import paths altogether. What was discussed above sounds really good - like importing UI modules from a single point Hoping the core team will re-evaluate this issue and we will have this implemented at the point where the short import paths will be completely removed 🙏 |
Reference to this working wonderfully well today within Nx + xplat workspaces: |
Maybe this could be done in the following way:
As we're also using In the future, everything can be migrated to |
Actually RxJS compat is a bit the opposite - the new version uses the new import paths, and the Considering the changes coming with 6.0 and that authors would probably have to make required changes for AndroidX support I think it is the perfect time to add this. |
This comment was marked as abuse.
This comment was marked as abuse.
Nothing would break with this approach just to be clear. This would simply provide a way forward with a simpler packaging approach which folks could start using today. Over time my guess is this would become the norm and only then would deprecating the older package naming could occur. Talking years, but having this available today (alongside the other) is really a no brainer to me. Ultimately this would likely simplify teaching the framework and developer usage. Sounds like small thing but package location and usage of the framework has big impact on learning and retention as well as developer joy :) Link to download the reexports we already use in our projects which makes this work today (for anything missing just expand if needed): https://drive.google.com/file/d/1AUPSxkwQIIvdK2ohoekuuts85ZZ4i2-l/view?usp=sharing |
I think this is constantly being missed. I don’t believe Nathan is suggesting reorganising the layout of folders in |
@shirakaba 100% correct. No breaking change, no reorg, both ways work for long time. Folks can use either they like, can mix, plugins continue to work for long long time. |
Just for full clarity/context on this issue - public poll resulted in 25-0 in favor of wanting this: |
|
Uh oh!
There was an error while loading. Please reload this page.
If possible, this would be nice:
I believe it would make for a clear and consistent approach to bundling and usage.
Cons to:
tns
is the command line utility and doesn't have great meaning here (too techy)-core-modules
, redundant, yes we know it's a module import and part of coreI know 3.0 is close but organizing into a scoped package may not be troublesome to do and would be appreciated if considered since it appears there is already an attempt to scope the packages. If scoping is going to happen, please consider the above before going through 2 iterations of scoped naming.
Updated for clarity
tns-core-modules could then be published as:
@nativescript/core
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: