A modest JavaScript framework for the HTML you already have
MIT License
Bot releases are visible (Hide)
PageUp
and PageDown
to keyMappings by @seb-jean in https://github.com/hotwired/stimulus/pull/677
@window
by @ThomasLandauer in https://github.com/hotwired/stimulus/pull/676
Controller.dispatch()
method by @marcoroth in https://github.com/hotwired/stimulus/pull/643
ValueTypeObject
to be provided as a Partial
by @marcoroth in https://github.com/hotwired/stimulus/pull/650
afterLoad
method gets called bound to controller by @lb- in https://github.com/hotwired/stimulus/pull/658
Scope
is connected before accessing outlets by @marcoroth in https://github.com/hotwired/stimulus/pull/648
ActionEvent
(with params) to registerActionOption
callbacks by @lb- in https://github.com/hotwired/stimulus/pull/692
Controller
instance to registerActionOption
callback by @lb- in https://github.com/hotwired/stimulus/pull/691
Full Changelog: https://github.com/hotwired/stimulus/compare/v3.2.1...v3.2.2
Published by dhh almost 2 years ago
Full Changelog: https://github.com/hotwired/stimulus/compare/v3.2.0...v3.2.1
Published by dhh almost 2 years ago
afterLoad
static methods on Controllers by @lb- in https://github.com/hotwired/stimulus/pull/579
Full Changelog: https://github.com/hotwired/stimulus/compare/v3.1.1...v3.2.0
Published by dhh almost 2 years ago
exports
field for stimulus
package and Webpack 5 by @glaszig in https://github.com/hotwired/stimulus/pull/569
Full Changelog: https://github.com/hotwired/stimulus/compare/v3.1.0...v3.1.1
Published by dhh over 2 years ago
:stop
and :prevent
by @radiantshaw in https://github.com/hotwired/stimulus/pull/535
:self
by @radiantshaw in https://github.com/hotwired/stimulus/pull/546
stimulus
glue package for cdn use by @marcoroth in https://github.com/hotwired/stimulus/pull/468
Full Changelog: https://github.com/hotwired/stimulus/compare/v3.0.1...v3.1.0
Published by dhh about 3 years ago
webpack-helpers
in stimulus
glue/proxy package by @marcoroth in https://github.com/hotwired/stimulus/pull/453
Full Changelog: https://github.com/hotwired/stimulus/compare/v3.0.0...v3.0.1
Published by dhh about 3 years ago
Release announcement ππ
Published by dhh about 3 years ago
Published by dhh about 3 years ago
definitionsFromContext
[#444]Instead of webpack-helpers, use either stimulus-rails with import maps or the new rake task + generator to keep a manifest up to date (or maintain a manifest by hand).
Published by dhh about 3 years ago
Stimulus is moving package location on npm from stimulus
to @hotwired/stimulus
. The new package is an all-in-one, so no more individual packages for core, multi map, mutation-observers, etc.
Stimulus 3 will no longer support IE11. Our compile target is now ES6+.
Note: This release was built from the branch single-package
, which will be merged to main as soon as a few issues regarding tests and examples are resolved. But that has no impact on the use of this beta release.
Rails users: You can use this release via stimulus-rails 0.3.10 with the new importmap-rails approach.
change
to input
(https://github.com/stimulusjs/stimulus/commit/14ba2abf75c7ce97e015199996239645d93cd1a9, https://github.com/stimulusjs/stimulus/issues/248)If you're upgrading from a previous version of Stimulus, note that the syntax for target attributes has changed to move the controller identifier into the attribute's name. The new format is data-[identifier]-target="[name]"
instead of data-target="[identifier].[name]"
. You can still use the old syntax, but you will see a warning in the console, and support will be removed in a future version.
The data map API from Stimulus 1.0 will continue to work but is no longer documented and should be considered internal. We suggest migrating to the new values API.
stimulus
package (#214)@stimulus/polyfills
dependencies to work around upstream changes (0251c87795f351a7462d00fa0f028b2daf967a01)innerHTML
assignment in IE 11 (#133) and, in rare cases, when annotating elements synchronously after removing them from an observed tree (#161)innerHTML
assignment in IE 11 (#133) and, in rare cases, when annotating elements synchronously after removing them from an observed tree (#161)this.has*Target
property names in different locales (https://github.com/stimulusjs/stimulus/pull/93)NEW: Linked target properties (https://github.com/stimulusjs/stimulus/pull/61, https://github.com/stimulusjs/stimulus/pull/68)
Define a controller's target names and Stimulus automatically creates properties for accessing them:
export default class extends Controller {
static targets = [ "source" ]
initialize() {
this.sourceTarget // Element
this.sourceTargets // Element[]
this.hasSourceTarget // boolean
}
}
NEW: Configurable error handler (https://github.com/stimulusjs/stimulus/pull/53)
const application = Application.start()
application.handleError = (error, message, detail) => {
console.warn(message, detail)
Raven.captureException(error)
}
NEW: Namespaced identifiers (https://github.com/stimulusjs/stimulus/pull/65)
If your controller file is named⦠| its identifier will be⦠|
---|---|
list_item_controller.js | list-item |
users/list_item_controller.js | users--list-item |
CHANGED: Controller autoloading with webpack (https://github.com/stimulusjs/stimulus/pull/46)
A new definitionsFromContext
helper replaces the old autoload
helper:
const application = Application.start()
-const context = require.context("./controllers", true, /\.js$/)
-autoload(context, application)
+const context = require.context("./controllers", true, /\.js$/)
+application.load(definitionsFromContext(context))
REMOVED: Action method event target argument (https://github.com/stimulusjs/stimulus/pull/55)
Previously, action methods were invoked with two arguments: event
, eventTarget
. Now, only the event
is passed:
-greet(event, eventTarget) {
- console.log(event, eventTarget)
+greet(event) {
+ console.log(event, event.target)
}
REMOVED: Controller#{add,remove}Action (https://github.com/stimulusjs/stimulus/pull/50)
Noted for posterity since these methods were undocumented.