react-rails icon indicating copy to clipboard operation
react-rails copied to clipboard

Source map support for transpiled jsx

Open rstudner opened this issue 8 years ago • 5 comments

Maybe i'm missing something obvious.

I write some .jsx files..

class MyComponent extends React.Component {

  _someMethod() {

  }
}

with webpack and other tools.. I can see "this" in the chrome source view/debugging.

With the 1.6.2 react rails gem, I see, of course:

    shouldComponentUpdate(WidgetName, [{
        key: "shouldComponentUpdate",
        value: function shouldComponentUpdate(nextProps, nextState) {
            var shouldUpdate = etc || etc..
            return shouldUpdate;
        }
    }

rstudner avatar Mar 17 '16 15:03 rstudner

Sorry, I don't really understand this issue! Could you try rephrasing it in the form:

  • What currently happens
  • Why that's bad
  • What you want to happen

?

rmosolgo avatar Mar 25 '16 12:03 rmosolgo

+1 This feature is critical to debug productivity with browser tools. The browser should show the .es6.jsx if possible. However if it shows the .es6 file after jsx transpiling will be also an advance.

I think babel support source maps out-of-the box as it does Typescript transpiler or coffescript gems for rails.

Thanx,

ludiazv avatar Dec 21 '16 15:12 ludiazv

Hi @rmosolgo @rstudner @ludiazv I know I'm late to the game here but is there a solution for this? I'd like to get source maps working as well. It doesn't look like .bablerc options work.

What currently happens?

  • source files emited as non-es6 without source mapping files.

Why that's bad

  • debugging and developing is more complicated and source maps are useful when using transpilers.

What you want to happen

  • babel options for source maps are supported

Thanks

neutronz avatar Mar 07 '17 14:03 neutronz

Hey y'all,

Just wanted to ping this thread again. I just incorporated react-rails into a new Rails project, and it works great when building new .jsx components. However, not having source maps is going to make debugging really difficult, especially on larger projects.

Any idea how to enable source maps? I'm using sprockets.

Thanks!

robertsosinski avatar Dec 17 '18 15:12 robertsosinski

@robertsosinski In Sprockets there is a guide for source maps here: https://github.com/rails/sprockets/blob/master/guides/source_maps.md

If you would be so kind as to let this thread know if this works once you've tried it, that would be appreciated.

BookOfGreg avatar Dec 18 '18 09:12 BookOfGreg

The problem statement is not clear. Closing the issue, if required we can reopen this.

alkesh26 avatar Oct 31 '22 08:10 alkesh26