Extend the implicit import detection mechanism to inspect the accept
field of Inputs.file
#1574
Labels
enhancement
New feature or request
accept
field of Inputs.file
#1574
Framework uses static analysis to detect implicit imports. For example, loading a Parquet file using
FileAttachment(...).parquet()
will be detected as a dependency on theparquet-wasm
package which will then be bundled for distribution and lazily-loaded when theparquet()
method is called.This static analysis is not complete and there are some cases where it succeeds in dev mode but fails in production, since the lazy import can be resolved in dev mode but absent in production since it was not detected by static analysis at build time.
One such case is when
Inputs.file
is used:This enhancement request is for static analysis to infer dependencies using the the
accept
option ofInputs.file
. File type specifiers are documented here.I think bundling these potential implicit dependencies by default would be an improvement to the user experience, but it could make sense to make it possible to opt out so that there's a way to keep unused dependencies out of the build (e.g. if a Parquet file picker is present but the user loads it using a different library).
(Thanks to @thinkingfish for the idea, and @mbostock for encouragement to file this issue!)
The text was updated successfully, but these errors were encountered: