Built files in _observablehq
, _import
, and _npm
can change content without changing their name
#1555
Labels
bug
Something isn’t working
Framework tries to maintain the contract (via content hashes and exact versions) that built files in
_observablehq
,_import
, and_npm
should change their name if their content changes, allowing immutable caching in the browser for better performance. However, in practice, this contract can be broken for several reasons._observablehq
can change between Framework releases, and because they bake-in the resolved versions of npm dependencies (such as via the recommended libraries andFileAttachment
APIs)._import
can change because they bake-in the resolved versions of npm dependencies, and these resolved versions are not considered as part of the content hash (which only considers the original path of the import, pre-resolution, such asnpm:@observablehq/plot
)._npm
can change because they bake-in the resolved versions of (transitive) npm dependencies. For example,@observablehq/plot
depends ond3
, and the version ofd3
can change independently of@observablehq/plot
.To maintain this contract, Framework will need to apply hashes (or other unique identifiers) to both
_observablehq
and_npm
, and also fix how the hash is computed in_import
.The text was updated successfully, but these errors were encountered: