Skip to content

Commit d48045e

Browse files
planetaskaclaude
andcommitted
spike: adopt the install generator's shim wiring
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent e5c1d9f commit d48045e

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Registers the packaged hibiki client (the "hibiki-rails" module: the
2+
// engine's importmap pin, or the npm package in bundler apps) as the
3+
// "hibiki" Stimulus controller — the Ruby helpers hardcode that
4+
// identifier in data-controller. File-backed on purpose: `bin/rails
5+
// stimulus:manifest:update` re-derives this exact registration from the
6+
// filename, so it survives manifest rewrites.
7+
export { default } from "hibiki-rails"

spike/app/javascript/controllers/index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
import { application } from "controllers/application"
33
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
44
eagerLoadControllersFrom("controllers", application)
5-
6-
// The packaged hibiki client (vendored by the hibiki_rails engine, pinned
7-
// as "hibiki-rails"). The identifier must be "hibiki" — the Ruby helpers
8-
// hardcode it in data-controller.
9-
import HibikiController from "hibiki-rails"
10-
application.register("hibiki", HibikiController)
5+
// The packaged hibiki client is registered by the eager-loaded
6+
// hibiki_controller.js shim (file-backed so stimulus:manifest:update
7+
// can't drop it).

0 commit comments

Comments
 (0)