devDependencies with Native libraries #3
Replies: 5 comments
-
I see one issue with this: using a fork of N myself is using a fork of N until some of my PRs are merged. To a good working project here is what i want (and have):
Now to make all that work i need to have both It might seem like a "corner case" but i dont think it is. It is very important for me (and maybe other once they see that trick!) to be able code "with nativescript/core" but be able to use a fork for "some time". If you look at it from the client side it means he can be confident his code is ready to "switch" back to the N core while being able to profit from PRs before they are merged. So what you propose would break actually all my apps :s . Their might be to go around this but i dont see it right now. Need to think about it |
Beta Was this translation helpful? Give feedback.
-
@farfromrefug I think we could utilize |
Beta Was this translation helpful? Give feedback.
This comment was marked as disruptive content.
This comment was marked as disruptive content.
-
What about a simple option to filter packages in production? Like those would not looked in for native deps. |
Beta Was this translation helpful? Give feedback.
-
I don't see how this would affect the playground
Exactly the point, in this case vue-devtools is a tool for developing!
Indeed - that's what I feel like should change from "not supposed" to "you can... (but only for development)"
That is true, however the only "crap" I can think of is if the deps had an But I do see this being a risky change, as not everyone understands the difference between
The more I think of this, the more I think would be the better solution. A dependency (both dev and regular) could have a hook that "enqueues" itself (or it's own dependencies) as needing the native dependencies built into the app. In my particular example, Thanks for the input @NathanaelA and @farfromrefug - I think the hook approach would be safer. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, native code from
dependencies
is picked up by NativeScript and built with the app, howeverdevDependecies
are not handled the same way.Sometimes a
devDependency
could require a native module, but only when running the app in debug/dev mode.NativeScript should include native code from
devDependencies
unless--release
is passed.The developer is responsible for guarding the code that invokes native code from
devDependencies
.An example where this would be useful:
nativescript-vue-devtools
usesnativescript-toasty
andnativescript-socketio
, both have native code. Devtools is adevDependency
however, to use them - the developer has to installnativescript-toasty
andnativescript-socketio
as regular dependencies. This works fine - however for a--relase
build, the developer has to manually remove these dependencies frompackage.json
.Beta Was this translation helpful? Give feedback.
All reactions