Skip to content
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

Add a hot reload #1

Open
nawarian opened this issue Sep 3, 2020 · 1 comment
Open

Add a hot reload #1

nawarian opened this issue Sep 3, 2020 · 1 comment
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed

Comments

@nawarian
Copy link
Owner

nawarian commented Sep 3, 2020

Currently the development cycle requires a save, kill, start process.

A hot-reload wold be very handy.

@nawarian nawarian added enhancement New feature or request help wanted Extra attention is needed hacktoberfest labels Sep 3, 2020
@nawarian
Copy link
Owner Author

nawarian commented Sep 3, 2020

An option can be the Soft Mocks package. It allows to redefine functions and methods.
The way I see it, it would be required to do something like this:

  • Listen to file changes (can be on the game loop)
  • On file changed, parse using PHP Parser
  • Fetch all methods in it
  • Fetch the body of each method and pretty print it as a string
  • Call the redefineMethod() function

This seems a bit hairy though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant