Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coffeescript plugin support #214

Open
brianmhunt opened this issue Jan 8, 2013 · 2 comments
Open

Coffeescript plugin support #214

brianmhunt opened this issue Jan 8, 2013 · 2 comments

Comments

@brianmhunt
Copy link

It would be wonderful to have support for the CoffeeScript cs! plugin. Example implementations:

@jakobo
Copy link
Contributor

jakobo commented Jan 8, 2013

I think that's a pretty reasonable request. Out of the box, it does support the AMD plugin in 0.4.1.

Do you think there's any value in adding a direct-plugin, which would enable localStorage support and some of Inject's other features such as pointcuts?

Thanks for the feedback!

@brianmhunt
Copy link
Author

I think a direct plugin could benefit from being added to Inject proper if localStorage could be used, but let me know what you think.

There are a few stages of coffee-script building that a loader could perform:

  1. downloading the .coffee file
  2. compiling the coffee-script into javascript
  3. creating a source-map between the coffeescript & javascript
  4. caching
    a. the javascript
    b. the source map
    c. the coffeescript

Parts 1 & 2 are the sine qua non of the plugin. Part 4.a would definitely provide an incredible performance boost if it eliminated the download and compilation parts, and it sounds like localStorage/Inject could provide that sort of caching.

Parts 3, 4.b and 4.c would be coffee-script developers' heaven, but obviously they are somewhat more challenging.

EDIT One prerequisite to using coffee-script with Inject is that the CoffeeScript compiler would need to be downloaded. The Inject plugin could detect whether there is a window.CoffeeScript object, or make 'coffee-script' a dependency of the cs! plugin, but I have not wrapped my head around how that work work.

For my purposes I am simply including <script src='coffee-script.js'></script> before the Inject require.run call i.e. not loading coffee-script with Inject. In an ideal world, coffee-script would be loaded by Inject.

@ghost ghost assigned jakobo Jan 17, 2013
@ghost ghost assigned jhoff Jan 30, 2013
@jhoff jhoff removed their assignment Jan 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants