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 123 forks source link

Add version badge for reference to file.size #1640

Closed gvanhorne closed 2 months ago

gvanhorne commented 2 months ago

From the docs here: https://observablehq.com/framework/files#static-analysis it would appear users can check for missing files using file.size.

From this commit it looks to me that file.size is always undefined for versions < 1.11.0. As such, it may be appropriate to add a version badge to the documentation here so as to prevent developers mistakenly using the file.size attribute when it will always be undefined for older versions.

mbostock commented 2 months ago

Yes, it’s mentioned above where it says “size in bytes” but we could repeat it.

Fil commented 2 months ago

We usually don't repeat version badges. Is this to be treated as a special case? An alternative could be to link the term to its definition.

gvanhorne commented 2 months ago

It makes sense to me now in the context of the entire page (knowing that "size in bytes" refers to the same feature). This came up during development for me as I only read the https://observablehq.com/framework/files#static-analysis section of the page, and it took a brief moment to debug. Totally optional issue but I thought it might save some future grievances (albeit minor)!