New Content - Implemented "monsterid" : New combat macro predicate

djve

New member
This new predicate produces an error in the syntax checker. Should be a trivial update to the appropriate section.
 

MCroft

Developer
or perhaps a better question, is "how are you using it that's breaking the syntax checker?" I did the trivial-est update to add it...
 

Veracity

Developer
You did not update the version number in .js file name to force the browser to not continue using a cached download file?
Also update this constant in KoLConstants.java:

Code:
    public static final String MACROHELPER_JS = "macrohelper.4.js";
 

MCroft

Developer
aha! the door opens and the little light goes on...

Should I also update the version in the last line? Do we normally keep it in sync with the revision of the file? e.g. macrohelper.4.js ==v1.4, macrohelper.5.js == v1.5?

output.value = "No errors found (KoLmafia syntax checker v1.4)";

I have the fix in my sandbox, once I know if I should also change the printed output.
 
Renaming the file every time we make a change sounds unscaleable.

Can't we just force the browser to load the file every time, by passing Cache-Control: no-store, max-age=0 in the HTTP response header?
 

fronobulax

Developer
Renaming the file every time we make a change sounds unscaleable.

Can't we just force the browser to load the file every time, by passing Cache-Control: no-store, max-age=0 in the HTTP response header?

These are files that KoLmafia distributes. I'm not sure how scalability enters into it unless the JS community is already relying upon mafia provided JS. If so, perhaps this should be a separate FR? My recollection is that mafia adopted the naming convention because of mafia dependencies and not just because of browser caching.
 

MCroft

Developer
I suspect that this is a problem more for newbies like me. I toyed with the idea of adding a comment to the JS to the effect of

JavaScript:
// KoLmafia version 1.5.  To modify this file in KoLmafia:
// bump the version of this file in the following places ...
// 1: the filename (e.g. macrohelper.5.js to macrohleper.6.js)
// 2: KoLConstants.java MACROHELPER_JS =
// 3: in the output.value of this file ("No errors found (KoLmafia syntax checker v1.5)" to ...v1.6 )

but then inexplicably didn't.
 
Top