Echo JS 0.11.0

<~>

tracker1 comments

tracker1 1937 days ago. link 1 point
Would still probably lean into the spread for the nested call... since everything except for IE11 supports it now.

https://caniuse.com/#feat=mdn-javascript_operators_spread_spread_in_function_calls

Same goes for classes actually.
tracker1 1938 days ago. link 2 points
Sigh... the article doesn't even cover what it says in the title.

First, if you use the class syntax, then you will get an error if you don't use new.

    class Foo {
      // implementation details go here
    }

    Foo(); // Error: Class constructor Foo cannot be invoked without 'new'

Second, you can do the same kind of behavior in a constructor function.

    function Foo() {
      if (!(this instanceof Foo)) {
        throw new Error("Class constructor Foo cannot be invoked without 'new'");
      }
      // implementation details go here
    }

The article does discuss the issue, but gives no real resolution, such as above.

The article's solution break the type for the returned object... you may as well not use a constructor/class at all if that's your approach, which is fine, but don't use a constructor function naming `Foo` if you're returning a custom object, use `createFoo` or another appropriate name.

Alternatively...

    function Foo(...args) {
      if (!(this instanceof Foo)) {
        return new Foo(...args);
      }
      ...
    }
tracker1 1938 days ago. link 1 point
Came across this today and thought it was pretty nifty.
tracker1 1938 days ago. link 2 points
I've effectively stopped supporting IE11 for over 2 years now... Every other browser added async function support by the end of April, 2017, nearly 3 years ago.  That's where I cutoff.

IE11 shouldn't be supported at this point imho, and I will not make efforts to do so.  Supporting IE11 adds complexity and/or bundle sizes that are excessive to support what aren't even that modern of features at this point.

https://gist.github.com/tracker1/8eea53ec700a0fea725123516a30a70a
tracker1 1938 days ago. link 1 point
That link seems to work correctly.  And yes, Windows 10 (2004, Build 19041.172 update), Chrome (80.0.3987.149)
tracker1 1939 days ago. link 1 point
Example using puppeteer (chrome/chromium) to generate images from content.
tracker1 1939 days ago. link 1 point
Windows + Chrome...  Not sure what input I could offer... it's like the entire application is rendered three times... scrollbar on the right... I didn't interact much, so unsure if it's from the start or each interaction.  It is a bit of an odd behavior... the models for all three seem to be the same as changes in one change the others.
tracker1 1940 days ago. link 1 point
The entire application seems to be rendering three times...
tracker1 1940 days ago. link 1 point
Coll... didn't dig in as I don't have time.  Advice below.

These *should* be SVG based with minimal JS and not using any heavy libraries... none of this should add more than a couple kb to your payload.  So evaluate what you're using.

I've seen a lot of poor practice in terms of using shared UI libraries, many include far more than they ever should.
[more]