cancel
Showing results for 
Search instead for 
Did you mean: 

Reload imported JavaScript?

lyamamot
Champ in-the-making
Champ in-the-making
I have some web scripts that import a common JavaScript file. This works well, but if I make changes to the imported script, I have to restart Alfresco to get the changes to show up. Is there a way to avoid having to doing this?
5 REPLIES 5

openpj
Elite Collaborator
Elite Collaborator
Where do you store this common Javascript file?
Usually it could be stored in Alfresco scripts directory.

t_broyer
Champ in-the-making
Champ in-the-making
Where do you store this common Javascript file?
Usually it could be stored in Alfresco scripts directory.

and… ?

When you're doing extensive WebScript'ing, you regularly end up with some "lib" scripts that are imported by several WebScripts (have a look at repo scripts in 3.x, there are a bunch of them).

The thing is, whatever you do (including refreshing the webscripts from the /index webscript), the changes to your "lib" script aren't taken into account until you restart Alfresco. This is a PITA.

I'm experiencing this too with an Alfresco 2.2E, storing my webscripts in the classpath (in the webapp, as we're deploying using an AMP, but editing the files directly on a test server allows to test changes quickly without repackaging/redeploying the AMP). In 2.2E, you're not even forced to refresh webscripts' JS files, as they aren't pre-compiled, contrary to 3.x (for performance reasons) and FTL files.

lyamamot
Champ in-the-making
Champ in-the-making
I'm experiencing this too with an Alfresco 2.2E, storing my webscripts in the classpath (in the webapp, as we're deploying using an AMP, but editing the files directly on a test server allows to test changes quickly without repackaging/redeploying the AMP). In 2.2E, you're not even forced to refresh webscripts' JS files, as they aren't pre-compiled, contrary to 3.x (for performance reasons) and FTL files.

Hmm, this is the first I've heard about 3.x precompiling JS files. Do you have more information about this? It seemed to start happening with the 3.1 release, and not with 3.0 and 3.0.1 .

t_broyer
Champ in-the-making
Champ in-the-making
Hmm, this is the first I've heard about 3.x precompiling JS files. Do you have more information about this? It seemed to start happening with the 3.1 release, and not with 3.0 and 3.0.1 .

Right, 3.1 only. Revision 12940, merged into HEAD at rev 13530.

(though JS precompilation doesn't change anything re out current problem AFAICT)

buddycasino
Champ in-the-making
Champ in-the-making
I have the same issue, reloading of imported scripts is still not working in 3.3.x. Did you find a solution in the meantime?