Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
closure rest api down?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dean Mao  
View profile  
 More options Apr 20 2011, 7:22 pm
From: Dean Mao <dean...@gmail.com>
Date: Wed, 20 Apr 2011 16:22:27 -0700 (PDT)
Local: Wed, Apr 20 2011 7:22 pm
Subject: closure rest api down?
This is a simplified version of what is running in our production app:

require 'net/http'
javascript = "window.asdf = function () {console.log('hello');}"
res = Net::HTTP.post_form(URI.parse('http://closure-
compiler.appspot.com/compile'), {
                            'js_code' => javascript,
                            'compilation_level' =>
'SIMPLE_OPTIMIZATIONS',
                            'output_format' => 'text',
                            'output_info' => 'compiled_code'
                          })
p res
p res.body

Right now res.body is a newline character -- essentially it is
returning nothing.  It was working fine yesterday however.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Santos  
View profile  
 More options Apr 20 2011, 7:28 pm
From: Nick Santos <nicksan...@google.com>
Date: Wed, 20 Apr 2011 19:28:48 -0400
Local: Wed, Apr 20 2011 7:28 pm
Subject: Re: [closure-compiler-discuss] closure rest api down?
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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dean Mao  
View profile  
 More options Apr 20 2011, 7:53 pm
From: Dean Mao <dean...@gmail.com>
Date: Wed, 20 Apr 2011 16:53:41 -0700 (PDT)
Local: Wed, Apr 20 2011 7:53 pm
Subject: Re: closure rest api down?
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?

require 'net/http'
testCode1 = "function test() {if (settings.clas)
{console.log('hello')}}"
testCode2 = "function test() {if (settings.class)
{console.log('hello')}}"
res = Net::HTTP.post_form(URI.parse('http://closure-
compiler.appspot.com/compile'), {
                            'js_code' => testCode2,
                            'compilation_level' =>
'SIMPLE_OPTIMIZATIONS',
                            'output_format' => 'text',
                            'output_info' => 'compiled_code'
                          })
p res.body

On Apr 20, 4:28 pm, Nick Santos <nicksan...@google.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
יוסף שור Joseph Schorr  
View profile  
 More options Apr 20 2011, 8:02 pm
From: Joseph Schorr (יוסף שור) <jsch...@google.com>
Date: Wed, 20 Apr 2011 20:02:09 -0400
Local: Wed, Apr 20 2011 8:02 pm
Subject: Re: [closure-compiler-discuss] Re: closure rest api down?

'class' is technically a reserved word in the ECMAScript spec, so the
Closure compiler could be parsing it as such (and therefore, failing).


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dean Mao  
View profile  
 More options Apr 20 2011, 8:12 pm
From: Dean Mao <dean...@gmail.com>
Date: Wed, 20 Apr 2011 17:12:34 -0700 (PDT)
Local: Wed, Apr 20 2011 8:12 pm
Subject: Re: closure rest api down?
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alan Leung  
View profile  
 More options Apr 20 2011, 8:19 pm
From: Alan Leung <acle...@gmail.com>
Date: Wed, 20 Apr 2011 17:19:08 -0700
Local: Wed, Apr 20 2011 8:19 pm
Subject: Re: [closure-compiler-discuss] Re: closure rest api down?

http://code.google.com/closure/compiler/docs/api-ref.html

You'd need output_info=error and warning as well.

-Alan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »