-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Experimental Traceur features/ES7 #1939
Comments
|
👍 got a repo I'm running in production with many of these experimental features right now: https://github.com/jlipps/triager JSHint seems confused by a number of the features I'm using, not all of which are isolated to ES7 I don't think. |
|
We're using async/await as well and would love to see this supported. |
|
Supporting "experimental features" in SpiderMonkey has left JSHint with some seriously complex messes to clean up, sort through and/or undo in preparation for ES6. I want to see a comprehensive proposal for supporting things that might churn a bit between now and 2016. What happens if TC39 ultimately rejects
The best way to get those problems resolved is to file issues here—thanks in advance. |
|
One option is to have async/await option that tracks transpilers that support this feature, independent of any ES spec. I think there's enough interest and willingness to use transpilers that they're not going away. Another option is to have an experimental flag that enables next spec features (ES7/8) and those are known to change in accordance with an ever evolving spec. |
I can live with this. |
|
Notes...
eg. experimental: ["async", "await" ] |
|
I don't mind taking a stab at adding and maintaining some of the experimental stuff into jshint. I've added async/await support to a local copy, and placed it under a 'traceur' flag. The only questions I have at the moment:
|
|
I suggest calling it async/await since that's the common name of the feature, and it's not specific to Traceur. |
|
This seems to work here: #1979 To install it: |
|
To be clear async/await is two keywords for a single feature. In order to use |
|
I've just updated the options use |
|
@assaf but what happens if either of those two words is changed through the process of proposal refinement (aka. bikeshedding), then it would be smart they we treated them separately. |
|
If there are enough people interested in es7 it's probably better to fork and pull regularly from upstream. |
|
@rwaldron beware adding complexity for an eventuality that's unlikely to materialize. We know what the keywords are called today, we know the name wasn't a coin toss (it has usage history, e.g. see C#), we know of no proposal to change that. But more specifically, if a change was to happen, we have no idea how we'll tackle it. It takes a long while to propagate changes through eco-system of tooling and existing code bases. Do we immediately drop support for async/await? Add new syntax but keep feature name (as known)? Add new syntax and rename feature? Run two features side by side until we can discard one? All these options. Are we taking a guess at what would be the best course of action for a theoretical scenario at an undetermined point in the future? Or do we just go with what we presently know? |
|
@assaf would be good to extract some sort of plugin mechanism, even expose an api. That would make the transition more organic. But right know it very hard to see where the hooks would be (at least for me). |
|
@sebv not sure I understand what you mean by that. I tried tackling this before, given that |
|
@assaf I think I start to see how to implement that. This is a list not exhaustive of moving part I discovered while implementing async/await: What you can add (components):
What you can call (utils):
What would be good is for instance instead of adding a block or prefix directly in |
|
Hi, I read through a few pull requests and issues regarding support of ES7 async/await, but it seems the conversation has died off. Has there been any other thinking or progress towards support in some shape or form? |
|
👍 |
|
Nothing's been discussed off-line--the conversation on GitHub is the extent of it |
|
Do I understand correctly that async/await won't be handled (supported or ignored) until a plugin system is developed? |
|
Please remember that the async/await is a proposal for a far-future version of the language and not a specification. Beyond the initial development effort, extending JSHint core with support for this syntax would be a burden on both the maintainers and the consumers. Changes to the proposal will need to be reflected in the user's platform (whether a runtime or a transpiler), the user's code, and also in JSHint itself. It would be hard enough for JSHint to synchronize updates with platform changes, but the problem becomes intractable when you recognize that the userbase will upgrade incrementally. (Proposal changes might seem unlikely, but we're even today struggling with last-minute modifications to ES6's module syntax--see gh-2019 and gh-2036 for a couple examples.) This is why prior to standardization, the healthiest way for JSHint to support this syntax would be through a plugin system. Once this feature approaches standardization, I expect JSHint's core will be extended to support it natively (just as is happening with ES6 features today). @rwaldron @caitp @mikesherov If this reasoning reflects your thoughts, I think it would be best to close this issue. |
|
How long for the plugin system to emerge? |
|
I certainly appreciate how a request to support async/await may feel like a burden on the JSHint contributors, but I just wanted to provide my perspective and nothing more to encourage support in spite of @jugglinmike's stated concerns: With the rise in popularity of transpilers (with support for async/await) like traceur and especially babel, the flood of increasingly standardized ESNext features (further encouraging the use of transpilers), the proliferation of promises, and the present support for generators in node.js and io.js (which makes async/await sugar for function* instead of a hack), async/await will see a dramatic increase in usage in the near future. Further, the popularity of talks like @jhusain's excellent ES7 talks at NodeDay and NodeSummit add to the async/await excitement. At Noderiety and the companies I partner with for node.js training, we're teaching generators/promise first development, and the only thing limiting teaching async/await first is JSHint support. So obviously I'm bias, but the presence of async/await causes JSHint to go crazy, and makes it almost unusable (admittedly, not the fault or responsibility of the JSHint project). Something as simple as just ignoring (or stripping when linting) the async/await keywords would at least make it possible to use both async/await and JSHint together. Please consider providing some minimal hack or workaround to at least make JSHint and async/await not incompatible, or consider leaving this issue open and providing some guidance on how to add such a workaround in a manner that would be successfully merged. Thanks. |
|
For anyone in the same boat as me, I was able to get |
|
@CrabDude thanks, that is also the direction I am moving. |
This has been suggested and I'm all for it. |
|
@rwaldron Excellent. At least this would change this issue from a "wontfix" to an open issue to ignore async/await keywords until it is finalized, for the happy fellow that has time to implement it, wherever he may be. =) |
thank you for pointing me in the right direction |
|
I'd really like to see some solution for this. Currently it makes JSHint a bit unusable as it just ends up saying "Too many errors". |
|
@billinghamj You can read more about this issue here: http://jshint.com/blog/new-lang-features/ . In the short-term, your best bet is JSHint's |
|
@jugglinmike Is it possible to put "ignore" in the config and get it to ignore "async" and "await" as keywords entirely? |
|
@billinghamj nope, sorry. |
|
@jugglinmike has raised this clear proposal - #2601 which supersedes this. I'm closing for clarity (there are alot of old comments on this issue) |
One experimental/ES7 feature supported through Traceur that I want to start using today is async/await.
What is JSHint’s stance on supporting experimental Traceur features i.e. ES7, e.g.
async/await?The text was updated successfully, but these errors were encountered: