- Notifications
You must be signed in to change notification settings - Fork 750
Document config.watchable_files #154
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
This makes it easier to figure out how to set up code-reloading of files with a `.cjsx` extension (I'm using https://github.com/jsdf/sprockets-coffee-react).
README.md Outdated
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.
AFAICT this will only watch files that exist when you boot your development server, new files added after that will not be watched. Wouldn't it make more sense to suggest watchable_dirs here?
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.
Good point, fixed! Interestingly enough this approach seemed to work for me because I used Dir["#{Rails.root}/app/assets/javascripts/react/*/"]), which contained the directories too.
| So, I finally got around to testing this, and I'm not sure that setting With a fresh Rails app, and both Are you putting your cjsx files in |
| I'm not. They're in Conrad On Fri, Feb 6, 2015 at 8:17 AM, Alec Hipshear notifications@github.com
|
| That works by default for me, too... The railtie already does basically the same thing that you add -- https://github.com/reactjs/react-rails/blob/master/lib/react/rails/railtie.rb#L19-L21 What version of Rails are you using? I'm thinking it's either a bug with our integration with previous versions of Rails, or a bug in your implementation. |
| I'm using |
| Ahhh, I see, it's a prerender issue. I misunderstood, sorry! I'd rather not go down the path of "documenting Rails features" if we can help it. I think I would rather see a change to the railtie in the gem, maybe to watch |
| That sounds great, thanks! Conrad On Friday, February 6, 2015, Alec Hipshear notifications@github.com wrote:
|
| @xionon people using side builds with browserify or webpack might not be using files with a ".jsx" extension, but ".js" instead (my case). I had to add |
| @mpereira I'm in a similar situation. I'm using webpack, but putting to config/development.rb doesn't work for me... |
| works after i used absolute path: |
| Sorry, I think this has been cold from even before I started maintaining this. Please feel free to reopen if you think this is still an issue! |
| Using FileUpdateChecker in 2.0 will be more configurable and also catch newly-added files: #682 |
| If anyone lands here from Google and is still having an issue with their files not reloading in SSR, my issue was caused by react-rails not seeing the changes to .tsx files (as I'm using Typescript) and therefore not reloading the renderers. You can tell react-rails to watch for .tsx files by adding this to your config.react.server_renderer_extensions = ["jsx", "js", "tsx", "ts"] |
This makes it easier to figure out how to set up code-reloading of files with a
.cjsxextension (I'm using https://github.com/jsdf/sprockets-coffee-react).