@hotwired/stimulus vs stimulus Package
jonmchan opened this issue · comments
Is there a difference between the @hotwired/stimulus
vs the stimulus
package? I'm trying to use an older stimulus package (https://github.com/jgorman/rails-datatables/blob/master/src/index.js) in a rails 7 project. When I tried to pin the package with importmap, it pulled stimulus
. Tried using it, but it didn't work.
I was not completely sure if there was another application being generated and the controller was registering to something else or if there are other incompatibilities (or just plain user error).
Some insight on why many packages have @hotwired
prefixed to them in npm would be great. If I missed the documentation, feel free to point me to it and I apologize in advance.
The official package is https://www.npmjs.com/package/@hotwired/stimulus - as of version 3.0
I am pretty sure that the legacy npm package location is just kept up to date for usage that has not migrated to v3.0 correctly yet - https://www.npmjs.com/package/stimulus
It look like the package you are trying to use rails-datatables
has not been updated in 3 years and is only using Stimulus v1.1 - https://github.com/jgorman/rails-datatables/blob/master/package.json#L32 - hence why it has not used the new (correct) v3.* package reference of @hotwired/stimulus
.
This means that package will likely be not compatible at all with the latest version of Stimulus unfortunately.