A "preset" for Ruby2JS #171
Replies: 2 comments
-
This would be better served by the magic comment idea below: |
Beta Was this translation helpful? Give feedback.
-
Ooo, it would be truly awesome if we could use magic comments for this as well, so on a file-by-file basis you could specify it should use the preset and any additional options. # ruby2js: preset
doStuff() # ruby2js: preset, camel_casing: true
do_stuff() # ruby2js: preset, underscored_private: true, autoimports: false etc. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to make a preset for Ruby2JS. Many compiler/transpiler tools offer a "preset-env" configuration or something like that which is a sane set of defaults good for most projects. It means a lot of code which would be shared or reused across projects will work as expected.
As a starting point, I'm thinking a modern eslevel (likely to be further transpiled by a bundler like esbuild if need be), along with the functions filter, return, and esm. The current "default" without any of those switched on is virtually unusable IMHO, so that's not a good out-of-the-box experience.
This is a good third-party "review" of Ruby2JS outlining some of these issues:
https://dev.to/taw/open-source-adventures-episode-62-ruby2js-119i
Beta Was this translation helpful? Give feedback.
All reactions