News for hackers. Stuff that matters.
Re:Show HN: Under the hood ReactJS by always_good on Tuesday July 04, 2017 @12:06PM (#14696626)
You're being a bit dishonest in these posts. Maybe it's your marketing style and maybe it works, but it puts me off.

I even see it in your landing page marketing.

    > MINIMAL
    > One function
    > Its entire API surface area is a single function
Then I scroll down.

    var bindObject = require('simulacra')
    var bindEvents = bindObject.bindEvents
    var animate = bindObject.animate
    var retainElement = bindObject.retainElement
Re:Show HN: Under the hood ReactJS by daliwali on Wednesday July 05, 2017 @07:25AM (#14701506)
This has been revised. There is now a separate entry point for helpers, to make it obvious to people who don't read docs, that it is separate functionality:

    var helpers = require('simulacra/helpers')
    var bindEvents = helpers.bindEvents
    var animate = helpers.animate
There is no practical difference. It is just for those who read code but lack reading comprehension skills.
Re:Show HN: Under the hood ReactJS by always_good on Wednesday July 05, 2017 @10:13PM (#14707708)
I'm not sure what that accomplishes.

The "entire API surface area," as you put it, surely includes more functions than the only one you need for a landing page's hello-world. I don't evaluate something like Simulacra with a hello-world in mind, else I wouldn't need Simulacra.

My advice is to just change "one function" to "tiny API". Or maybe "just three functions in the public API". That's just as respectable and spares you from needing to split your API into a pointless "helpers" namespace.

    const {bindObject, bindEvents, animate} = require('simulacra')
^ looks ideal to me.
Re:Show HN: Under the hood ReactJS by daliwali on Saturday July 08, 2017 @01:35AM (#14724238)
No, the entire API really is one function. The events and animation helpers can be implemented by the user in a few lines of code, they are not at all required. There is nothing stopping you from adding event listeners or CSS classes without these conveniences. Putting rather trivial functionality in the same level as the only core function would be highly misleading. I would rather completely remove the helper functions, than to satisfy pedants who complain, "but there's two completely optional functions so it's not just one!!1"
Re:Show HN: Under the hood ReactJS by daliwali on Tuesday July 04, 2017 @12:19PM (#14696705)
There is actually only one function, that is the one returned from `require('simulacra')`, the others are merely conveniences that are common enough, and `retainElement` is a symbol, not a function.

To demarcate this separation better I have considered moving the optional convenience functions into a separate module, which might help clear things up.

Edit: actually it seems that you were being dishonest when quoting me, this is what it says, you cut it off short:

>Its entire API surface area is a single function (with some optional helpers and symbols)

That makes it pretty clear that the core functionality is a single function.

Re:Show HN: Under the hood ReactJS by RUTHLESS_RUFUS on Tuesday July 04, 2017 @02:25PM (#14697442)
I appreciate your attempt, but we don't need any more astronaut-architects. We have the tools.

It's 2017 and high time for JavaScript tooling to finally slow down a bit and settle into its bigger britches.

Re:Show HN: Under the hood ReactJS by daliwali on Tuesday July 04, 2017 @02:42PM (#14697531)
>Astronaut-architects

Facebook can come out with a project that's over 40k lines of code, and it is "extremely simple". But no, it is me with my little 5kb function who is the "astronaut-architect".

>It's 2017

I don't care what year it is, you act like the current frameworks are the only viable options in the future. Hint: they aren't.

Re:Show HN: Under the hood ReactJS by RUTHLESS_RUFUS on Tuesday July 04, 2017 @02:54PM (#14697596)
Let's revisit this in 2020. I have a strange feeling that React will still be heavily used (though maybe encroached by some future framework, you are correct about the changing landscape!) with Angular still trying to follow the leader.
Re:Show HN: Under the hood ReactJS by paulddraper on Tuesday July 04, 2017 @09:09PM (#14699361)
If Angular is trying to follow React (which I'm supposing is "the leader"), it is doing a very crap job of it. I'd say Mithril is following React, but I wouldn't say that about Angular.