Skip to content

assets:precompile broken with initialize_on_precompile=-true #192

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

Closed
bborn opened this issue Mar 2, 2015 · 4 comments
Closed

assets:precompile broken with initialize_on_precompile=-true #192

bborn opened this issue Mar 2, 2015 · 4 comments

Comments

@bborn
Copy link

bborn commented Mar 2, 2015

With config.assets.initialize_on_precompile = false, React::JSX.transform_options = app.config.react.jsx_transform_options never gets set, and I get an exception from jsx.rb#30. Can we move the React::JSX.transform_options = app.config.react.jsx_transform_options in railtie.rb out of the initializer block?

@rmosolgo
Copy link
Member

rmosolgo commented Mar 2, 2015

Yeah, maybe you could do something like that!

I put it there because, as I understand it, Rails takes all the configs, then runs the initializers. So, you have to let them set app.config.react.jsx_transform_options before you pass them to the renderer.

What if we just skipped the ceremony of app.config.react.jsx_transform and assigned React::JSX.transform_options directly?

@rmosolgo rmosolgo mentioned this issue Apr 28, 2015
6 tasks
@rmosolgo
Copy link
Member

@bborn I'm looking into this now and trying to reproduce. What Rails version are you using? I see in Rails 4.1, initialize_on_precompile was removed: rails/rails@2d5a6de

In the mean time, you could work around this by assigning React::JSX.transform_options directly. Does that work for you?

@bborn
Copy link
Author

bborn commented May 28, 2015

I'm working in Rails 3.

In the mean time, you could work around this by assigning

React::JSX.transform_options directly. Does that work for you?

Yes, that worked fine.


Reply to this email directly or view it on GitHub
#192 (comment)
.

@rmosolgo
Copy link
Member

Glad that worked for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants