-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Allow templates to omit App_Resources #2513
Comments
Thanks! |
@nraboy @tjvantoll The performance hit wasn't the big problem which led to the decision. The actual problem was, the behavior we had was error prone, because CLI augmented the App_Resources folder when it was present, but it didn't contain all the necessary files. The second reason is the templates can differ and while the copy/paste solution might work in some cases, an angular template can differ a lot from a vanilla js template, and we might tie our hands on using more than we need. In third place is the performance issue (additional traffic). As @tjvantoll said:
One possible solution for developers making templates to add the
That's exactly right, the templates are updated often, but what happens when the angular templates |
This I agree with. I only believe the CLI should add an
I just did a quick compare using It’s not clear to me why |
@tjvantoll , @Plamen5kov |
@nraboy, please give us your suggestions, so we can continue the discussion from #2493, so we can reach a solution together, hopefully for 3.0. |
My suggestion is to have the CLI check to see if the App_Resources directory exists during creation and if it does not, create it. I can't imagine this being difficult to do. I think it is critical that people be able to specify template versions. |
I’ll +1 @nraboy. if (the App_Resources directory exists) {
// do nothing
} else {
// add the App_Resources directory from the default template
} This simple change would make templates easier to build and maintain. |
@Plamen5kov what needs to be done to make what @tjvantoll had suggested happen? |
@nraboy If we don't want to support anything different than what @tjvantoll suggested, it should be no problem doing this for 3.0 release. I'm all for your solution, as long as it's clear that it's error prone, with cli using templates that are created by developers that don't know about the |
Further more @tjvantoll @nraboy when would you expect CLI to make that detection, only on |
I would only expect this at creation. If the user messes up their project later, it is on them. |
- Test for NativeScript/nativescript-cli#2513 - Test for NativeScript/nativescript-cli#2496
As the NativeScript 2.5 release, NativeScript templates now must provide a complete
App_Resources
folder in order to work. I believe we should revert that change, and makeApp_Resources
optional for templates. Here’s why:App_Resources
. Few templates will need to add images, and none will want to alter the default splash screens or icons. That means most template authors will do what I did, and copy/paste theApp_Resources
folder from the default hello world template.App_Resources
folder in the default template fairly often, and I want those updates to make it into my templates. To accomplish this currently I have to manually check forApp_Resources
updates with each release, copy and paste the folder again, and publish a brand new version of each of my templates.I realize that this change was made for performance reasons—that we don’t want users to download two templates when using
App_Resources
-free templates. But I believe the developer convenience outweighs the moderate performance gains. And most users will continue to use one of our three default templates, all of which include anApp_Resources
folder, and will therefore not be subject to this small performance hit.The text was updated successfully, but these errors were encountered: