Live data from Hacker News

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

github.com

31–40 of 112 posts

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

#31
In essence, Basecamp has a well-maintained legacy system that they keep patching up because it doesn't make sense businesswise to rewrite it from scratch using modern methodologies. Good for them, I do that myself but be careful going down that path if you are starting a new project and you have the resources/experience to have a more solid/correct foundation with proper separation of concerns.

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

#32
As a Rails dev, I find this very interesting. I've already jumped on the Vue bandwagon and have had a pretty good time using it. That being said, I recently started a new small-ish Rails project and loaded Vue in via 5.1's Webpack integration...and ended up just hacking together some jQuery stuff for minor front-end dynamism. It just was easier/faster for me to do that in this particular context.

However, I could definitely see myself using Stimulus instead because it's just so incredibly simple to "sprinkle" (DHH's word) some JS onto the page and get dynamism quickly. I look forward to putting Stimulus through its paces and see if it is a good option for projects where Vue is overkill.

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

#33
post #31

In essence, Basecamp has a well-maintained legacy system that they keep patching up because it doesn't make sense businesswise to rewrite it from scratch using modern methodologies. Good for them, I do that myself but be careful going down that path if you are starting a new project and you have the resources/experience to have a more solid/correct foundation with proper separation of concerns.

Hmm not so sure. I may be wrong but I am pretty sure every major version of Basecamp has been a ground-up re-write of the app.

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

#34
post #22

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…

At some point, you have to stop following that advice or you end up on Lotus Notes and Tivoli. Which is entirely relevant to this discussion.

And I bet you the people who were consultants for those implementations never got fired because they chose them.

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

#35
post #16

For context, I'm in no way, shape, or form a modern front end maestro. I'm good with ES6, Jquery, Handlebars, and Bootstrap. I've done a little with the Angular 2. From that perspective.... What does this buy me over the other more popular frameworks? What are the chances that this won't be abandoned if it doesn't gain traction? It's also easier to recruit developers if you say your stack is built on the more popular…

What does ES6, Jquery, Handlebars, Bootstrap and Angular 2 buy you ?

ES6 - The standard version of JavaScript that all browsers support/will support.

JQuery - a simplified syntax to access the DOM, do ajax, and add events to elements.

HandleBars - if you don't want a heavyweight framework but you do want a simplified templating system. Handlebars is simpler.

My usual MO for front end development when I don't want to implement a full SPA framework:

1. Create a template with Handlebars

2. Use Ajax to get the model.

3. Render the template.

Or.

Create the view with Handlebars

Assign events using JQuery to the rendered elements.

Adjust the model based on the events.

Re-render the template based on the model.

But at some point, it makes sense to use a full fledged framework because at a certain level of complexity, you are reinventing the wheel. But even then, I can use Ember that uses Handlebars.

But it doesn't make sense to use Handlebars and Angular.

Bootstrap is for layout whether you use Handlebars or Angular.

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

#36
post #5

Earlier quoted context omitted.

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

It bothers me a bit that it feels intentionally dismissive of (or oblivious to) the current state-of-the-art of JavaScript frameworks. None of the criticism mentioned feel like an honest reflection of my last two years working with React (4 years total). Universal rendering is mainstream, there are plenty of options for vastly simplifying initial setup and overall complexity (eg Next.js). From what I understand, simi…

> Universal rendering is mainstream, there are plenty of options for vastly simplifying initial setup and overall complexity

> arguing for its place in the world of 2-3 years ago, rather than the present-day.

Basecamp pays particular focus to productivity, developer happiness, and staying small. It is through these tenants that they use tools and develop new ones. They are dismissive of frontend JS frameworks because they run counter to their tenants. They embrace the fact that with the web, there are a multitude of ways to deliver a webapp - there is no linear progress but simply an increase in options to suit needs.

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

#37
post #20

Earlier quoted context omitted.

I think what StimulusJS is supposed to bring to the table is that it watches the DOM for you, so you don't have to manage the integration or setup of the interactivity/app framework , providing a very easy way to integrate StimulusJS with your current Turbolinks setup. That being said, I do have to worry about memory leaks.

It watches the DOM for you, since that's where state is, but every other thing watches the JS for you, because that's where the state is. I don't see the advantage.

If you watch the DOM then it might be more compatible with things like jQuery plugins, which operate directly on the DOM instead of your JS object in memory somewhere.

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

#38
post #31

In essence, Basecamp has a well-maintained legacy system that they keep patching up because it doesn't make sense businesswise to rewrite it from scratch using modern methodologies. Good for them, I do that myself but be careful going down that path if you are starting a new project and you have the resources/experience to have a more solid/correct foundation with proper separation of concerns.

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.

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

#39

Earlier quoted context omitted.

It bothers me a bit that it feels intentionally dismissive of (or oblivious to) the current state-of-the-art of JavaScript frameworks. None of the criticism mentioned feel like an honest reflection of my last two years working with React (4 years total). Universal rendering is mainstream, there are plenty of options for vastly simplifying initial setup and overall complexity (eg Next.js). From what I understand, simi…

> Universal rendering is mainstream, there are plenty of options for vastly simplifying initial setup and overall complexity > arguing for its place in the world of 2-3 years ago, rather than the present-day. Basecamp pays particular focus to productivity, developer happiness, and staying small. It is through these tenants that they use tools and develop new ones. They are dismissive of frontend JS frameworks because…

"tenet" (principle), not "tenant" (occupant of a dwelling)
Post reply on HN