Last modified: 2012-07-09 21:32:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T40236, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38236 - Allow direct usage of coffeescript in addition to normal javascript
Allow direct usage of coffeescript in addition to normal javascript
Status: NEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-07 20:21 UTC by Carl Fürstenberg
Modified: 2012-07-09 21:32 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Carl Fürstenberg 2012-07-07 20:21:20 UTC
While I understand there are as many people hating coffeescript as loving it, I think it could be a nice idea to allow linking directly to coffeescript files, which are processed into javascript on save

See http://coffeescript.org/ for more information.

Example:

instead of typing
 $(function(){
   $(".foo").click(function(e){
     this.html("hello");
   });
 });

you type:
 $ ->
   $(".foo").click (e) ->
     @html "hello"
Comment 1 Krinkle 2012-07-08 23:02:36 UTC
Can you be more elaborate in what you're requesting?

How is this a request for MediaWiki core javascript? How do you see this working?

Perhaps this could be an idea for an Extension that extends Gadgets, but I'm not sure how this fits in core. Unless it would be a feature in to ResourceLoader.

cc-ing Roan.
Comment 2 Brion Vibber 2012-07-09 21:24:35 UTC
I suppose you could have a filter in ResourceLoader that loads coffeescript modules by transforming them to JavaScript (shell out to converter or something?) Not sure how best to implement such a thing.
Comment 3 Krinkle 2012-07-09 21:32:26 UTC
It would have to perform *very* well to be acceptable in ResourceLoader because of the high standards in performance and on-demand package generation.

If that level cannot be reached, this should likely become part of your build process and instead refer to the build dir from the module definition. This would at least work on the short term (as in, right now).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links