js hangs compressing a project that uses date.js

24 views
Skip to first unread message

George S

unread,
Sep 21, 2010, 7:31:07 PM9/21/10
to JavaScriptMVC
When I try to compress a project that depends on date.js (http://
www.datejs.com/), js hangs.

Steps to reproduce:

1. git clone http://github.com/jupiterjs/framework.git
2. git submodule init && git submodule update
3. git submodule foreach git pull
4. git submodule foreach git checkout
5. ./js jquery/generate/app cookbook
6. wget http://datejs.googlecode.com/files/date.js -O cookbook/
resources/date.js
7. echo '.resources("date")' >> cookbook/cookbook.js
8. ./js cookbook/scripts/build.js

"Building to cookbook/" ... and then nothing.

I haven't tried to debug; date.js modifies the underlying js Date
object by adding fields and methods. I've been using it successfully
in the development environment, but I'd love a workaround that allows
me to continue using it with a compressed production.js ...

Thanks,

George

Brian Moschel

unread,
Sep 21, 2010, 7:53:10 PM9/21/10
to javasc...@googlegroups.com
You could have this file not compress.

You could also try to see what in datejs is breaking in the compressor.  I'd do this by removing chunks of the file, then slowly adding it back until it breaks again, so you can see where its going bad.  Chances are datejs is doing something envjs doesn't expect.

I think I remember someone else on the forum having a similar issue a while ago, but don't remember the solution, he might have just ignored the file.

- Brian


--
You received this message because you are subscribed to the Google Groups "JavaScriptMVC" group.
To post to this group, send email to javasc...@googlegroups.com.
To unsubscribe from this group, send email to javascriptmv...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javascriptmvc?hl=en.




--
Brian Moschel

Jupiter Consulting
\Development\Training\Support
847-727-1609
brian....@gmail.com

George S

unread,
Sep 21, 2010, 7:59:14 PM9/21/10
to JavaScriptMVC
Hi Brian,

Thank you for your response. Is there a way to have this file not
compressed, but still have it loaded by the steal script? Or do I
simply have to remove it from my configuration JavaScript file, and
add a direct reference to the file in the HTML?

Thanks very much
George

Alexandre Gomes

unread,
Sep 21, 2010, 7:46:09 PM9/21/10
to javasc...@googlegroups.com
Try not compressing datejs.

On Tue, Sep 21, 2010 at 6:31 PM, George S <gpru...@gmail.com> wrote:

Brian Gray

unread,
Oct 8, 2011, 11:57:37 AM10/8/11
to javasc...@googlegroups.com
I am having this same issue.  How do you tell steal not to compress? 

I have tried to include the js this way:

<script type='text/javascript' src='lib/date.js' compress='false'></script>

But ideally I would pull it in from the main js file:

steal(
 ...
 'lib/datejs',
...
);

Thanks!
-Brian

Brian Moschel

unread,
Oct 23, 2011, 6:00:12 PM10/23/11
to JavaScriptMVC
Please ask on our main forums:

http://forum.javascriptmvc.com/#home
Reply all
Reply to author
Forward
0 new messages