Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: What is your Javascript-workflow?

by maard (Pilgrim)
on May 01, 2013 at 00:53 UTC ( [id://1031489]=note: print w/replies, xml ) Need Help??


in reply to What is your Javascript-workflow?

Do not generate your JavaScript from Perl. That's no different from generating HTML from Perl, which is very 1990'ish.

Very often JavaScript stays static and shouldn't be changed on each request (think of your functions/classes, they don't change). You can put such code into separate .js files and benefit from caching of static files. If you still need to conditionally generate JavaScript parts in your HTML output (such as variables interpolation) Template::Toolkit comes to the rescue the same way it helps to generate HTML.

Another suggestion, to reduce the number of typed characters and add more readability is to use CoffeScript or any similar language, which translates to more verbose JavaScript.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1031489]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-24 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found