-
Notifications
You must be signed in to change notification settings - Fork 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
CS2 Discussion: Question: Opt-in ESNext features in 1.x #4936
Comments
From @GeoffreyBooth on 2016-09-20 17:08 Well, modules will go into 1.x. Tagged template literals could be part of 1.x (though simple template literals, a.k.a. CoffeeScript interpolated strings output in ESNext syntax, can’t because that would be a breaking change). We left off in coffeescript6/discuss#28 that if it made sense to build tagged template literals independently of template literals, the former could go into 1.x in addition to both going into 2. That pretty much depends on @greghuc’s motivation to build both versions, though if he builds only the 2 version perhaps someone on your team could adapt that code for a 1.x version and submit that as another PR. I see no reason not to accept it. As for So basically any of these features aside from classes (assuming we’re abandoning the |
From @greghuc on 2016-09-21 07:59 @carlmathisen could you please fill out the survey for devs/teams with maintained Coffescript codebases? It's a short 4 question markdown template, so should not take long. It would be great to get the views of a dev/company with a CS codebase. |
From @GeoffreyBooth on 2016-09-24 20:40 @carlmathisen We were discussing this in #3757. I had originally thought that Modules are the big news of 1.11.0, so cross that one off the list. That leaves tagged template literals as the next big feature that could join the 1.x branch. Assuming they get implemented independently from regular template literals, or can be split out without too much trouble, I see no reason they couldn’t join the 1.x branch. What else would you be eager to see in 1.x? And are you so sure it would be difficult to port your classes to a 2-compatible class syntax? Based on my cursory test with Decaf, all classes that contain only methods—i.e., no class properties or code in class bodies—should parse as is into ES classes. The properties or body code would need to get moved into the constructor. If I’m wrong about this, I would love to see some examples of more complicated classes that would be difficult to refactor (maybe in coffeescript6/discuss#22). |
From @carlmathisen on 2016-09-20 08:37
First off, congratulations to everyone working on import/export making it into master of CoffeeScript 1.x. That is really great news! Have a look here (among a couple of other PRs) for the feature: #4300
Obviously
class
is one of the most important ESNext features we have, and it is a breaking change. It needs to be in 2.0. I would like to make a case for other opt-in features however, such asimport/export
above,await
and template literals, to be put into 1.x as well. It won't make a difference to existing 1.x codebases, because the features won't touch existing syntax. Like withimport/export
, they should be passed directly through - which means that the developer will need to add extra tooling to make it work in the browser.The situation we have at work is that we have a large codebase with CS classes that is less than trivial to port to ESNext classes in CS2. It would be nice to use other opt-in ESNext features without having to do a full upgrade right away. I think we share this boat with many others.
I know @jashkenas is opposed to adding features to 1.x that won't work out of the (compiler) box and thus requires extra tooling, but we already went up against this principle when adding
import/export
support. By the way, writing ESNext with CoffeeScript in Node does not require extra tooling.Note: Sorry if this topic is covered in another thread, but the discussion seemed to be scattered so I decided to start a new thread about this specifically. Please close if this topic has been decided on already.
The text was updated successfully, but these errors were encountered: