-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Better fast transformers #465
Comments
|
@monsanto Maybe another flag than |
@monsanto totally agree. |
👍 I would wait until we actually get the request for that and decide what to do, there's only two right now so it's not a big deal to specify each of them. |
@thejameskyle Ideally I'd like to make a ton of the transformers have fast options as there are really nitpicky spec stuff. |
@sebmck Fair enough. It should definitely warn the user wherever possible. |
@thejameskyle bought up a good point on gitter (re: calling them "fast")
Doesn't anyone have any alternate terminology suggestions? I'm currently sitting on some commits that adds the |
Just some suggestions but none really stand out above the others, they're all a bit woolly. |
@swirlycheetah |
--quick-compile or --fast-compile should prevent the ambiguity between what is actually intended to get faster. I realize it impractical, but it would be great to understand which spec cases I am opting out of. As I, others and potential future bug reports are likely nervous to have not quite compliant output, although I suspect if the trade offs are documented and well known. The concern may go away entirely. |
@stefanpenner I absolutely agree on documenting the spec deviations. Whatever documentation is present is going to have very visible warnings as well as extensive documentation on the pros and cons, possible side effects and caveats. |
Maybe following the -o flags from gcc? Although I suspect the target audience may not not all be familiar with those |
Yeah, doesn't seem entirely apt either since they aren't really optimisations. |
How about |
not a serious recommendation, but i had a small personal lol: |
@stefanpenner Haha, that was actually a suggestion given to me that lead to just |
Going to use this post as my scratchpad for loose changes, feel free to make suggestions other additions. These will of course be thoroughly documented.
|
We should give examples that fail for each of these in the docs. |
+1 for |
loose option for template literals here #480 . |
Released in 2.12.0 |
@sebmck your a machine. |
There should be a way to apply loose mode to all transformers, for example
|
@chicoxyzzy Wouldn't be possible to set it via the CLI etc then, it'd have to be a string like |
|
I've added loose mode docs. They're a bit iffy and the wording is odd, pull requests improving it would be extremely appreciated. Thanks everyone! |
I'm currently thinking of good strategies to proceed with having fast transformers. Basically, to avoid having a ton of optional transformers I think it'd be best to have a
fast
flag. Basically you'd do something like6to5 --fast forOf
ortransform("code", { fast: ["forOf"] });
.Since adding the
classesFastSuper
transformer I realised that the current way of having optional transformers isn't really scalable. I'd really like to do a bunch of other stuff such as using assignment vs define on computed properties, classes etc. This would obviously be extensively documented in a "fast" section on the 6to5 docs. To enable all the fast transformers you could just go6to5 --fast all
or something similar.This would obviously be a breaking change since I'd be removing the current fast optional transformers so it'll either wait until 3.0.0 or be added in a backwards compatible way.
/cc @monsanto
The text was updated successfully, but these errors were encountered: