Skip to content

Commit c447b28

Browse files
committed
reverted back to what seemed to be working
1 parent c04f1a8 commit c447b28

15 files changed

+19
-59
lines changed

app/javascript/application.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
12
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2-
import "@hotwired/turbo-rails"
33
import "config"
44
import "channels"
55
import "controllers"

app/javascript/config/cable_ready.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import CableReady from 'cable_ready'
21
import consumer from 'channels/consumer'
2+
import CableReady from 'cable_ready'
33

44
CableReady.initialize({ consumer })
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
import { Application } from "@hotwired/stimulus"
2+
import consumer from "channels/consumer"
23
const application = Application.start()
4+
5+
// Configure Stimulus development experience
6+
application.debug = false
7+
application.consumer = consumer
8+
window.Stimulus = application
9+
310
export { application }

app/javascript/controllers/chat_controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import ApplicationController from './application_controller'
33
export default class extends ApplicationController {
44
connect() {
55
super.connect()
6+
console.log('Chat controller connected')
67
}
78

89
submit(event) {

app/javascript/controllers/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
12
import { application } from "controllers/application"
23
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
4+
eagerLoadControllersFrom("controllers", application)

config/importmap.rb

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
# Pin npm packages by running ./bin/importmap
22

33
pin "application", preload: true
4-
pin "@hotwired/turbo-rails", to: "@hotwired--turbo-rails.js" # @7.3.0
5-
pin "@hotwired/stimulus", to: "@hotwired--stimulus.js" # @3.2.1
4+
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
5+
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
66
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
7-
pin "@rails/actioncable", to: "@rails--actioncable.js" # @7.0.4
8-
pin "morphdom" # @2.6.1
9-
pin "lodash.debounce" # @4.0.8
10-
pin "cable_ready" # @5.0.0
11-
pin "stimulus_reflex" # @3.5.0
7+
pin "@rails/actioncable", to: "actioncable.esm.js", preload: true
8+
pin "morphdom", to: "https://ga.jspm.io/npm:morphdom@2.6.1/dist/morphdom.js", preload: true
9+
pin "lodash.debounce", to: "https://ga.jspm.io/npm:lodash.debounce@4.0.8/index.js"
10+
pin "cable_ready", to: 'cable_ready.js', preload: true
11+
pin "stimulus_reflex", to: "stimulus_reflex.js", preload: true
1212
pin_all_from "app/javascript/controllers", under: "controllers"
1313
pin_all_from "app/javascript/channels", under: "channels"
1414
pin_all_from "app/javascript/config", under: "config"
15-
pin "@hotwired/turbo", to: "@hotwired--turbo.js" # @7.3.0
16-
pin "@rails/actioncable/src", to: "@rails--actioncable--src.js" # @7.0.4

vendor/javascript/@hotwired--stimulus.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

vendor/javascript/@hotwired--turbo-rails.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

vendor/javascript/@hotwired--turbo.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

vendor/javascript/@rails--actioncable--src.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)