Live data from Hacker News

Stimulus: A modest JavaScript framework for the HTML you already have

github.com

51–60 of 112 posts

Re: Stimulus: A modest JavaScript framework for the HTML you already have

#51

Earlier quoted context omitted.

(I don't like adding to a response once it's been commented on) My other rule of thumb when choosing a framework is what would happen if things go south, will I be asked by management why I chose X? The old "no one ever got fired for buying IBM". With a pedigree like BaseCamp has, I could justify it by saying it came from them. Just like I justified using Hashicorp's Nomad, even though no one had ever heard of it bef…

> "It allows us to party with productivity like days of yore. A throwback to when a single programmer could make rapacious progress without getting stuck in layers of indirection or distributed systems. [source]( https://github.com/stimulusjs/stimulus/blob/master/ORIGIN.md... I suspect if you're in a situation where you need bureaucratic approval or "CYA" you don't have one of the main problems stimulus is trying to…

I am the architect for a small development shop. Upper management has never in the past year said no to my decisions. I built our dev shop from scratch - environments, procedures, trainings, dev ops, and many of the hires.

I'm very cognizant though if things went south because of major architectural decisions I made - not minor code bugs - or that they didn't give the scaleability, reliability, Security, etc. that was required it would be a major blow to my reputation.

From a more practical standpoint, I'm hiring mostly contractors. Good contractors want to gain skills that will help them on their next gig. It's a lot easier to recruit people when I can tell them we are using the latest, greatest, stable technology (mostly backend work). Also, as a developer, I always "keep my running shoes around my neck". So I balance my decisions on what's the best for the company (highest priority) and what's best for my own career for my next job.

Re: Stimulus: A modest JavaScript framework for the HTML you already have

#53

This reminds me of knockout. http://knockoutjs.com/ Whatever happened to knockout?

The devs seem to be mainly working on an updated version without a lot of the legacy code: https://github.com/knockout/tko

Thanks.

A better home page? How could they possibly improve on that homepage. It is the envy of front-end JS package homepages.

Re: Stimulus: A modest JavaScript framework for the HTML you already have

#54
post #7
post #5

Earlier quoted context omitted.

I believe this section attempts to answer that question: https://github.com/stimulusjs/stimulus/blob/master/ORIGIN.md...

> Stimulus also differs on the question of state. Most frameworks have ways of maintaining state within JavaScript objects, and then render HTML based on that state. Stimulus is the exact opposite. State is stored in the HTML, so that controllers can be discarded between page changes, but still reinitialize as they were when the cached HTML appears again. It really is a remarkably different paradigm. One that I’m sur…

> "You can read that and have a pretty good idea of what’s going on. Even without knowing anything about Stimulus or looking at the controller code itself. It’s almost like pseudocode. That’s very different from reading a slice of HTML that has an external JavaScript file apply event handlers to it. It also maintains the separation of concerns that has been lost in many contemporary JavaScript frameworks." [source](https://github.com/stimulusjs/stimulus/blob/master/ORIGIN.md)

This might be a subjective matter of taste, but I find the React solution much uglier, harder to read, and less intuitive despite the fact that I've been writing React for a while now, and have never written Stimulus.

Here's my guess on why: React syntax has to be able to simultaneously account for JS syntax, HTML syntax, and its own API - all within one syntax that can't be optimized for any one of those use cases. Stimulus allows (forces?) you to leverage more focused HTML syntax where applicable, and javascript syntax where applicable while also letting you leverage your preferred flavors as you see fit (say HAML and CoffeeScript).

Re: Stimulus: A modest JavaScript framework for the HTML you already have

#56
post #42

Earlier quoted context omitted.

Just because they have different ideas and opinions than yours, does not make them in any way wrong or legacy, or unsolid or incorrect. Also, basecamp has been rewritten 3 times.

Try to discuss the idea not my personal opinion.

The central argument of your post appears to be based solely on personal opinion because you provided no evidence to back it up.

meesterdude provided evidence that runs counter to that opinion. I'm not sure what you're complaining about.

Re: Stimulus: A modest JavaScript framework for the HTML you already have

#57
post #25

I think this, along with its sibling Turbolinks [1], is filling a much needed gap with regards to complexity in these javascript frameworks. Myself, I've been playing with intercoolerjs [2] for a few weeks, and it is quite refreshing. These are great libraries for small full-stack teams who do not want to get lost in the complexity of front-end stuff like react, webpack, etc. [1] - https://github.com/turbolinks/turbo…

Frontend stuff doesn't have to be complex. The idea behind React is very simple and it's really something every front end dev should know. You need to understand the why of DOM diffing. It is not complicated. If a frontend dev doesn't want to learn that then they will be out of a job in a decade. It transfers, too. React, Vue, Elm, Reagent, etc, they are all doing this, because it is good, and none of them in isolation are complex. Mithril is actually smaller than Intercooler and is everything included, so there's no need to put together a stack if you don't feel like it.

The stack you are offering is great, and it's great in the right situation, but I just wanted to push back against the "complexity" argument because it happens a lot and it makes me afraid that it is pushing devs into more familiar but less capable stacks. Your React/Vue stack might be a little more setup, but it's also going to scale. The Turbolinks/Intercooler approaches seem to be managing state with the DOM, and as someone who has spent the last six months pulling the state out of the DOM from a jQuery app, it does not scale. But anyone who has used both approaches in a moderately sized app can tell you this, it's why stuff like React exist at all.

Re: Stimulus: A modest JavaScript framework for the HTML you already have

#58
I don't understand the example. How does:

  // hello_controller.js
  import { Controller } from "stimulus"

  export default class extends Controller {
    greet() {
      console.log(`Hello, ${this.name}!`)
    }

    get name() {
      return this.targets.find("name").value
    }
  }
get connected to the element? I would expect something like `stimulus.register("hello", HelloController)`...

Re: Stimulus: A modest JavaScript framework for the HTML you already have

#59
post #58

I don't understand the example. How does: // hello_controller.js import { Controller } from "stimulus" export default class extends Controller { greet() { console.log(`Hello, ${this.name}!`) } get name() { return this.targets.find("name").value } } get connected to the element? I would expect something like `stimulus.register("hello", HelloController)`...

Ah, nevermind, this goes over that: https://github.com/stimulusjs/stimulus/blob/master/INSTALLIN...

Re: Stimulus: A modest JavaScript framework for the HTML you already have

#60
post #56
post #42

Earlier quoted context omitted.

Try to discuss the idea not my personal opinion.

The central argument of your post appears to be based solely on personal opinion because you provided no evidence to back it up. meesterdude provided evidence that runs counter to that opinion. I'm not sure what you're complaining about.

He's parroting what they said. "rewritten"... more like revamped.
Post reply on HN