-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
For libraries with large collections of functions it can be nice to import them in a single declaration e.g.
import { map, filter } from "./some-itertools.mjs"
// vs individual
import map from "some-itertools/map.mjs"
import filter from "some-itertools/filter.mjs"However with the former this will fetch the entire library even if a lot of it is not used. Basically what would be nice is if there was an additional header that the server could choose to consider when serving a module e.g.
import { map, filter } from "./some-itertools.mjs"could send an additional header:
Imported-Names: map, filter
which a smart server could choose to respond with only what's needed instead:
export function map() {
...
}
export function filter() {
...
}or even respond more simply with something like:
export { map } from "./some-itertools/map.js"
export { filter } from "./some-itertools/filter.js"Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels