Sometimes it might be useful to load only parts of a file. Hence it might be useful to allow for ranges to be specified.
Something along the lines of:
import bytes from "./photo.png" with { type: "bytes", range: { from: 0, to: 500 } };
or
import bytes from "./photo.png" with { type: "bytes", offset: 500, length: 1000 };
or
import bytes from "./photo.png" with { type: "bytes", slice: [500, 1000] };
The Browser would then load the file via a range request.
Some servers might now support this. In that case, they usually just send the whole file which is a reasonable fallback in most cases but could lead to huge load times for scripts in this case. So not sure how to handle that...
Sometimes it might be useful to load only parts of a file. Hence it might be useful to allow for ranges to be specified.
Something along the lines of:
or
or
The Browser would then load the file via a range request.
Some servers might now support this. In that case, they usually just send the whole file which is a reasonable fallback in most cases but could lead to huge load times for scripts in this case. So not sure how to handle that...