-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sails-linker modifies views in the source repository? #2007
Comments
this is why i removed linker from my gruntfile |
I'm also looking at an alternative asset manager that supports groups and CDN. Groups because I don't want to dump 3MB of javascript (ExtJS) on the login page. Started looking into A recommendation to @mikermcneil is to revisit the current approach for embedding assets. it's not well thought through. The sails-linker would be useful if:
|
something what i am looking for is a nice solution to rev (fingerprint?) the assets (js, css, also relative paths inside the css, images) (read: cache busting) |
For css embedded images, see here. There are definitely other alternatives. |
You don't have to use this feature at all. You can simply remove the That being said, the linker can be immensely helpful for development. I've gotten into the habit of not checking in my layout.ejs file when the only changes are due to the linker, but even if it does get checked in with those changes, they'd be overwritten by the linker the next time |
I'm not sure why this was closed. Back to the root of the problem, The sails-linker modifies source files and it shouldn't. this needs to be fixed. Sails sells itself as being production ready and this is not an issue to ignore. Please fix the gruntfile to operate on temporary files only and have a configuration setting to point to views in the temporary folders. |
Also, there's great recommendations here in this thread and we simply chose to ignore them? |
@simoami |
Thanks @albertosouza and @sgress454.
yes, understood. I'm assessing Sails.js for a possible migration from an Enterprise java application to Node.js. Our requirements are higher than the average single page app scenario. we have a multi-module app with 600 JS files and using ExtJS as a JS framework. We also have guidelines that build tasks should never modify source code but may operate on temporary folders. For example, Maven generates |
I tried to find a workaround to this issue by copying the Now, I wanted to change the
BUG? PS. Setting the Updatesolved by adding the following to the
|
While you can remove the linker tags/injection of source files and do it manually yourself, we tend to use the linker even for bringing in scripts for production environment. Our main problem with this approach was the lack of versioning in sails resources because of use of the linker. In case someone else is doing the same, but needs versioning of their sails resources brought in by the linker, the following stackoverflow question helped point me in the right direction, particularly the link in the second answer : http://naya.com.np/@developer.naya/post/391862c0520b5b5632e99e812749a85b |
I agree with @simoami here. This is an issue @sgress454. There is no reason why Sails should be configured out of the box to have grunt / sails linker modify the actual source template as it makes is confusing as git sees this as a change and users will likley just commit the file over and over which is unnecessary. The dynamic linking is important and definitely useful, so I don't think that disabling it all together is a "solution". Sails should just be a bit smarter to see if someone who has grunt enabled, sails linker should modify the copied files in the .tmp directory as @rishabhmhjn is suggesting. This way the source file doesn't get modified, only the grunt built file is. Though there is another use case where what if grunt is disabled say for a production server. We use the build/buildProd task to build a www static path. While we have nginx set up to serve out these files statically, I'm not sure if modifying the bootstrap.js file to point to the .tmp directory would work in the case where grunt is disabled entirely and there is no .tmp directory as maybe this would crash sails, I'm not sure as we haven't tested it. |
It appears that grunt-sails-linker is configured to modify views in the source code as this configuration implies.
This is generally not recommended. Code that is versioned will be flagged as modified. If one performs a merge from another branch and wants to test that the app is running before committing the merged code, then this will interfere with the process, since the sails-linker turns views as modified.
The text was updated successfully, but these errors were encountered: