marcoroth / stimulus-parser

Statically analyze Stimulus controllers in your project.
https://hotwire.io/ecosystem/tooling/stimulus-parser
MIT License
34 stars 7 forks source link

Detect deprecated `esbuild-rails` gem and warn about it #161

Open marcoroth opened 3 months ago

marcoroth commented 3 months ago

The Stimulus Parser currently doesn't know how to handle https://github.com/rails/esbuild-rails.

We should detect the usage and warn the user that the Stimulus Parser doesn't work with this deprecated gem.

Reported by @asilano, thank you!

asilano commented 3 months ago

Hey - thanks for picking up my email!

I realise I rambled a bit, but it looks to me like Stimulus Parser supports esbuild-rails (analyzeEsbuildRails, called from ControllersIndexFile#analyze().

Our project - where the LSP isn't picking up registered controllers - is using (recommended replacement) jsbundling-rails with esbuild-plugin-stimulus; I think the parser doesn't know how to handle that.

marcoroth commented 3 months ago

Hey Chris, I'm not done yet, but wanted to respond to your email too!

The esbuild-rails support the parser supports is for the esbuild-rails NPM package.

I personally wasn't aware of esbuild-plugin-stimulus, but I guess it would make sense to support that too!

Looking at it, it seems that esbuild-rails and esbuild-plugin-stimulus are very similar.

marcoroth commented 3 months ago

I opened an issue to add support for esbuild-plugin-stimulus too 🙌🏼