00:10:13
| * aki_ | joined |
00:11:26
| * akirose | quit (Ping timeout: 260 seconds) |
00:19:46
| * akirose | joined |
00:20:49
| * aki_ | quit (Ping timeout: 248 seconds) |
00:37:58
| * AtumT | quit (Remote host closed the connection) |
00:52:31
| * ChALkeR | quit (Ping timeout: 256 seconds) |
02:14:18
| <coolreader18> | How would I make a proposal for ECMAScript? |
02:16:56
| <coolreader18> | I dunno I'll just talk |
02:17:42
| <coolreader18> | Basically it would be some form of syntax like `import { A, B, C } as D from "d";` |
02:18:30
| <coolreader18> | In the browser it wouldn't have much effect, since it'd still have to download and parse the whole thing |
02:19:16
| <coolreader18> | but for module bundlers like webpack it would allow for better tree shaking, as it wouldn't have to figure out what is and isn't being used |
02:19:52
| <coolreader18> | You would just specify which imports you'd like to import, and it wouldn't clutter up the scope |
02:20:43
| <coolreader18> | So for lodash, instead of doing `import { util0, util1, util2 } from "lodash"`, which would clutter up the scope |
02:21:45
| <coolreader18> | Or `import * as _ from "lodash"`, which would bundle all of lodash |
02:22:39
| <coolreader18> | You could just do `import { util0, util1, util2 } as _ from "lodash"`, which would group it all together and tree-shake what's not needed off of lodash |
02:26:01
| * aki_ | joined |
02:26:52
| * akirose | quit (Ping timeout: 245 seconds) |
03:12:11
| <jmdyck> | coolreader18: to make a proposal for ECMAScript, you could start with a short to es-discuss. |
03:12:24
| <jmdyck> | s/short/short post/ |
04:16:57
| <coolreader18> | Thanks! |
04:19:21
| * akirose | joined |
04:19:28
| <jmdyck> | I suggest a short one to begin, as you may get responses like "yes, we've discussed that, see <link>" or "there's a proposal to similar effect <here>" |
04:19:47
| * aki_ | quit (Ping timeout: 255 seconds) |
04:39:35
| * not-an-aardvark | joined |
04:57:12
| * jmdyck | quit (Remote host closed the connection) |
05:00:07
| <ljharb> | coolreader18: imo treeshaking is a hack around not having properly separated modules in the firstt place; and i'm not clear on why "cluttering up the scope" is a concern |
05:00:53
| <coolreader18> | I sent to the es-discuss mailing list here: https://mail.mozilla.org/pipermail/es-discuss/2018-June/051088.html |
05:02:24
| <coolreader18> | Sometimes you have to import a lot from a single module, or just would like to group all imports under a single variable |
05:03:04
| <ljharb> | sure, but you can do that in two lines already |
05:03:22
| <ljharb> | `import { a, b, c } from 'd'; const foo = { a, b, c }` (also i'm skeptical that there's value in "grouping imports under a single variable" |
05:03:24
| <ljharb> | ) |
05:04:31
| <devsnek> | this can't work |
05:05:06
| <devsnek> | unless you say like |
05:05:21
| <devsnek> | "cancel the tree shake" if someone does import * as or import() |
05:05:33
| <devsnek> | although that problem isn't specific to what was proposed here |
05:05:48
| <coolreader18> | Keeping scope clean is used as a rationale on the export default from proposal, https://github.com/tc39/proposal-export-default-from#symmetry-between-import-and-export |
05:06:44
| <coolreader18> | > However, if v is unused in the local scope, then it has introduced a name to the local scope unnecessarily. |
05:06:55
| <coolreader18> | it's not the exact same issue, but it's similar |
05:09:16
| <devsnek> | for your lodash thing |
05:09:28
| <devsnek> | i would say `import whatever from 'lodash.whatever'` |
05:09:49
| <ljharb> | also treeshaking works with `import * as` most of the time. |
05:10:01
| <devsnek> | i was gonna bring that up |
05:10:11
| <devsnek> | since tree shaking only happens with tooling |
05:10:15
| <devsnek> | there's usually additional stuff |
05:10:16
| <ljharb> | coolreader18: if the bundler can determine that you're only using a, b, and c, it shakes out all the others. with lodash, for example - rollup and webpack already work like this. |
05:10:28
| <ljharb> | coolreader18: so in your example, importing all the icons would not in fact increase your bundle size. |
05:18:55
| <coolreader18> | Huh, I didn't know that |
05:19:46
| <coolreader18> | I suppose that does nullify the main purpose |
05:20:40
| <coolreader18> | Other than that it would be that you spell out what you want imported and what you don't, so that you'd be able to make better sense of the import statements |
05:20:55
| <coolreader18> | Or not, it's 12am where I am and I'm tired |
05:21:31
| <ljharb> | that's what you get by importing each thing as a separate variable tho |
05:21:47
| <ljharb> | if you need 4 things, then it's not "scope clutter" to have 4 variables |
05:47:22
| <coolreader18> | true |
05:47:39
| <coolreader18> | I also found this discussion from a while back on the mailing list: https://esdiscuss.org/topic/import-foo-bar-as-obj-from-module |
06:25:53
| * aki_ | joined |
06:27:16
| * akirose | quit (Ping timeout: 265 seconds) |
06:30:59
| * srl295 | quit (Quit: Connection closed for inactivity) |
06:49:19
| * not-an-aardvark | quit (Quit: Connection closed for inactivity) |
06:53:01
| * ChALkeR | joined |
07:21:25
| * ChALkeR | quit (Quit: Konversation terminated!) |
07:21:37
| * ChALkeR | joined |
08:25:04
| * keith_miller | joined |
08:32:36
| * akirose | joined |
08:33:32
| * aki_ | quit (Ping timeout: 245 seconds) |
08:46:15
| * ChALkeR | quit (Ping timeout: 256 seconds) |
08:47:37
| * ChALkeR | joined |
09:36:19
| * keith_miller | quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:25:10
| * mylesborins | quit (Quit: farewell for now) |
10:25:41
| * mylesborins | joined |
10:38:18
| * aki_ | joined |
10:39:05
| * akirose | quit (Ping timeout: 240 seconds) |
10:53:16
| * jmdyck | joined |
11:07:39
| * keith_miller | joined |
12:07:16
| * keith_miller | quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:43:28
| * akirose | joined |
12:44:30
| * aki_ | quit (Ping timeout: 260 seconds) |
13:31:09
| * keith_miller | joined |
13:37:51
| * ChALkeR | quit (Ping timeout: 268 seconds) |
13:38:07
| * ChALkeR | joined |
13:40:09
| * keith_miller | quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:43:32
| * keith_miller | joined |
14:43:34
| * keith_miller | quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:49:39
| * aki_ | joined |
14:50:24
| <jmdyck> | Anyone know offhand why `[...x,,] = 0` is supposed to be unparsable? |
14:50:45
| * akirose | quit (Ping timeout: 264 seconds) |
14:51:17
| * ChALkeR | quit (Ping timeout: 276 seconds) |
15:04:00
| * keith_miller | joined |
15:15:29
| * ChALkeR | joined |
15:24:57
| * ChALkeR | quit (Ping timeout: 240 seconds) |
15:45:32
| <bradleymeck> | jmdyck: it has something after the rest |
15:45:46
| <bradleymeck> | [x,,] = [1,2]; x // 1 |
15:46:17
| <bradleymeck> | we don't allow rest params in a position that has things after them |
16:56:24
| * akirose | joined |
16:57:37
| * aki_ | quit (Ping timeout: 248 seconds) |
17:15:37
| * keith_miller | quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:21:00
| * keith_miller | joined |
17:23:19
| <jmdyck> | okay, thanks. |
17:37:52
| <jmdyck> | what about `for(;;)` ? seems like ASI makes that valid. |
17:38:05
| <devsnek> | wdym |
17:38:37
| <jmdyck> | if the entirety of the script is for(;;) |
17:38:44
| <devsnek> | oh |
17:39:07
| <jmdyck> | test262-parser-tests expects it to be a no-parse |
17:41:27
| <devsnek> | well newer syntax features aren't worrying about asi as much anymore |
17:41:32
| <devsnek> | i dunno about that though |
17:41:46
| <devsnek> | probably because either `{}` or `;` would be an explicit completion |
17:41:49
| <devsnek> | but there is none |
17:42:12
| <jmdyck> | but asi will insert a ';' at the end |
17:49:13
| <devsnek> | well like i said |
17:49:21
| <devsnek> | since there's no explicit completion |
17:49:32
| <devsnek> | its more likely to be an error than someone wanting to use asi |
17:49:40
| <devsnek> | which is probably fine anyway |
17:49:43
| <devsnek> | asi is a nasty beast |
18:32:00
| * ChALkeR | joined |
18:59:08
| * ChALkeR | quit (Ping timeout: 268 seconds) |
19:02:29
| * aki_ | joined |
19:02:32
| * akirose | quit (Ping timeout: 256 seconds) |
19:33:04
| * keith_miller | quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:52:46
| * keith_miller | joined |
19:57:05
| * keith_miller | quit (Ping timeout: 240 seconds) |
19:59:32
| * keith_miller | joined |
20:03:57
| * keith_miller | quit (Ping timeout: 245 seconds) |
20:05:51
| * keith_miller | joined |
20:52:58
| * keith_miller | quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:56:05
| * coolreader18 | quit (Ping timeout: 255 seconds) |
21:08:15
| * akirose | joined |
21:09:28
| * aki_ | quit (Ping timeout: 256 seconds) |
21:32:10
| * PlasmaStar | quit (Ping timeout: 264 seconds) |
21:32:29
| * PlasmaStar | joined |
21:58:34
| * keith_miller | joined |
22:45:30
| * pandem | quit (Ping timeout: 260 seconds) |
22:59:37
| * keith_miller | quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:02:24
| * pandem | joined |
23:14:58
| * aki_ | joined |
23:16:15
| * akirose | quit (Ping timeout: 260 seconds) |