Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Brian Donovan
    @eventualbuddha
    Hello world :smile:
    Alan Pierce
    @alangpierce
    :tada:
    Heitor Neiva
    @hneiva
    :fireworks:
    Brandon Mason
    @bitmage
    @alangpierce trying to run decaffeinate and preserve commonjs modules...
    it seems like the default is to convert to es6 exports, and the only flag available to me also switches it to es6 exports
    so essentially there's no option to explicitly say "use commonjs"
    Brian Donovan
    @eventualbuddha
    @bitmage the default should be not to convert to ES6 modules. Are you sure you’re using the latest decaffeinate?
    Brandon Mason
    @bitmage
    3.3.3
    strangely enough, it respected it with some files but not others
    I just manually changed the imports back to require statements
    Alan Pierce
    @alangpierce
    @bitmage Oops, sorry, I had this closed and I guess I hadn't set up email notifications. Strange that it would convert to ES6 import/exports. If you still have an example file where that happens, you could paste into the repl ( http://decaffeinate-project.org/repl/ ) and see if it happens there.
    Keegan Stothert
    @keeganstothert
    hello all, our projects uses cjsx we have about 400 components that we need to decaffeinate. I'm wondering if this works with coffeescript 2 and jsx?
    Brian Donovan
    @eventualbuddha
    @keeganstothert there was some discussion about it here: decaffeinate/decaffeinate#78
    Alan Pierce
    @alangpierce
    @keeganstothert CS2 isn't supported at the moment but it's possible it'll just work or only need minor modifications, depending on what features you're using. There's a project called depercolator that wraps decaffeinate and cjsx-transform that you might find useful: https://github.com/bugsnag/depercolator . See this blog post about it: https://blog.bugsnag.com/converting-a-large-react-codebase-from-coffeescript-to-es6/
    WEB-WORKER
    @WEB-WORKER
    hello! help please. why decaffeinate compiles const instead var ?
    Alan Pierce
    @alangpierce
    Hi @WEB-WORKER, new JS code should be using let or const for all variable declarations and never use var, so decaffeinate always prefers const or let when possible. Some explanation is in the eslint rule docs: https://eslint.org/docs/rules/no-var
    j_schn14
    @jo-soft
    hey guys.
    i've some trouble to checkout the src to do some local development. on master (and on v.4.8.8) the linter always shows some errors s.t. npm install or npm run build always fails
    j_schn14
    @jo-soft
    nm got it workn
    Tuyen Pham
    @tuyenpm9
    hi all.
    totally new to js and coffee, and viola just seen decaffeinate, I wonder: coffeescript is dead?
    Alan Pierce
    @alangpierce
    Hey @tuyenpm9 . CoffeeScript has been losing popularity, and it's much more common for new projects to be in JavaScript now, and of course decaffeinate is designed to help people move off of CoffeeScript. That said, CoffeeScript has been revitalized a bit with CoffeeScript 2.0, so you may want to check it out, but I'd still recommend JavaScript (or TypeScript) for new projects.
    neel7h
    @neel7h
    hi
    Is there a way to combine 3 - 4 CoffeeScript file and decaffeinate into 1 Javascript file
    Alan Pierce
    @alangpierce
    @neel7h Hi. No, decaffeinate just operates on individual files. You could combine them into one CoffeeScript file and then run decaffeinate, or you could run decaffeinate on them and then combine them after they're in JS, but decaffeinate itself won't do any combining.
    Alexander Mextner
    @a-x-

    What coffeescript repl you use?


    @eventualbuddha, I typically just use the one at https://decaffeinate-project.org/repl/ if I need to examine something. What are you trying to do with the repl?

    say, I wanna recognize some coffeescript node type
    I forget what ast repl I can use for coffee
    Alan Pierce
    @alangpierce
    @a-x- in case you haven't seen it, the decaffeinate repl shows the coffeescript tokens and nodes with the first two "run to stage" options. Technically the nodes are a little different since it's the nodes after decaffeinate-parser does a little bit of canonicalization.
    Screen Shot 2019-02-13 at 8.00.56 PM.png
    Alexander Mextner
    @a-x-
    I got, thank you,
    @alangpierce
    Sander Rijken
    @srijken
    just ran across decaffeinate.. looks to be meant for converting coffee to plain JS as a one time step. I want do do a PR to an existing library that's written in coffeescript to add an ES6 output (currently the dist build only contains requirejs/amd/systemjs). Is it possible to set up decaffeinate (or bulk-decaffeinate) as a build step?
    Alan Pierce
    @alangpierce
    @srijken I believe the CoffeeScript 2 compiler will do that for you. decaffeinate generally shouldn't be used as a build step, since it's much slower than normal compilers and focuses much more on nice-looking output (sometimes at the expense of strict correctness).
    Sander Rijken
    @srijken
    @alangpierce That's great, I'll look into that, thanks
    Pawel
    @DVLP
    Thanks for making this project! Just managed to decaffeinate a racing game :) CodeArtemis/TriggerRally#76
    Alan Pierce
    @alangpierce
    :tada: cool!