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

fix require.extensions registration #3279

Merged

Conversation

michaelficarra
Copy link
Collaborator

Ref #3141, #3054, #2323.

You can now `require('coffee-script/register')` to manually register,
and the compiler auto-registers when directly running a coffee file.
@michaelficarra michaelficarra mentioned this pull request Dec 8, 2013
@vendethiel
Copy link
Collaborator

We should already have tests for this, so I'd say LGTM.

jashkenas added a commit that referenced this pull request Dec 8, 2013
…egistration

fix require.extensions registration
@jashkenas jashkenas merged commit 8cd9ba1 into jashkenas:master Dec 8, 2013
@xixixao
Copy link
Contributor

xixixao commented Jan 7, 2014

@michaelficarra @Nami-Doc We desperately need some documentation for this breaking change.

I think it's currently only documented here:
https://github.com/michaelficarra/CoffeeScriptRedux/wiki/Intentional-Deviations-From-jashkenas-coffee-script

@michaelficarra
Copy link
Collaborator Author

We'll add it to the changelog when we make a release. Are you suggesting something more? We can make it bold our something.

@xixixao
Copy link
Contributor

xixixao commented Jan 7, 2014

Copy that thing somewhere so that people trying master don't have to hunt it down (even in the issues you quoted, the mechanism wasn't clearly stated), I guess the release notes on the website should be enough since that behavior is only documented there in the first place.

@michaelficarra
Copy link
Collaborator Author

Okay. For anyone confused about this change, you now must explicitly register the compiler with require.extensions. This can be done through either of the following methods:

  • CoffeeScript.register()
  • require 'coffee-script/register'

The former is the simplest approach if you already have a reference to the compiler, while the latter is handy for mocha configuration and similar needs.

@connec
Copy link
Collaborator

connec commented Jan 7, 2014

It's probably worth stating in the relevant documentation that the extension will be 'auto-registered' when a file is run with coffee ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants