Comments (3)
This is a known limitation of the preview server. As @Fil mentioned in #1051:
In preview, by contrast, [computing the modification time] happens before the data loader has had a chance to run. So, when the cache is stale, you get stale information — but the situation solves itself on the next page load. (It is not possible to solve this in any other way as we can’t predict the future, and don’t want to wait for the loader to have finished running before we send the page to the browser.)
In other words, when you edit a referenced file, the preview server immediately detects the change and notifies the client over the websocket so that the client can download the latest version of the file. However, when this referenced file is generated by a data loader, we know that the data loader has been changed, but we don’t know yet what the contents of the file are because the data loader is still running.
Perhaps there are two ways we could fix this:
- We could wait until the data loader finishes running before reporting it to the client. This would be quite a disruptive change to implement because currently data loaders are triggered lazily by the client requesting a file. It would also mean that page rendering would have to stall until all referenced data loaders have finished, which I expect is a much worse developer experience. (You’d never see any loading indicators and instead you’d see the browser waiting for the page to load with nothing visible.)
- During preview, or perhaps just when the data loader has been invalidated and is newer than its previous output, we could report the modification time as the modification time of the data loader source rather than the cached output. This is a “lie” in a sense, but it’s probably a convenient lie from the perspective of the client, since the client now wouldn’t have to handle the case where the
lastModified
property is undefined.
I think we can do the latter pretty easily. I’ll try that.
from framework.
Edit: this applies to all file updates, not just data loaders! We were forgetting to populate lastModified
on the diff. Will fix.
from framework.
Edit: this applies to all file updates, not just data loaders! We were forgetting to populate
lastModified
on the diff. Will fix.
Exactly :)
Wonderful, thanks for the fix.
from framework.
Related Issues (20)
- Keep the inspector open on update HOT 1
- Error after stopping the dev server when run in an npm workspace HOT 1
- Is is possible to send a static version by email?
- "Analyzing web logs" example page is erroring HOT 3
- Allow JSX’s import source (`npm:react`) to be configured
- Serialize asynchronous evaluation to improve performance HOT 2
- "No results" after refreshing site when using some parquet files HOT 13
- cleanUrls set to false do not change the home page link HOT 1
- Framework Cache not Initializing
- Importing `@google-cloud/bigquery` fails in JS snippets
- The SVG from Observable is not well read by Microsoft Word. HOT 1
- Show a warning when the preview server is disconnected
- Automatically add pages in a directory in the Config file without having to specify each one. HOT 4
- Preview Crash Due to Temporary Files Created by Vim HOT 1
- Should code be minimized HOT 5
- react/jsx should work with view HOT 3
- Timezone Trouble with DuckDB and Observable plot
- Broken link for responsive display documentation
- Generalizable creation of reactive inputs and their selected values
- How to make Framework HIPAA-compliant?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from framework.