Ability to perform data refresh without restarting server #4131
Replies: 1 comment
-
|
While I strongly agree that this functionality would be useful, I don't see the benefit of exposing such an event (@ashur if you have a usecase that can only be solved with such an event, could you maybe explain it in a little more detail?). I would personally prefer a solution where it is possible for plugins to register routes and handlers with EleventyServe (my first thought was towards serverless functions) and That way you can have one API change and provide for way more usecases. Some other interesting ones that come to mind are:
For this solution we'd need to
Considerations Doing this will take more work than what is proposed by @ashur, but will most likely result in a more flexible API covering this and many more usecases. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Gatsby has a handy development feature for refreshing data without having to stop and restart the local server.
Paired with a simple bookmarklet that POSTs to the endpoint, the feature allows developers to re-fetch data with a single click without leaving the browser — ex., to test content changes in a remote CMS.
Feature Request
It would be really helpful for clearing locally cached data if Eleventy added a hook for doing something similar.
For example, Eleventy configuration could accept a new event type that allows developers to define functions for refreshing data:
Ideally, these would only called if the feature is enabled (ex., by an environment variable as in Gatsby). After the refresh function has finished successfully, Eleventy would perform another build automatically, triggering a browser reload if applicable.
Alternatives
Some possible approaches that don't require native support from Eleventy:
eleventy --servethat listens for data refresh requests; this would primarily be filesystem and process/command-line drivenBeta Was this translation helpful? Give feedback.
All reactions