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

Layouts not reloaded when rebuilding in server mode #18

Closed
ericselin opened this issue Nov 1, 2021 · 1 comment
Closed

Layouts not reloaded when rebuilding in server mode #18

ericselin opened this issue Nov 1, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@ericselin
Copy link
Owner

ES modules are stored in cache, and thus a re-imported module (even dynamically imported) keeps its implementation even if the file itself has been updated. In order to work around this, add a counter or similar (random number?) as a hash parameter to force the module to reload.

Hash might be better, because it might cause the old cache entry to be evicted, but this is not certain. It might be hard to avoid a memory leak here before denoland/deno#8327 is released.

Using workers might solve the cache issue, but this is not certain. See denoland/deno#6116.

@ericselin ericselin added the bug Something isn't working label Nov 1, 2021
@ericselin
Copy link
Owner Author

Confirmed this is an issue also with workers. The Deno cache doesn't get reloaded.

The solution would be for the server command to run a watching builder in a separate process, and restart that process when layouts have been changed.

  • bob watch could be the name of the new command / action. This watches the content directory and builds on file modifications.
  • The server command itself would then watch the layout directory and restart the above command in case of changes.
  • Add new --no-initial-changes flag on the second run to disable getting file system changes, as everything should be up to date anyway, and getting the changes can be pretty heavy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant