Browse Source

Bump stimulus now that it's out of beta

pull/33/head
baarkerlounger 3 years ago
parent
commit
f9a12e411d
  1. 10
      app/javascript/controllers/application.js
  2. 15
      app/javascript/controllers/hello_controller.js
  3. 12
      app/javascript/controllers/index.js
  4. 2
      package.json
  5. 8
      yarn.lock

10
app/javascript/controllers/application.js

@ -0,0 +1,10 @@
import { Application } from "@hotwired/stimulus"
const application = Application.start()
// Configure Stimulus development experience
application.warnings = true
application.debug = false
window.Stimulus = application
export { application }

15
app/javascript/controllers/hello_controller.js

@ -1,18 +1,7 @@
// Visit The Stimulus Handbook for more details
// https://stimulusjs.org/handbook/introduction
//
// This example controller works with specially annotated HTML like:
//
// <div data-controller="hello">
// <h1 data-target="hello.output"></h1>
// </div>
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = [ "output" ]
connect() {
this.outputTarget.textContent = 'Hello, Stimulus!'
this.element.textContent = "Hello World!"
}
}

12
app/javascript/controllers/index.js

@ -1,9 +1,7 @@
// Load all the controllers within this directory and all subdirectories.
// Controller files must be named *_controller.js.
// This file is auto-generated by ./bin/rails stimulus:manifest:update
// Run that command whenever you add a new controller
import { Application } from "stimulus"
import { definitionsFromContext } from "stimulus/webpack-helpers"
import { application } from "./application"
const application = Application.start()
const context = require.context("controllers", true, /_controller\.js$/)
application.load(definitionsFromContext(context))
import HelloController from "./hello_controller"
application.register("hello", HelloController)

2
package.json

@ -2,7 +2,7 @@
"name": "data-collector",
"private": true,
"dependencies": {
"@hotwired/stimulus": "^3.0.0-beta.2",
"@hotwired/stimulus": "^3.0.0",
"@hotwired/turbo": "^7.0.0-rc.3",
"@hotwired/turbo-rails": "^7.0.0-rc.3",
"@rails/actioncable": "^6.0.0",

8
yarn.lock

@ -885,10 +885,10 @@
resolved "https://registry.npmjs.org/@csstools/convert-colors/-/convert-colors-1.4.0.tgz"
integrity sha512-5a6wqoJV/xEdbRNKVo6I4hO3VjyDq//8q2f9I6PBAvMesJHFauXDorcNCsr9RzvsZnaWi5NYCcfyqP1QeFHFbw==
"@hotwired/stimulus@^3.0.0-beta.2":
version "3.0.0-beta.2"
resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.0.0-beta.2.tgz#64ca67af9cc473ca97bb99d98fee5bc08e4c3914"
integrity sha512-rp2XojlugD0mvqi3qbqM660PbjqS7hnq/8FYa7SK/DL2rvWDu0/Ka3KW8cyXtcB1RiVG4nX5Oh4oq3nmuDjENQ==
"@hotwired/stimulus@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.0.0.tgz#45171e61417af60f0e546665c52fae5b67295cee"
integrity sha512-UFIuuf7GjKJoIYromuTmqfzT8gZ8eu5zIB5m2QoEsopymGeN7rfDSTRPyRfwHIqP0x+0vWo4O1LFozw+/sWXxg==
"@hotwired/turbo-rails@^7.0.0-rc.3":
version "7.0.0-rc.3"

Loading…
Cancel
Save