How to disable Hot Code Push in Meteor JS in Development? - javascript

I'm using Tincr (http://tin.cr/) to take advantage of Chrome's code hot-swapping functionality. However, now I need to disable Meteor's refreshing of the page each time I save a file since the code is already update in the browser's runtime environment thanks to chrome hot-swapping.
How can I do that?

i found the answer. add a '~' at the end of files or folders you don't want causing reloads.

Related

Edit library source file in Chrome Dev Tools

I'm writing code for a library consumed by another program that get compiled and deployed. I have followed these steps to edit my javascript directly in the browser but my changes are never applied.
Can you not edit a javascript file part of a library in place?
You should be able to edit the file. See my answer for this other question. Remember to press Command+S or Control+S to commit your changes.
I found what I was doing wrong. I needed to set a flag to false in my code base to use uncompiled javascript.

How to find the source file of the javascript

I'm using Primefaces 5.1. When I load my web page, go into the Firefox debugger and look into the javascript, I see that it has loaded some javascript (Primefaces.js.jsf to be precise) which is part of Primefaces 5.0 version. Now, I have taken care to delete all the references of 5.0. But still I get the same result.
So, my question is- when a web page is loaded, and we see the javascript files loaded, how do we know where a particular script file is being retrieved from?
P.S: I'm not the one who wrote the code to include this js. it is part of the framework. So, I have no control over where it is being accessed from. All I can do is if I know the path of the file, I can modify it to suit my needs.
I have deleted the history/cache/Temporary files and also loaded the page using Ctrl + F5. Didnt help.
Found out why the project was still referring to PF5.0. The primefaces-5.0.jar still co-existed with primefaces-5.1.jar in the WEB-INF/lib directory of the project residing in the glassfish directory 'glassfish3\glassfish\domains\domain1\eclipseApps'.

config.codekit reverts JS files with output/compilation unchecked

Codekit only allows you to disable compilation of JS files on a per-file basis, but what's worse is it consistently reverts JS files I've already marked as no "compilation/output".
It happens when you open a JS file to edit it, or when you switch Git branches. You don't notice the change, Codekit does a background "refresh", and automatically updates your config.codekit. Next thing you know, you're saving the file, and Codekit is compiling a JS file you don't want.
I can work around by reverting changes to config.codekit, but in a large JS app, this is at best a poor workaround, and sitewide disabling of JS compilation should be an option.
If anyone passes by this question and still needs help, I will give some answers I found which solved the problem for me.
First, you can edit file-processing settings project-wide. In the project settings, it is possible to apply an output parameter to all existing files with the "Apply" button:
Then, you have an option to pause file-watching with a simple shortcut that works across the whole system. It is useful to avoid unwanted changed made to CodeKit's config file when switching branch in Git.
You can find more details about it in the CodeKit online documentation:
Using CodeKit With Git or Subversion
Before you perform any action that will change large numbers of files at once (switching branches, rebasing, pull requests, etc.) you MUST tell CodeKit to ignore file changes.

How to inject javascript on tomcat server without changing jsp/html file

is there a way to inject javascript into pages served by tomcat?
I know it can be performed by http://httpd.apache.org/ but not sure about tomcat.
Reason: I do not wish to edit the deployment by project team to perform instrumentation, they might blame me for code change, but if I can inject without change to their code It will insulate myself from being blamed =x
Please provide reason when voting my question so I can improve.
If you don't care about persistent code, I think the fastest way to inject code is to open up the developer tools and copy&paste the javascript code you need to inject.
In chrome you can edit the source code and when you "save" the changes it will recompile all the javascript code.
Other browsers should have this "feature" as well.
Keep in mind that if you leave/close/refresh the page all the code you have injected will be lost.
Hope this helps

automatic javascript versioning to avoid browser cache clean

My web application uses a bunch of javascript files and I want to version them as and when different releases of my app are out. This is so that the users do not have to clean the cache everytime I publish a new js with my release.
Example for version 0.0.5 for my app I want all my js to be inside app/js/0.0.5/common/ etc
I am using maven. But have no clue how to automate this kind of versioning. I know one thing for sure, will need a replace plugin to replace all tokens in my jsps to the right version number at build time.
You can force browser not to cache files that may update in future like this:
<script src="/app/js/0.0.5/common?nc=<generate unique string here>"></script>
so src will be different every time so browser will not cache this script

Categories

Resources