observablehq / framework

A static site generator for data apps, dashboards, reports, and more. Observable Framework combines JavaScript on the front-end for interactive graphics with any language on the back-end for data analysis.
https://observablehq.com/framework/
ISC License
2.57k stars 124 forks source link

Automatically annotate file paths if dynamicPaths include JS modules or is a function #1815

Closed mythmon closed 1 week ago

mythmon commented 1 week ago

This is a bit messy, especially the leaky abstraction of the config file, but it would fix the problem.

Some alternate approaches I thought about while writing this:

Fil commented 1 week ago

Unconditionally enable file annotations sounds good to me.

mbostock commented 1 week ago

Reject un-annotated builds on the server side if they seem required.

I feel like this is the way to go. Even with this PR, old releases of Framework will still not work, so we’d need to enforce that a minimum version of Framework is used. So why not more directly enforce that Framework was built with path annotation enabled? (I don’t recall if we stash some metadata when building, but we certainly could if we aren’t already.)