Echo JS 0.11.0

<~>

tracker1 comments

tracker1 3630 days ago. link 2 points
You should use/wrap the web crypto api[0] where available[1].

    var crypto = window.crypto || window.msCrypto; // for IE 11
    var array = new Uint32Array(10);
    crypto.getRandomValues(array);

Uint32Array should now be filled with cryptographically sound random numbers.  There are JS based algorithms that generate better random numbers than Math.Random, but polyfills are a bit heavy.

If you're using webpack/browserify, the crypto library's random is polyfilled, which you can use safely.

    [0] https://developer.mozilla.org/en-US/docs/Web/API/Window/crypto
    [1] http://caniuse.com/#feat=cryptography
tracker1 3630 days ago. link 1 point
I'm not sure who you're referring to... Safari TP seems to have full ES2015 including modules, Chrome is ES2015 feature complete aside from modules and tail call opt.  They're pretty much all over 90%, or very close to feature complete within a release target of about 3 months.

That said, It'll take a little time for older browsers to fall off (IE and Safari being the boat anchors), so we'll be stuck with babel+webpack for a while.  All of that said, it will be nice to be able to have a build target that doesn't need regenerator or large shim libraries.
tracker1 3634 days ago. link 1 point
Going to second a response by another person in tfa's comments... who cares.. if it looks right in the source, and renders correctly, I don't see the problem... if it's really a problem, one could always...

    console.log(`
      <foo>
        <bar />
      </foo>
    `.replace(/$[\r\n]+|[\r\n]+/g,'\n')

or create a function that replaces leading/trailing line feeds, etc with a single line feed.
tracker1 3634 days ago. link 1 point
Comment posted on website:

You need a separate subscriber inside your iframe… I’m guessing you are using <Provide> to wrap your components in the outer window… what you need to do is in the inner window, access the outer store (you’ll need to attach this to the outer window), then from the inner window, use window.parent.store (or whatever name you used), pass that to the iframe’s <provide>

That said, I question the use of an iframe here in general, as it seems you should just be integrating the view into your application.
tracker1 3635 days ago. link 1 point
If you understand how coercion works, you can leverage ==, but for most instances, you should go ahead and be explicit with ===.

The bigger gotchas.

Date (with the same value) won't equate with === as they're separate instances, even if the values match. use (+dtm1 === +dtm2) as this will coerce to a numeric value first.

NaN will not equal NaN... (even with ==), so you will need to account for that (as in above).

There are still a handful of gotchas even with === but they are fewer than with ==.
tracker1 3635 days ago. link 1 point
It's definitely an interesting idea... I could see something like this becoming supported in the browser, and may make sense as an extension to the web components api.  It could also be useful as a webpack extension.

Definitely a cleaner approach to rendering than many template libraries.  Would appreciate some cleaner examples, and perhaps a flushed out todo-mvc implementation to see a bit more of it.

I don't know that it would replace React + Redux as my preference (though I've now used preact on a few things), but it's nice to see creative options that aren't just re-hashes of what everyone else is doing with just a minor tweak.
tracker1 3637 days ago. link 1 point
A lot of it, yes... but I think the interface is a bit cleaner, and extjs is cumbersome to work with imho.  I don't have any use for this, and haven't for a long while, so can't comment.  I have written a lot of extjs code in the past, and would rather not look back at it.
tracker1 3637 days ago. link 1 point
I'm happy to see that the JS for the spreadsheet demo (including jquery) is under 1mb... though I still consider 750k to be huge for a JS, for the functionality it isn't bad...  Didn't look at the other demos, or interact, was just curious as to the size.

This is not something you would probably want for most public facing sites/applications, one of the larger demos weighed in at 1.7mb of js... again, very impressive for the functionality.  I only hope that I can remember about these guys should I ever need this type of functionality again.
[more]