15:08
<nicolo-ribaudo>
Is there a reason why the destructuring pattern `{...{}}` is disallowed with an early error, while `[...{}]` is allowed?
15:20
<Justin Ridgewell>
[…{ length }] = [1, 2]?
15:44
<nicolo-ribaudo>
Oh it makes sense
15:44
<nicolo-ribaudo>
The inconsistency annoys me, but I cannot think of a real reason to allow it in object destructuring (maybe "I want to trigger every getter"?)
16:33
<Mathieu Hofman>
({...foo}) ?
16:33
<Mathieu Hofman>
But that will get removed by virtually all optimizers
17:11
<ljharb>
not a correct one
17:12
<ljharb>
there's a bunch of annoying places parens are required around an object literal, i assume because of the ambiguity with block statements
19:56
<Mathieu Hofman>
I meant a standalone "assumed no side effect" expression like this will often get removed by minifiers, the same way foo.bar will. Basically if the goal is to "trigger getters", minifiers will usually get rid of any such constructs.
20:52
<ljharb>
I’d still call that a broken minifier
20:53
<ljharb>
similar incorrect expectations caused rollup to break Airbnb.com on IE for a month, a few years back
20:53
<Mathieu Hofman>
they all are ;)
21:26
<bakkot>
I feel like, if I could get away with breaking IE support for a month without getting angry phone calls, I would do it and then tell management it's clearly not actually important to support
21:26
<bakkot>
unfortunately we do actually see nontrivial traffic on IE9 and I have in fact gotten angry phone calls for breaking it, sigh
21:27
<bakkot>
or, well, angry slack messages
21:41
<ljharb>
i mean, to be fair this was in like 2018 when IE was still in much, much wider usage
21:42
<ljharb>
but yeah even now IE needs to be supported far more than trendy devs want to admit