-
Notifications
You must be signed in to change notification settings - Fork 754
Allow users to override react.js and transformer.js for assets and engine #12
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
Conversation
I just noticed there is a problem with rails <= 4.0, we need to fit initializer after appending default paths, but before finisher_hook, it's weird that |
Got this to work, but a cleanup is needed yet. I'm not sure why I couldn't disable sprockets cache, even with
So there simply is a example2.js.jsx, to be compiled with dropped-in JSXTransformer. |
@zpao let me know if you're fine with this approach before I proceed |
How would you feel about making it a bit easier to drop files in vendor? It looks like Ember allows this by actually having 2 directories inside their vendor (details...). That way you don't have to do anything different in your assets. I'm not sure where JSXTransformer.js would fit into with 2 dirs... Maybe something like this:
|
Funny how they did it, just a 2 lines fix, I should have this finished in a few days. |
Dirty, but it does the job. |
# Make sure it can be found | ||
app.assets.append_path(tmp_path) | ||
# Allow overriding react files that are not based on environment | ||
# e.g. /vendor/react/JSXTransformer.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: make sure this matches (missed assets
)
I was away for a few days. |
I'm a bit confused why we need users to specify the version of |
If
So you're just hiding the fact that |
OK, I got this rebased against current master - this is all as we discussed on IRC. Once we're ok here - I'll probably want to do some squashing. |
All finished as discussed on IRC - rebased again to be up to date with master. I will be able to add units tests for #15 once this is merged. |
any updates here? @zpao |
Sorry for the delay! Things have been a little bit hectic lately and this project is lowest on the totem pole :( I'm pushing out 0.5.2.0 and 0.8.0.0 right now, but if you rebase on top of those, I'll push the green button and merge it in, then we can go from there. |
Sure thing, we could get back to our talk about streamlining this a bit if more PRs were to come. |
``` | ||
|
||
Starting with `0.4.1` there is a fix, which alows execjs to transforms jsx files, so if you need a version lower than | ||
`0.4.1` you will have to replace JSXTransformer.js, see below on how to do it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just drop this since it's old news.
This PR is so stretched in time I actually started forgetting how and what should be done. So AFAIR - |
Ok, cool. I couldn't remember exactly where we were but saw that part of the readme and got confused. If the readme is totally fine now then I'll just merge. |
Totally fine. |
#17 should fix the failing test (because coffeescript). Let's get one last rebase and then merge for real :) While you're in there, lets set that version to 1.0.0pre or something, and get a couple more things in before we ship as 1.0. Sound ok? |
Allow users to override react.js and transformer.js for assets and engine
As in: #5
Docs & tests coming. Overriding is implemented through Sprockets.