No, we cache it locally. We only use it to compress the javascript if
we detect that the sha1 hash of the javascript content has changed.
If the content is different, then we run it through the closure
compiler rest api, then save the contents to a file locally.
However, as a side note, I did discover something interesting. This
code causes the closure compiler to bomb, but is technically legal
javascript:
Some code had this javascript:
if (settings.class) {
anchor.attr('class', settings.class);
}
When running through closure rest api, it returns an empty string but
does not return a warning or error message. Is this a side effect of
using Java as compression here? class might be reserved in Java, but
should be legal in javascript.
Here's an example. The code below works fine for testCode1, but fails
on testCode2. The only difference between the content is that
testCode2 has "settings.class", instead of "settings.clas". The
javascript is technically valid, why would closure fail for testCode2?
On Wed, Apr 20, 2011 at 7:53 PM, Dean Mao <dean...@gmail.com> wrote: > No, we cache it locally. We only use it to compress the javascript if > we detect that the sha1 hash of the javascript content has changed. > If the content is different, then we run it through the closure > compiler rest api, then save the contents to a file locally.
> However, as a side note, I did discover something interesting. This > code causes the closure compiler to bomb, but is technically legal > javascript:
> Some code had this javascript:
> if (settings.class) { > anchor.attr('class', settings.class); > }
> When running through closure rest api, it returns an empty string but > does not return a warning or error message. Is this a side effect of > using Java as compression here? class might be reserved in Java, but > should be legal in javascript.
> Here's an example. The code below works fine for testCode1, but fails > on testCode2. The only difference between the content is that > testCode2 has "settings.class", instead of "settings.clas". The > javascript is technically valid, why would closure fail for testCode2?
> On Apr 20, 4:28 pm, Nick Santos <nicksan...@google.com> wrote: > > Are you sending a request to the closure-compiler web service on every > > request of your production app?
> > If this is what's you're doing, it would not surprise me if DDOS > > protection kicked in and blocked you.
> > On Wed, Apr 20, 2011 at 7:22 PM, Dean Mao <dean...@gmail.com> wrote: > > > This is a simplified version of what is running in our production app:
Shouldn't it produce an error and tell me then? If I use
output_format as 'xml', and output_info as 'warnings', it doesn't
return anything that would tell me the problem. It just dies
silently.
On Apr 20, 5:02 pm, Joseph Schorr (יוסף שור) <jsch...@google.com>
wrote:
> 'class' is technically a reserved word in the ECMAScript spec, so the
> Closure compiler could be parsing it as such (and therefore, failing).
> On Wed, Apr 20, 2011 at 7:53 PM, Dean Mao <dean...@gmail.com> wrote:
> > No, we cache it locally. We only use it to compress the javascript if
> > we detect that the sha1 hash of the javascript content has changed.
> > If the content is different, then we run it through the closure
> > compiler rest api, then save the contents to a file locally.
> > However, as a side note, I did discover something interesting. This
> > code causes the closure compiler to bomb, but is technically legal
> > javascript:
> > When running through closure rest api, it returns an empty string but
> > does not return a warning or error message. Is this a side effect of
> > using Java as compression here? class might be reserved in Java, but
> > should be legal in javascript.
> > Here's an example. The code below works fine for testCode1, but fails
> > on testCode2. The only difference between the content is that
> > testCode2 has "settings.class", instead of "settings.clas". The
> > javascript is technically valid, why would closure fail for testCode2?
> > On Apr 20, 4:28 pm, Nick Santos <nicksan...@google.com> wrote:
> > > Are you sending a request to the closure-compiler web service on every
> > > request of your production app?
> > > If this is what's you're doing, it would not surprise me if DDOS
> > > protection kicked in and blocked you.
> > > On Wed, Apr 20, 2011 at 7:22 PM, Dean Mao <dean...@gmail.com> wrote:
> > > > This is a simplified version of what is running in our production app:
On Wed, Apr 20, 2011 at 5:12 PM, Dean Mao <dean...@gmail.com> wrote: > Shouldn't it produce an error and tell me then? If I use > output_format as 'xml', and output_info as 'warnings', it doesn't > return anything that would tell me the problem. It just dies > silently.
> On Apr 20, 5:02 pm, Joseph Schorr (יוסף שור) <jsch...@google.com> > wrote: > > 'class' is technically a reserved word in the ECMAScript spec, so the > > Closure compiler could be parsing it as such (and therefore, failing).
> > On Wed, Apr 20, 2011 at 7:53 PM, Dean Mao <dean...@gmail.com> wrote: > > > No, we cache it locally. We only use it to compress the javascript if > > > we detect that the sha1 hash of the javascript content has changed. > > > If the content is different, then we run it through the closure > > > compiler rest api, then save the contents to a file locally.
> > > However, as a side note, I did discover something interesting. This > > > code causes the closure compiler to bomb, but is technically legal > > > javascript:
> > > When running through closure rest api, it returns an empty string but > > > does not return a warning or error message. Is this a side effect of > > > using Java as compression here? class might be reserved in Java, but > > > should be legal in javascript.
> > > Here's an example. The code below works fine for testCode1, but fails > > > on testCode2. The only difference between the content is that > > > testCode2 has "settings.class", instead of "settings.clas". The > > > javascript is technically valid, why would closure fail for testCode2?
> > > On Apr 20, 4:28 pm, Nick Santos <nicksan...@google.com> wrote: > > > > Are you sending a request to the closure-compiler web service on > every > > > > request of your production app?
> > > > If this is what's you're doing, it would not surprise me if DDOS > > > > protection kicked in and blocked you.
> > > > On Wed, Apr 20, 2011 at 7:22 PM, Dean Mao <dean...@gmail.com> wrote: > > > > > This is a simplified version of what is running in our production > app: