-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 more test directory to exclude dir of air, remove watching templates from air include dir because gitea has internal mechanism #22246
Conversation
…tes from air include dir because gitea has internal mechanism
…tes from air include dir because gitea has internal mechanism (go-gitea#22246) Since go-gitea#20218 introduced internal watching template, template watching should be removed from `air`. This will prevent restart the whole server once the template files changed to speed up developing when using `make watch`. To ensure `make watch` will reuse template watching, this PR introduced a new ENV `GITEA_RUN_MODE` to make sure `make watch` will always run in a dev mode of Gitea so that template watching will open. This PR also added more exclude testdata directories.
* upstream/main: Add more test directory to exclude dir of air, remove watching templates from air include dir because gitea has internal mechanism (go-gitea#22246)
Will template changes still reload the dev server after this? It'd certainly be useful to not have to manually restart on template change. |
Same question from my side. Editing a template file was also a very fast way to force a restart. |
Template changes will not reload the dev server any more but will fire internal template watching, that means only templates will be recompiled again once template changed and no any manually operation needed. This is obviously faster than before, because there is no server restart, no database init, no web listen and etc. |
You could change a go file to implement it now. |
Sure but now I need to search for a file which does not force recompilation of a big part of our codebase to make it fast. But that was just convenience. |
You can always edit |
If template changes automatically reload it in the server without a restart, that's fine with me. So on next F5, it should serve the new template. I will try it. |
…tes from air include dir because gitea has internal mechanism (#22246) (#22247) backport #22246 Since #20218 introduced internal watching template, template watching should be removed from `air`. This will prevent restart the whole server once the template files changed to speed up developing when using `make watch`. To ensure `make watch` will reuse template watching, this PR introduced a new ENV `GITEA_RUN_MODE` to make sure `make watch` will always run in a dev mode of Gitea so that template watching will open. This PR also added more exclude testdata directories. Co-authored-by: 6543 <6543@obermui.de>
Since #20218 introduced internal watching template, template watching should be removed from
air
. This will prevent restart the whole server but only recompile templates once the template files changed to speed up developing when usingmake watch
. Now a template change will only spend less than1s
in my macbook 2019 but over20s
before.To ensure
make watch
will reuse template watching, this PR introduced a new ENVGITEA_RUN_MODE
to make suremake watch
will always run in a dev mode of Gitea so that template watching will open.This PR also added more exclude testdata directories.