29 lines
1.4 KiB
Markdown
29 lines
1.4 KiB
Markdown
---
|
|
title: Starting to sprinkle JavaScript with Simulus
|
|
date: 2024-03-28
|
|
permalink: daily/2024/03/28/starting-to-sprinkle-javascript-with-simulus
|
|
tags:
|
|
- software-development
|
|
- symfony
|
|
- stimulus
|
|
cta: ~
|
|
snippet: |
|
|
Have you used Stimulus? I took it for a test drivet this week.
|
|
---
|
|
|
|
I've been watching the new "Cosmic Coding with Symfony 7" series on SymfonyCasts, and today's video was about Stimulus - a "modest JavaScript framework for the HTML you already have".
|
|
|
|
As I'm comfortable with other frameworks, such as Vue.js and Alpine.js, I've usually skipped videos about Stimulus, but today, it caught my eye.
|
|
|
|
I was intrigued by it and experimented with it by refactoring a component from a project I am working on.
|
|
|
|
I like the organisation Stimulus provides by using JavaScript classes and controllers while keeping things simple in the HTML code.
|
|
|
|
I initially did this in Fractal but then created [an example project][repo] using Stimulus with esbuild. It's now on my GitHub profile and includes other tools such as Nix, just, and Tmuxinator.
|
|
|
|
After this short evaluation, I like Stimulus and will use it on other components in this project, maybe using third-party Stimulus controllers - either directly or for inspiration.
|
|
|
|
Hat tip to Ryan Weaver and SymfonyCasts for showing Stimulus and Nick Janetakis for showing me esbuild.
|
|
|
|
[repo]: https://github.com/opdavies/stimulus-esbuild-example
|