Echo JS 0.11.0

<~>

tracker1 comments

tracker1 1811 days ago. link 2 points
Was going to mention the demo size is 2.7mb transfer size, but looks like 1.6mb of that is storybook in the demo iframe.

So ~~1.1mb, which is still pretty big, but considering the size some of these kinds of things reach, not so bad in general considering this includes some other framework resources on top that may not be part of the actual demo.

I would suggest getting a demo screen outside storybook that only showed the resources needed for the demo itself, so the overhead can be determined independently.

NOTE: for anyone using this, or other large modules (graphing, pdf and reporting modules in general tend to get very big), make sure you have async chunks setup in your build pipeline and are loading these modules with an async abstraction layer to not impact your initial load times as much.
tracker1 1818 days ago. link 1 point
Okay, the marketing fluff really gets in the way of any actual attempt at understanding...

Would be nice to have an actual "Getting Started" that walks through checking out code, creating a project, and where to edit/put something... even a client/server example of a todo-mvc-like app.
tracker1 1818 days ago. link 1 point
-0 is also falsy

Worth mentioning, in the comparison with undefined, is that if you JSON.serialize an object with a property set to `undefined` it will remove the property from output.  If it's a value in an array, it will be replaced with null.
tracker1 1818 days ago. link 1 point
While this helps to explain the pattern, the reality is that you're unlikely to want to do these kinds of things in JavaScript.  You are likely better off either using an object, Map or array for these types of profiles.

Aside: how do others feel about these "Programming concept/algorithm X in JavaScript" posts?
tracker1 1818 days ago. link 1 point
Just curious if anyone finds these types of basic level tutorials useful?  I mean, generics are probably a core feature in using TypeScript in the first place.  There's also a lot of posts that are pretty intro js or node as well.  Curious what opinions are.
tracker1 1818 days ago. link 1 point
I'd suggest posting on stack overflow.

That said..

    const checks = Array.from(
      document.querySelectorAll('input[name^=newpackqty]')
    );
    const noSrcLabels = !checks.find(el => ~~el.value);

the first one gets all inputs with a name that starts with newpackqty, and the second checks to find if one has a numeric value that is not 0, and inverts the rsult (!).
tracker1 1820 days ago. link 1 point
The blacklist isn't really much worse than the whitelist depending on the database... though if you're using a distributed/redundant db, such as Cassandra/Scylla, BigTable, Dynamo or Storage Tables, then a whitelist can be opportunistic.

If you're using a structured (SQL) database, either white or blacklist should work roughly equally.
tracker1 1820 days ago. link 1 point
While this does show how you *could* use linked lists in JavaScript, in practice, don't do this... just use JS Arrays with plain objects.  The overhead for the article's methods will generally take a lot more memory and not really perform better than Array.prototype methods already available.
[more]