-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Is your feature request related to a problem? Please describe.
The Observable compiler currently translates notebook imports to static import statements. This causes transitive notebook modules to be loaded even if no observed runtime variables depend on them.
import {samples} from "@mbostock/evenly-spaced-sampling"will also load the notebook @observablehq/inputs, even though samples does not depend on any of its cells.
Authors will often import notebooks which are only used for documentation / demonstration purposes.
Describe the solution you'd like
Only load notebook modules if cells depend on them.
Describe alternatives you've considered
Notebooks can be loaded lazily by dynamically importing and instantiating them through a separate Runtime instance. However, these separate runtime modules cannot be integrated easily, and the separate d3-require instance can cause conflicts.