-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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 compiler should pass code within backticks to ecmascript package #6691
CoffeeScript compiler should pass code within backticks to ecmascript package #6691
Conversation
…ough the ecmascript package (closes meteor#6000)
This reverts commit 72e7fee.
Neat! |
# Conflicts: # packages/coffeescript/package.js
Together with c18c1f5, this commit is a big step towards liberating Meteor from Node 0.10. Part of meteor#5124.
This reverts commit 00929e8.
This is an adaptation of @tmeasday's 74230be test that he created for meteor#5680. Due to occasional failures, it now uses sinon's `lolex` npm library to allow us to control the setTimeout/setInterval within the test itself, providing for tick-accurate testing. Also nifty because it allows the test to finish in less time than it actually takes.
Note that this may be a breaking change for server-side code that uses Promise.denodeify, Promise.nodeify, Function.prototype.async, or Function.prototype.asyncApply, since those APIs have been removed for the sake of simplicity.
TODO Remember to bump $BUNDLE_VERSION before the next release.
@GeoffreyBooth also note that the |
@benjamn I’m happy to work on this, should I just merge |
The most substantive change here is the additional call to colonConverter.convert, which fixes meteor#7096. In the future, I would like to unify this implementation with similar logic in tools/static-assets/server/npm-require.js.
…ript-backticks-ecmascript
…piler if the source contains backticks
Okay, I’ve revised per @benjamn:
I also took out the Since I merged the |
Great, thanks for taking the time to make these updates. I'll take a closer look at this tomorrow. |
Ok, I've rebased these changes with a few cleanups (leaving your authorship intact), and pushed them to |
Thanks for bearing with us on this one @GeoffreyBooth ! |
Thanks! |
@benjamn Do you mind explaining 73ed3ff, where you added code to merge the CoffeeScript compiler’s source map with the Babel compiler’s source map? Why was that necessary? I’m considering adding Babel transpilation as an option to the CoffeeScript compiler itself; see jashkenas/coffeescript#4696. The idea is that it’s not the easiest challenge for people to figure out how to set up a build chain where CoffeeScript’s output gets piped through Babel, so if we can simplify that part, we might as well. And the CoffeeScript compiler should especially offer this if there’s special handling required for source maps to work properly, as I’m assuming there must be for you to have added that code. So . . . what problem does merging the source maps solve? I want to be able to write a test that fails if the source maps are unmerged, and passes if they are. |
P.S. @benjamn did you see this? babel/babel#827 (comment) |
Anwering #9090 (comment): The However, I'm still not sure what exactly caused the source maps to be broken. The implementation of |
This pull request implements the following for the core
coffeescript
package:.coffee
file contains backticks, the CoffeeScript output is passed throughecmascript
. This enables ES2015 written within backticks to work, while avoiding the performance hit of sending all CoffeeScript code throughecmascript
. Closes [1.3-modules-beta.4] modules not working with coffeescript #6000.import
statements wrapped in backticks work, whether importing from an external package or from a local .js file that has anexport
statement. All the old package tests still pass.coffee-script
module version from 1.9.2 to 1.10.0 (released 2015-09-03 and considered stable). Closes Bump coffeescript to 1.9.3 #4807.coffeescript
package version from 1.0.16 to 1.1.0.Besides the included tests, I’ve created a demo app that uses this new package.