A lot of people misunderstood Top-level await is a footgun, including me. I thought the primary danger was that people would be able to put things like AJAX requests in their top-level await expressions, and that this was terrible because await strongly encourages sequential operations even though a lot of the asynchronous activity we're talking about should actually happen concurrently.
But that's not the worst of it. Imperative module loading is intrinsically bad for app startup performance, in ways that are quite subtle.
Consider an app like this:
// main.jsThis gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:
- TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
- In the wild, we're seeing
(async main(){...}())as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems - Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.
I'll leave the rest of this document unedited, for archaeological
| ** Please do not post any more messages which amount to "I have the same issue" with no additional information. | |
| ** I get a notification for each one and it is just noise; knowing that one more person has the same issue does | |
| ** not help anyone. If these content-free comments continue to appear I will delete this gist to cut down on | |
| ** the noise. You have been warned. | |
| Aug 21 20:02:57 sfere kernel: [107297.977252] IPv4: martian source 172.17.207.66 from 192.168.49.1, on dev br1 | |
| Aug 21 20:02:57 sfere kernel: [107297.981023] ll header: 00000000: 00 04 a7 05 ac 0c 84 d6 d0 91 67 b4 08 00 ..........g... | |
| Aug 21 20:02:57 sfere kernel: [107298.729160] IPv4: martian source 172.17.207.66 from 192.168.49.1, on dev br1 | |
| Aug 21 20:02:57 sfere kernel: [107298.736326] ll header: 00000000: 00 04 a7 05 ac 0c 84 d6 d0 91 67 b4 08 00 ..........g... | |
| Aug 21 20:02:58 sfere kernel: [107299.793616] IPv4: martian source 172.17.207.66 from 192.168.49.1, on dev br1 |
| #!/bin/bash | |
| ## define image directory | |
| DIR=.build/src/webroot/uploads | |
| ## define image sizes | |
| sizes=(320 640 1280) | |
| ## imagemagick function | |
| ## convert $1(image) $2(width) $3(newname) |
| server { | |
| server_name house.example.net; | |
| listen 1.2.3.4:80 default_server; | |
| listen [2001:1234:ffff::1]:80 default_server; | |
| add_header Cache-Control "public,max-age=31536000"; | |
| return 301 https://$server_name$request_uri; | |
| } | |
| map $ssl_client_s_dn $ssl_username { |
| #directories | |
| bower_components | |
| node_modules | |
| dist | |
| #files | |
| *.tgz | |
| *.log |
This is a note to myself about what I need to do to setup a Raspbian box.
- Username is
piand pw israspberry.osmc/osmcif OSMC. apt-get updateapt-get dist-upgrade -yapt-get install nfs-kernel-server openvpn software-properties-common vim git dnsutils -y
software-properties-commonfor adding PPAs
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 249AD24C
- we can't use
apt-add-repositorybecause the Deluge PPA only has Ubuntu builds - key info is found here
| (function x(){"use strict"; x = 1;}()); // TypeError | |
| (function x(){x = 1; return x !== 1;}()); // write fails silently; function returns true | |
| (function x(){"use strict"; x = (function(){throw 0;})();})() // Error 0 | |
| // These three lines rely on ES6. | |
| (function x(){const x = 1;})() // No-op. In particular, not a redeclaration of x. | |
| (function (){"use strict"; const x = 1; x = 2;})() // TypeError | |
| (function (){const x = 1; x = 2;})() // TypeError. contrast (function x(){x = 2;}()); |
| { | |
| "stage": 0, | |
| "blacklist": [ | |
| "es6.arrowFunctions", | |
| "es6.blockScoping", | |
| "es6.classes", // Don't black this if you are using ES7 classes features | |
| "es6.forOf", | |
| "es6.templateLiterals", | |
| "es6.constants", | |
| "es6.properties.computed", |