octane
octane copied to clipboard
Use FrankenPHP's built-in file watcher
Since version 1.3, FrankenPHP now has a native file watcher.
This PR switches to use that watcher, instead of needing a separate NodeJS process that restarts the entire server every time a file changes.
For example. this will allow running watch mode in a Docker container that does not have NodeJS.
It might also help fix the same issue as #932 without needing to disable worker mode, though I have not tested that myself.
Hey, awesome PR :) By any chance, have you tested Franken's watcher in Docker on MacOS? Chokidar has served us very good in that regard, so I'm wondering whether e-watcher used by Franken is as good.
@oprypkhantc Thanks! The reason it's still marked as a draft because I have not finished doing testing with Docker. I know that a lot of people use macOS, but I do about 98% of my development work on Windows and Linux, so I have to borrow a Mac at work to finish my testing.
Got it. I would gladly help you test it, but I really lack the time for it right now :(
Hey, any update on this 👀 ? I'd be happy to finish implementing if things are missing :)
@LeTamanoir Right now I think it just needs a little more testing. If you can test it out, that would be great!
Hey @kohenkatz, can you sync the fork and rebase so that I have the latest CIs versions (with Laravel 12) 🙏 ? Or I can start another fork with your changes included if you prefer.
@LeTamanoir I just did a rebase onto the newest Octane 2.x branch.
Hello @kohenkatz is this MR ready for review ? if so, should should be marked as such, thansks! 🙏 PS: works very well in WSL and docker
This is awesome! Works for me, let's get the last push to get it merged!
I just did a rebase onto the newest 2.x branch, and I think this is ready to merge now. Does anyone else want to do one more test of the rebased version just to check? @LeTamanoir @Javdu10 @realpoke
Just tested on MacOS, L11 / Sail setup. Worked with no real issues except:
- Had to downgrade XDebug to 3.3.2 (from 3.4.4) for breakpoints to work (unrelated I think?), it would hang otherwise
- Breakpoints are still off by 1 if you remove the first breakpoint from previous request or add a breakpoint that needs to be triggered earlier than the first breakpoint from the previous request (unrelated I'm guessing but worth mentionning as I'd love a solution for that)
The watch worked as expected and didn't need a full restart to serve updated code on the next request.
Just tested on MacOS, L11 / Sail setup. Worked with no real issues except:
- Had to downgrade XDebug to 3.3.2 (from 3.4.4) for breakpoints to work (unrelated I think?), it would hang otherwise
- Breakpoints are still off by 1 if you remove the first breakpoint from previous request or add a breakpoint that needs to be triggered earlier than the first breakpoint from the previous request (unrelated I'm guessing but worth mentionning as I'd love a solution for that)
The watch worked as expected and didn't need a full restart to serve updated code on the next request.
Great! Thanks for testing!
I don't think the Xdebug and breakpoint issues have anything to do with this change specifically, but I suppose it's not impossible that the watcher affects something else internally in FrankenPHP. That's more complex than I know how to deal with though.