guest271314 (2019-06-02T16:22:04.000Z)
guest271314 at gmail.com (2019-06-02T17:08:04.364Z)
> 1) original-question - is native es-module's async-behavior desirable? > async side-effects are difficult to manage -- i conjecture that > async-loading 20 es-modules (with dependent side-effects) is not practical > for most mortals to handle. It depends on what *you* mean by "desirable" in a given context. There is no difference from loading 1 module and loading 1000 modules except for time, memory and disk space usage. Mortals can handle far more than loading 20 es-modules. What are the specific "side-effects" that you are referring to? > describes the mechanism for how to hint the brower to pre-fetch 20 > es-modules. but if you pre-fetch, then is loading-behavior effectively > synchronous? Resources can be "pre-fetched" using various means. From caching the first request and using the cached data instead of making future requests for the same resources; `localStorage`; storing one or more entire directories in the browser configuration folder using `requestFileSystem` (Chromium/Chrome); see also Native File System API https://github.com/WICG/native-file-system ("Expose the file system on the user’s device, so Web apps can interoperate with the user’s native applications."). > but was unclear whether they were individual [async] ```<script > type="module">``` tags, or some es5-transpiled rollup There should not be any difference between the two approaches. If there is a difference then you should be able to clearly state what the difference is, and demonstrate the difference by reproduction, without speculating and not demonstrating a difference by means of reproduction. > 2) the second-question about es-module rollups (which you and i are > debating) stemmed from @isiah's response -- if he and everyone-else use > es5-transpiled rollups (which i suspect), Do not care what "everyone-else" is supposedly doing, here. How can you possibly know what everyone-else is doing and even if you did know what third-parties are doing how does that affect what you are doing? > then shouldn't it be desirable for es-modules to natively support rollups > as well? currently, there's no way to natively rollup multiple es-modules > into a single bundle. There are ways to "bundle" multiple modules into a single export "natively", as demonstrated at the previously posted code. Are you trying to use the same pattern that browserify http://browserify.org/ ("Browserify lets you require('modules') in the browser by bundling up all of your dependencies.") does? If by "natively rollup multiple es-modules into a single bundle" you mean fetch various resources in a single file and export those resource in a single object you can ```fetch()``` and export *N* resources as a single JavaScript plain object and process the object key, value pairs after importing the single ```Module``` object. ``` // sync const o = { a:1, b:2, c:3 }; // async const states = fetch("https://gist.githubusercontent.com/guest271314/ffac94353ab16f42160e/raw/aaee70a3e351f6c7bc00178eabb5970a02df87e9/states.json") .then(response => response.json()) .catch(e => {console.error(e); return "error fetching states module"}); // async const video = fetch("https://upload.wikimedia.org/wikipedia/commons/d/d9/120-cell.ogv") .then(response => response.blob()) .catch(e => {console.error(e); return "error fetching video module"}); // multiple "modules" exported export {o, states, video}; ``` at single ```<script type="module">``` ``` <script type="module"> import * as o from "./script.js"; (async(mods) => { for (const [key, value] of mods) { if (value instanceof Promise) { console.log("async module", key, await value) } else { console.log("sync module", key, value); } } })(Object.entries(o)); // or // Promise.all(Object.values(o)).then(console.log).catch(console.error) </script> ``` Still there is no actual problem statement. Rather, there is conjecture without a definitive issue to solve.
guest271314 at gmail.com (2019-06-02T17:03:42.867Z)
> 1) original-question - is native es-module's async-behavior desirable? > async side-effects are difficult to manage -- i conjecture that > async-loading 20 es-modules (with dependent side-effects) is not practical > for most mortals to handle. It depends on what *you* mean by "desirable" in a given context. There is no difference from loading 1 module and loading 1000 modules except for time, memory and disk space usage. Mortals can handle far more than loading 20 es-modules. What are the specific "side-effects" that you are referring to? > describes the mechanism for how to hint the brower to pre-fetch 20 > es-modules. but if you pre-fetch, then is loading-behavior effectively > synchronous? Resources can be "pre-fetched" using various means. From caching the first request and using the cached data instead of making future requests for the same resources to storing one or more entire directories in the browser configuration folder using `requestFileSystem` (Chromium/Chrome); see also Native File System API https://github.com/WICG/native-file-system ("Expose the file system on the user’s device, so Web apps can interoperate with the user’s native applications."). > but was unclear whether they were individual [async] ```<script > type="module">``` tags, or some es5-transpiled rollup There should not be any difference between the two approaches. If there is a difference then you should be able to clearly state what the difference is, and demonstrate the difference by reproduction, without speculating and not demonstrating a difference by means of reproduction. > 2) the second-question about es-module rollups (which you and i are > debating) stemmed from @isiah's response -- if he and everyone-else use > es5-transpiled rollups (which i suspect), Do not care what "everyone-else" is supposedly doing, here. How can you possibly know what everyone-else is doing and even if you did know what third-parties are doing how does that affect what you are doing? > then shouldn't it be desirable for es-modules to natively support rollups > as well? currently, there's no way to natively rollup multiple es-modules > into a single bundle. There are ways to "bundle" multiple modules into a single export "natively", as demonstrated at the previously posted code. Are you trying to use the same pattern that browserify http://browserify.org/ ("Browserify lets you require('modules') in the browser by bundling up all of your dependencies.") does? If by "natively rollup multiple es-modules into a single bundle" you mean fetch various resources in a single file and export those resource in a single object you can ```fetch()``` and export *N* resources as a single JavaScript plain object and process the object key, value pairs after importing the single ```Module``` object. ``` // sync const o = { a:1, b:2, c:3 }; // async const states = fetch("https://gist.githubusercontent.com/guest271314/ffac94353ab16f42160e/raw/aaee70a3e351f6c7bc00178eabb5970a02df87e9/states.json") .then(response => response.json()) .catch(e => {console.error(e); return "error fetching states module"}); // async const video = fetch("https://upload.wikimedia.org/wikipedia/commons/d/d9/120-cell.ogv") .then(response => response.blob()) .catch(e => {console.error(e); return "error fetching video module"}); // multiple "modules" exported export {o, states, video}; ``` at single ```<script type="module">``` ``` <script type="module"> import * as o from "./script.js"; (async(mods) => { for (const [key, value] of mods) { if (value instanceof Promise) { console.log("async module", key, await value) } else { console.log("sync module", key, value); } } })(Object.entries(o)); // or // Promise.all(Object.values(o)).then(console.log).catch(console.error) </script> ``` Still there is no actual problem statement. Rather, there is conjecture without a definitive issue to solve.
guest271314 at gmail.com (2019-06-02T17:02:21.772Z)
> 1) original-question - is native es-module's async-behavior desirable? > async side-effects are difficult to manage -- i conjecture that > async-loading 20 es-modules (with dependent side-effects) is not practical > for most mortals to handle. It depends on what *you* mean by "desirable" in a given context. There is no difference from loading 1 module and loading 1000 modules except for network cost, memory and disk space usage. Mortals can handle far more than loading 20 es-modules. What are the specific "side-effects" that you are referring to? > describes the mechanism for how to hint the brower to pre-fetch 20 > es-modules. but if you pre-fetch, then is loading-behavior effectively > synchronous? Resources can be "pre-fetched" using various means. From caching the first request and using the cached data instead of making future requests for the same resources to storing one or more entire directories in the browser configuration folder using `requestFileSystem` (Chromium/Chrome); see also Native File System API https://github.com/WICG/native-file-system ("Expose the file system on the user’s device, so Web apps can interoperate with the user’s native applications."); > but was unclear whether they were individual [async] ```<script > type="module">``` tags, or some es5-transpiled rollup There should not be any difference between the two approaches. If there is a difference then you should be able to clearly state what the difference is, and demonstrate the difference by reproduction, without speculating and not demonstrating a difference by means of reproduction. > 2) the second-question about es-module rollups (which you and i are > debating) stemmed from @isiah's response -- if he and everyone-else use > es5-transpiled rollups (which i suspect), Do not care what "everyone-else" is supposedly doing, here. How can you possibly know what everyone-else is doing and even if you did know what third-parties are doing how does that affect what you are doing? > then shouldn't it be desirable for es-modules to natively support rollups > as well? currently, there's no way to natively rollup multiple es-modules > into a single bundle. There are ways to "bundle" multiple modules into a single export "natively", as demonstrated at the previously posted code. Are you trying to use the same pattern that browserify http://browserify.org/ ("Browserify lets you require('modules') in the browser by bundling up all of your dependencies.") does? If by "natively rollup multiple es-modules into a single bundle" you mean fetch various resources in a single file and export those resource in a single object you can ```fetch()``` and export *N* resources as a single JavaScript plain object and process the object key, value pairs after importing the single ```Module``` object. ``` // sync const o = { a:1, b:2, c:3 }; // async const states = fetch("https://gist.githubusercontent.com/guest271314/ffac94353ab16f42160e/raw/aaee70a3e351f6c7bc00178eabb5970a02df87e9/states.json") .then(response => response.json()) .catch(e => {console.error(e); return "error fetching states module"}); // async const video = fetch("https://upload.wikimedia.org/wikipedia/commons/d/d9/120-cell.ogv") .then(response => response.blob()) .catch(e => {console.error(e); return "error fetching video module"}); // multiple "modules" exported export {o, states, video}; ``` at single ```<script type="module">``` ``` <script type="module"> import * as o from "./script.js"; (async(mods) => { for (const [key, value] of mods) { if (value instanceof Promise) { console.log("async module", key, await value) } else { console.log("sync module", key, value); } } })(Object.entries(o)); // or // Promise.all(Object.values(o)).then(console.log).catch(console.error) </script> ``` Still there is no actual problem statement. Rather, there is conjecture without a definitive issue to solve.
guest271314 at gmail.com (2019-06-02T17:00:08.503Z)
> 1) original-question - is native es-module's async-behavior desirable? > async side-effects are difficult to manage -- i conjecture that > async-loading 20 es-modules (with dependent side-effects) is not practical > for most mortals to handle. It depends on what *you* mean by "desirable" in a given context. There is no difference from loading 1 module and loading 1000 modules except for network cost, memory and disk space usage. Mortals can handle far more than loading 20 es-modules. What are the specific "side-effects" that you are referring to? > describes the mechanism for how to hint the brower to pre-fetch 20 > es-modules. but if you pre-fetch, then is loading-behavior effectively > synchronous? Resources can be "pre-fetched" using various means. From caching the first request and using the cached data instead of making future requests for the same resources to storing one or more entire directories in the browser configuration folder using `requestFileSystem` (Chromium/Chrome). > but was unclear whether they were individual [async] ```<script > type="module">``` tags, or some es5-transpiled rollup There should not be any difference between the two approaches. If there is a difference then you should be able to clearly state what the difference is, and demonstrate the difference by reproduction, without speculating and not demonstrating a difference by means of reproduction. > 2) the second-question about es-module rollups (which you and i are > debating) stemmed from @isiah's response -- if he and everyone-else use > es5-transpiled rollups (which i suspect), Do not care what "everyone-else" is supposedly doing, here. How can you possibly know what everyone-else is doing and even if you did know what third-parties are doing how does that affect what you are doing? > then shouldn't it be desirable for es-modules to natively support rollups > as well? currently, there's no way to natively rollup multiple es-modules > into a single bundle. There are ways to "bundle" multiple modules into a single export "natively", as demonstrated at the previously posted code. Are you trying to use the same pattern that browserify http://browserify.org/ ("Browserify lets you require('modules') in the browser by bundling up all of your dependencies.") does? If by "natively rollup multiple es-modules into a single bundle" you mean fetch various resources in a single file and export those resource in a single object you can ```fetch()``` and export *N* resources as a single JavaScript plain object and process the object key, value pairs after importing the single ```Module``` object. ``` // sync const o = { a:1, b:2, c:3 }; // async const states = fetch("https://gist.githubusercontent.com/guest271314/ffac94353ab16f42160e/raw/aaee70a3e351f6c7bc00178eabb5970a02df87e9/states.json") .then(response => response.json()) .catch(e => {console.error(e); return "error fetching states module"}); // async const video = fetch("https://upload.wikimedia.org/wikipedia/commons/d/d9/120-cell.ogv") .then(response => response.blob()) .catch(e => {console.error(e); return "error fetching video module"}); // multiple "modules" exported export {o, states, video}; ``` at single ```<script type="module">``` ``` <script type="module"> import * as o from "./script.js"; (async(mods) => { for (const [key, value] of mods) { if (value instanceof Promise) { console.log("async module", key, await value) } else { console.log("sync module", key, value); } } })(Object.entries(o)); // or // Promise.all(Object.values(o)).then(console.log).catch(console.error) </script> ``` Still there is no actual problem statement. Rather, there is conjecture without a definitive issue to solve.
guest271314 at gmail.com (2019-06-02T16:59:23.910Z)
> 1) original-question - is native es-module's async-behavior desirable? > async side-effects are difficult to manage -- i conjecture that > async-loading 20 es-modules (with dependent side-effects) is not practical > for most mortals to handle. It depends on what *you* mean by "desirable" in a given context. There is no difference from loading 1 module and loading 1000 modules except for network cost, memory and disk space usage. Mortals can handle far more than loading 20 es-modules. What are the specific "side-effects" that you are referring to? > describes the mechanism for how to hint the brower to pre-fetch 20 > es-modules. but if you pre-fetch, then is loading-behavior effectively > synchronous? Resources can be "pre-fetched" using various means. From caching the first request and using the cached data instead of making future requests for the same resources to storing one or more entire directories in the browser configuration folder using `requestFileSystem` (Chromiom/Chrome). > but was unclear whether they were individual [async] ```<script > type="module">``` tags, or some es5-transpiled rollup There should not be any difference between the two approaches. If there is a difference then you should be able to clearly state what the difference is, and demonstrate the difference by reproduction, without speculating and not demonstrating a difference by means of reproduction. > 2) the second-question about es-module rollups (which you and i are > debating) stemmed from @isiah's response -- if he and everyone-else use > es5-transpiled rollups (which i suspect), Do not care what "everyone-else" is supposedly doing, here. How can you possibly know what everyone-else is doing and even if you did know what third-parties are doing how does that affect what you are doing? > then shouldn't it be desirable for es-modules to natively support rollups > as well? currently, there's no way to natively rollup multiple es-modules > into a single bundle. There are ways to "bundle" multiple modules into a single export "natively", as demonstrated at the previously posted code. Are you trying to use the same pattern that browserify http://browserify.org/ ("Browserify lets you require('modules') in the browser by bundling up all of your dependencies.") does? If by "natively rollup multiple es-modules into a single bundle" you mean fetch various resources in a single file and export those resource in a single object you can ```fetch()``` and export *N* resources as a single JavaScript plain object and process the object key, value pairs after importing the single ```Module``` object. ``` // sync const o = { a:1, b:2, c:3 }; // async const states = fetch("https://gist.githubusercontent.com/guest271314/ffac94353ab16f42160e/raw/aaee70a3e351f6c7bc00178eabb5970a02df87e9/states.json") .then(response => response.json()) .catch(e => {console.error(e); return "error fetching states module"}); // async const video = fetch("https://upload.wikimedia.org/wikipedia/commons/d/d9/120-cell.ogv") .then(response => response.blob()) .catch(e => {console.error(e); return "error fetching video module"}); // multiple "modules" exported export {o, states, video}; ``` at single ```<script type="module">``` ``` <script type="module"> import * as o from "./script.js"; (async(mods) => { for (const [key, value] of mods) { if (value instanceof Promise) { console.log("async module", key, await value) } else { console.log("sync module", key, value); } } })(Object.entries(o)); // or // Promise.all(Object.values(o)).then(console.log).catch(console.error) </script> ``` Still there is no actual problem statement. Rather, there is conjecture without a definitive issue to solve.
guest271314 at gmail.com (2019-06-02T16:57:50.357Z)
> 1) original-question - is native es-module's async-behavior desirable? > async side-effects are difficult to manage -- i conjecture that > async-loading 20 es-modules (with dependent side-effects) is not practical > for most mortals to handle. It depends on what *you* mean by "desirable" in a given context. There is no difference from loading 1 module and loading 1000 modules except for network cost, memory and disk space usage. Mortals can handle far more than loading 20 es-modules. What are the specific "side-effects" that you are referring to? > describes the mechanism for how to hint the brower to pre-fetch 20 > es-modules. but if you pre-fetch, then is loading-behavior effectively > synchronous? Resources can be "pre-fetched" using various means. From caching the first request and using the cached data instead of making future requests for the same resources to storing one or more entire directories in the browser configuration folder using `requestFileSystem` (Chromiom/Chrome). > but was unclear whether they were individual [async] ```<script > type="module">``` tags, or some es5-transpiled rollup There should not be any difference between the two approaches. If there is a difference then you should be able to clearly state what the difference is, and demonstrate the difference by reproduction, without speculating and not demonstrating a difference by means of reproduction. > 2) the second-question about es-module rollups (which you and i are > debating) stemmed from @isiah's response -- if he and everyone-else use > es5-transpiled rollups (which i suspect), Do not care what "everyone-else" is supposedly doing, here. How can you possibly know what everyone-else is doing and even if you did know what third-parties are doing how does that affect what you are doing? > then shouldn't it be desirable for es-modules to natively support rollups > as well? currently, there's no way to natively rollup multiple es-modules > into a single bundle. There are ways to "bundle" multiple modules into a single export "natively", as demonstrated at the previously posted code. Are you trying to use the same pattern that browserify http://browserify.org/ ("Browserify lets you require('modules') in the browser by bundling up all of your dependencies.") does? If by "natively rollup multiple es-modules into a single bundle" you mean fetch various resources in a single file and export those resource in a single object you can ```fetch()``` and export *N* resources as a single JavaScript plain object and process the object key, value pairs after importing the single plain object. ``` // sync const o = { a:1, b:2, c:3 }; // async const states = fetch("https://gist.githubusercontent.com/guest271314/ffac94353ab16f42160e/raw/aaee70a3e351f6c7bc00178eabb5970a02df87e9/states.json") .then(response => response.json()) .catch(e => {console.error(e); return "error fetching states module"}); // async const video = fetch("https://upload.wikimedia.org/wikipedia/commons/d/d9/120-cell.ogv") .then(response => response.blob()) .catch(e => {console.error(e); return "error fetching video module"}); // multiple "modules" exported export {o, states, video}; ``` at single ```<script type="module">``` ``` <script type="module"> import * as o from "./script.js"; (async(mods) => { for (const [key, value] of mods) { if (value instanceof Promise) { console.log("async module", key, await value) } else { console.log("sync module", key, value); } } })(Object.entries(o)); // or // Promise.all(Object.values(o)).then(console.log).catch(console.error) </script> ``` Still there is no actual problem statement. Rather, there is conjecture without a definitive issue to solve.
guest271314 at gmail.com (2019-06-02T16:52:00.698Z)
> 1) original-question - is native es-module's async-behavior desirable? > async side-effects are difficult to manage -- i conjecture that > async-loading 20 es-modules (with dependent side-effects) is not practical > for most mortals to handle. It depends on what *you* mean by "desirable" in a given context. There is no difference from loading 1 module and loading 1000 modules except for network cost, memory and disk space usage. Mortals can handle far more than loading 20 es-modules. What are the specific "side-effects" that you are referring to? > describes the mechanism for how to hint the brower to pre-fetch 20 > es-modules. but if you pre-fetch, then is loading-behavior effectively > synchronous? Resources can be "pre-fetched" using various means. From caching the first request and using the cached data instead of making future requests for the same resources to storing one or more entire directories in the browser configuration folder using `requestFileSystem` (Chromiom/Chrome). > but was unclear whether they were individual [async] ```<script > type="module">``` tags, or some es5-transpiled rollup There should not be any difference between the two approaches. If there is a difference then you should be able to clearly state what the difference is, and demonstrate the difference by reproduction, without speculating and not demonstrating a difference by means of reproduction. > 2) the second-question about es-module rollups (which you and i are > debating) stemmed from @isiah's response -- if he and everyone-else use > es5-transpiled rollups (which i suspect), Do not care what "everyone-else" is supposedly doing, here. How can you possibly know what everyone-else is doing and even if you did know what third-parties are doing how does that affect what you are doing? > then shouldn't it be desirable for es-modules to natively support rollups > as well? currently, there's no way to natively rollup multiple es-modules > into a single bundle. There are ways to "bundle" multiple modules into a single export "natively", as demonstrated at the previously posted code. Are you trying to use the same pattern that browserify http://browserify.org/ ("Browserify lets you require('modules') in the browser by bundling up all of your dependencies.") does? If by "natively rollup multiple es-modules into a single bundle" you mean fetch various resources in a single file and export those resource in a single object you can ```fetch()``` and export *N* resources as a single JavaScript plain object and process the object key, value pairs after importing the single plain object. ``` // sync const o = { a:1, b:2, c:3 }; // async const states = fetch("https://gist.githubusercontent.com/guest271314/ffac94353ab16f42160e/raw/aaee70a3e351f6c7bc00178eabb5970a02df87e9/states.json") .then(response => response.json()) .catch(e => {console.error(e); return "error fetching states module"}); // async const video = fetch("https://upload.wikimedia.org/wikipedia/commons/d/d9/120-cell.ogv") .then(response => response.blob()) .catch(e => {console.error(e); return "error fetching video module"}); // multiple "modules" exported export {o, states, video}; ``` at single ```<script type="module">``` ``` <script type="module"> import * as o from "./script.js"; (async(mods) => { for (const [key, value] of mods) { if (value instanceof Promise) { console.log("async module", key, await value) } else { console.log("sync module", key, value); } } })(Object.entries(o)); // or Promise.all(Object.values(o)).then(console.log).catch(console.error) </script> ``` Still there is no actual problem statement. Rather, there is conjecture without a definitive issue to solve.
guest271314 at gmail.com (2019-06-02T16:37:03.920Z)
> 1) original-question - is native es-module's async-behavior desirable? > async side-effects are difficult to manage -- i conjecture that > async-loading 20 es-modules (with dependent side-effects) is not practical > for most mortals to handle. It depends on what *you* mean by "desirable" in a given context. There is no difference from loading 1 module and loading 1000 modules except for network cost, memory and disk space usage. Mortals can handle far more than loading 20 es-modules. What are the specific "side-effects" that you are referring to? > describes the mechanism for how to hint the brower to pre-fetch 20 > es-modules. but if you pre-fetch, then is loading-behavior effectively > synchronous? Resources can be "pre-fetched" using various means. From caching the first request and using the cached data instead of making future requests for the same resources to storing one or more entire directories in the browser configuration folder using `requestFileSystem` (Chromiom/Chrome). > but was unclear whether they were individual [async] ```<script > type="module">``` tags, or some es5-transpiled rollup There should not be any difference between the two approaches. If there is a difference then you should be able to clearly state what the difference is, and demonstrate the difference by reproduction, without speculating and not demonstrating a difference by means of reproduction. > 2) the second-question about es-module rollups (which you and i are > debating) stemmed from @isiah's response -- if he and everyone-else use > es5-transpiled rollups (which i suspect), Do not care what "everyone-else" is supposedly doing, here. How can you possibly know what everyone-else is doing and even if you did know what third-parties are doing how does that affect what you are doing? > then shouldn't it be desirable for es-modules to natively support rollups > as well? currently, there's no way to natively rollup multiple es-modules > into a single bundle. There are ways to "bundle" multiple modules into a single export "natively", as demonstrated at the previously posted code. Are you trying to use the same pattern that browserify http://browserify.org/ ("Browserify lets you require('modules') in the browser by bundling up all of your dependencies.") does? If by "natively rollup multiple es-modules into a single bundle" you mean fetch various resources in a single file and export those resource in a single object you can ```fetch()``` and export *N* resources as a single JavaScript plain object and process the object key, value pairs after importing the single plain object. ``` // sync const o = { a:1, b:2, c:3 }; // async const states = fetch("https://gist.githubusercontent.com/guest271314/ffac94353ab16f42160e/raw/aaee70a3e351f6c7bc00178eabb5970a02df87e9/states.json") .then(response => response.json()) .catch(e => {console.error(e); return "error fetching states module"}); // async const video = fetch("https://upload.wikimedia.org/wikipedia/commons/d/d9/120-cell.ogv") .then(response => response.blob()) .catch(e => {console.error(e); return "error fetching video module"}); // multiple "modules" exported export {o, states, video}; ``` at single ```<script type="module">``` ``` <script type="module"> import * as o from "./script.js"; (async(mods) => { for (const [key, value] of mods) { if (value instanceof Promise) { console.log("async module", key, await value) } else { console.log("sync module", key, value); } } })(Object.entries(o)); </script> ``` Still there is no actual problem statement. Rather, there is conjecture without a definitive issue to solve.
guest271314 at gmail.com (2019-06-02T16:34:39.908Z)
> 1) original-question - is native es-module's async-behavior desirable? > async side-effects are difficult to manage -- i conjecture that > async-loading 20 es-modules (with dependent side-effects) is not practical > for most mortals to handle. It depends on what *you* mean by "desirable" in a given context. There is no difference from loading 1 module and loading 1000 modules except for network cost, memory and disk space usage. Mortals can handle far more than loading 20 es-modules. What are the specific "side-effects" that you are referring to? > describes the mechanism for how to hint the brower to pre-fetch 20 > es-modules. but if you pre-fetch, then is loading-behavior effectively > synchronous? Resources can be "pre-fetched" using various means. From caching the first request and using the cached data instead of making future requests for the same resources to storing one or more entire directories in the browser configuration folder using `requestFileSystem` (Chromiom/Chrome). > but was unclear whether they were individual [async] ```<script > type="module">``` tags, or some es5-transpiled rollup There should not be any difference between the two approaches. If there is a difference then you should be able to clearly state what the difference is, and demonstrate the difference by reproduction, without speculating and not demonstrating a difference by means of reproduction. > 2) the second-question about es-module rollups (which you and i are > debating) stemmed from @isiah's response -- if he and everyone-else use > es5-transpiled rollups (which i suspect), Do not care what "everyone-else" is supposedly doing, here. How can you possibly know what everyone-else is doing and even if you did know what third-parties are doing how does that affect what you are doing? > then shouldn't it be desirable for es-modules to natively support rollups > as well? currently, there's no way to natively rollup multiple es-modules > into a single bundle. There are ways to "bundle" multiple modules into a single export "natively", as demonstrated at the previously posted code. Are you trying to use the same pattern that browserify http://browserify.org/ ("Browserify lets you require('modules') in the browser by bundling up all of your dependencies.") does? If by "natively rollup multiple es-modules into a single bundle" you mean fetch various resources in a single file and export those resource in a single object you can ```fetch()``` and export N resources as a single JavaScript plain object and process the object key, value pairs after importing the single plain object. ``` // sync const o = { a:1, b:2, c:3 }; // async const states = fetch("https://gist.githubusercontent.com/guest271314/ffac94353ab16f42160e/raw/aaee70a3e351f6c7bc00178eabb5970a02df87e9/states.json") .then(response => response.json()) .catch(e => {console.error(e); return "error fetching states module"}); // async const video = fetch("https://upload.wikimedia.org/wikipedia/commons/d/d9/120-cell.ogv") .then(response => response.blob()) .catch(e => {console.error(e); return "error fetching video module"}); // multiple "modules" exported export {o, states, video}; ``` at single ```<script type="module">``` ``` <script type="module"> import * as o from "./script.js"; (async(mods) => { for (const [key, value] of mods) { if (value instanceof Promise) { console.log("async module", key, await value) } else { console.log("sync module", key, value); } } })(Object.entries(o)); </script> ``` Still there is no actual problem statement. Rather, there is conjecture without a definitive issue to solve.
guest271314 at gmail.com (2019-06-02T16:34:23.110Z)
> 1) original-question - is native es-module's async-behavior desirable? > async side-effects are difficult to manage -- i conjecture that > async-loading 20 es-modules (with dependent side-effects) is not practical > for most mortals to handle. It depends on what *you *mean by "desirable" in a given context. There is no difference from loading 1 module and loading 1000 modules except for network cost, memory and disk space usage. Mortals can handle far more than loading 20 es-modules. What are the specific "side-effects" that you are referring to? > describes the mechanism for how to hint the brower to pre-fetch 20 > es-modules. but if you pre-fetch, then is loading-behavior effectively > synchronous? Resources can be "pre-fetched" using various means. From caching the first request and using the cached data instead of making future requests for the same resources to storing one or more entire directories in the browser configuration folder using `requestFileSystem` (Chromiom/Chrome). > but was unclear whether they were individual [async] ```<script > type="module">``` tags, or some es5-transpiled rollup There should not be any difference between the two approaches. If there is a difference then you should be able to clearly state what the difference is, and demonstrate the difference by reproduction, without speculating and not demonstrating a difference by means of reproduction. > 2) the second-question about es-module rollups (which you and i are > debating) stemmed from @isiah's response -- if he and everyone-else use > es5-transpiled rollups (which i suspect), Do not care what "everyone-else" is supposedly doing, here. How can you possibly know what everyone-else is doing and even if you did know what third-parties are doing how does that affect what you are doing? > then shouldn't it be desirable for es-modules to natively support rollups > as well? currently, there's no way to natively rollup multiple es-modules > into a single bundle. There are ways to "bundle" multiple modules into a single export "natively", as demonstrated at the previously posted code. Are you trying to use the same pattern that browserify http://browserify.org/ ("Browserify lets you require('modules') in the browser by bundling up all of your dependencies.") does? If by "natively rollup multiple es-modules into a single bundle" you mean fetch various resources in a single file and export those resource in a single object you can ```fetch()``` and export N resources as a single JavaScript plain object and process the object key, value pairs after importing the single plain object. ``` // sync const o = { a:1, b:2, c:3 }; // async const states = fetch("https://gist.githubusercontent.com/guest271314/ffac94353ab16f42160e/raw/aaee70a3e351f6c7bc00178eabb5970a02df87e9/states.json") .then(response => response.json()) .catch(e => {console.error(e); return "error fetching states module"}); // async const video = fetch("https://upload.wikimedia.org/wikipedia/commons/d/d9/120-cell.ogv") .then(response => response.blob()) .catch(e => {console.error(e); return "error fetching video module"}); // multiple "modules" exported export {o, states, video}; ``` at single ```<script type="module">``` ``` <script type="module"> import * as o from "./script.js"; (async(mods) => { for (const [key, value] of mods) { if (value instanceof Promise) { console.log("async module", key, await value) } else { console.log("sync module", key, value); } } })(Object.entries(o)); </script> ``` Still there is no actual problem statement. Rather, there is conjecture without a definitive issue to solve.
guest271314 at gmail.com (2019-06-02T16:28:11.944Z)
> 1) original-question - is native es-module's async-behavior desirable? > async side-effects are difficult to manage -- i conjecture that > async-loading 20 es-modules (with dependent side-effects) is not practical > for most mortals to handle. It depends on what *you *mean by "desirable" in a given context. There is no difference from loading 1 module and loading 1000 modules except for network cost, memory and disk space usage. Mortals can handle far more than loading 20 es-modules. What are the specific "side-effects" that you are referring to? > describes the mechanism for how to hint the brower to pre-fetch 20 > es-modules. but if you pre-fetch, then is loading-behavior effectively > synchronous? Resources can be "pre-fetched" using various means. From caching the first request and using the cached data instead of making future requests for the same resources to storing one or more entire directories in the browser configuration folder using `requestFileSystem` (Chromiom/Chrome). > but was unclear whether they were individual [async] ```<script > type="module">``` tags, or some es5-transpiled rollup There should not be any difference between the two approaches. If there is a difference then you should be able to clearly state what the difference is, and demonstrate the difference by reproduction, without speculating and not demonstrating a difference by means of reproduction. > 2) the second-question about es-module rollups (which you and i are > debating) stemmed from @isiah's response -- if he and everyone-else use > es5-transpiled rollups (which i suspect), Do not care what "everyone-else" is supposedly doing, here. How can you possibly know what everyone-else is doing and even if you did know what third-parties are doing how does that affect what you are doing? > then shouldn't it be desirable for es-modules to natively support rollups > as well? currently, there's no way to natively rollup multiple es-modules > into a single bundle. There are ways to "bundle" multiple modules into a single export "natively", as demonstrated at the previously posted code. Another example approach ``` // sync const o = { a:1, b:2, c:3 }; // async const states = fetch("https://gist.githubusercontent.com/guest271314/ffac94353ab16f42160e/raw/aaee70a3e351f6c7bc00178eabb5970a02df87e9/states.json") .then(response => response.json()) .catch(e => {console.error(e); return "error fetching states module"}); // async const video = fetch("https://upload.wikimedia.org/wikipedia/commons/d/d9/120-cell.ogv") .then(response => response.blob()) .catch(e => {console.error(e); return "error fetching video module"}); // multiple "modules" exported export {o, states, video}; ``` at single ```<script type="module">``` ``` <script type="module"> import * as o from "./script.js"; (async(mods) => { for (const [key, value] of mods) { if (value instanceof Promise) { console.log("async module", key, await value) } else { console.log("sync module", key, value); } } })(Object.entries(o)); </script> ``` Still there is no actual problem statement. Rather, there is conjecture without a definitive issue to solve.
guest271314 at gmail.com (2019-06-02T16:26:11.763Z)
> 1) original-question - is native es-module's async-behavior desirable? > async side-effects are difficult to manage -- i conjecture that > async-loading 20 es-modules (with dependent side-effects) is not practical > for most mortals to handle. It depends on what *you *mean by "desirable" in a given context. There is no difference from loading 1 module and loading 1000 modules except for network cost, memory and disk space usage. Mortals can handle far more than loading 20 es-modules. What are the specific "side-effects" that you are referring to? > describes the mechanism for how to hint the brower to pre-fetch 20 > es-modules. but if you pre-fetch, then is loading-behavior effectively > synchronous? Resources can be "pre-fetched" using various means. From caching the first request and using the cached data instead of making future requests for the same resources to storing one or more entire directories in the browser configuration folder using `requestFileSystem` (Chromiom/Chrome). > but was unclear whether they were individual [async] ```<script > type="module">``` tags, or some es5-transpiled rollup There should not be any difference between the two approaches. If there is a difference then you should be able to clearly state what the difference is, and demonstrate the difference by reproduction, without speculating and not demonstrating a difference by means of reproduction. > 2) the second-question about es-module rollups (which you and i are > debating) stemmed from @isiah's response -- if he and everyone-else use > es5-transpiled rollups (which i suspect), Do not care what "everyone-else" is supposedly doing, here. How can you possibly know what everyone-else is doing and even if you did know what third-parties are doing how does that affect what you are doing? > then shouldn't it be desirable for es-modules to natively support rollups > as well? currently, there's no way to natively rollup multiple es-modules > into a single bundle. There are ways to "bundle" multiple modules into a single export "natively", as demonstrated at the previously posted code. Another example approach ``` // sync const o = { a:1, b:2, c:3 }; // async const cities = fetch("https://gist.githubusercontent.com/guest271314/ffac94353ab16f42160e/raw/aaee70a3e351f6c7bc00178eabb5970a02df87e9/states.json") .then(response => response.json()) .catch(e => {console.error(e); return "error fetching cities module"}); // async const video = fetch("https://upload.wikimedia.org/wikipedia/commons/d/d9/120-cell.ogv") .then(response => response.blob()) .catch(e => {console.error(e); return "error fetching video module"}); // multiple "modules" exported export {o, cities, video}; ``` at single ```<script type="module">``` ``` <script type="module"> import * as o from "./script.js"; (async(mods) => { for (const [key, value] of mods) { if (value instanceof Promise) { console.log("async module", key, await value) } else { console.log("sync module", key, value); } } })(Object.entries(o)); </script> ``` Still there is no actual problem statement. Rather, there is conjecture without a definitive issue to solve.