react-rails
react-rails copied to clipboard
Source map support for transpiled jsx
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;
}
}
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
?
+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,
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
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 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.
The problem statement is not clear. Closing the issue, if required we can reopen this.