hotwired / stimulus

A modest JavaScript framework for the HTML you already have
https://stimulus.hotwired.dev/
MIT License
12.74k stars 427 forks source link

Misleading version text on stimulus dist files #714

Open tonywok opened 1 year ago

tonywok commented 1 year ago

Hi there,

First of all thank you for all your hard work. I've been a happy stimulus user for some time now.

Noticed something (maybe?) weird when investigating a bug that was resolved in #648. I wanted to be sure that I had the fix since I was still seeing the pre-fix behavior 🤔

Anyway, I was looking at the 3.2.2 tag and noticed that if you download the files from https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.2.tgz you seem to get 3.2.1 😅.

Pulling this thread a bit more, it seems https://www.npmjs.com/package/@hotwired/stimulus/v/3.2.2?activeTab=code is also displaying 3.2.1.

edit: apologies, it seems npm's website doesn't link the ui state (irony), so you have to manually navigate to the file. Including screenshot for now

image

Anyway, this is making me wonder if 3.2.2 was in fact released. Apologies in advance if this ends up being an exercise in rationalization. Trying to convince myself otherwise.


Update: See https://github.com/hotwired/stimulus/issues/714#issuecomment-1678134462 for explanation.

marcoroth commented 1 year ago

Hey @tonywok, yeah Stimulus 3.2.2 is fully released and is actually the version which is up on NPM.

Sadly the comment at the top of the dist file is misleading. Depending on how you run the yarn/npm release cycle you build the library first and then bump the version number as part of the release process. This can lead to such weird artifacts as you are describing here. Like, at the point when the library was built the "current version" was still the "previous version" and after that the version gets bumped.

Either way, we should probably make sure that this doesn't happen anymore or remove the version number from the dist-files all together to avoid confusion.

tonywok commented 1 year ago

Ah, I see. Thank you for the prompt response. I'll go ahead and update the issue title to reflect what's actually occurring.

marcoroth commented 1 year ago

If you look at the package.json inside the 3.2.2 version on npm you can in fact see it's the right version. Sorry for the confusion.

But this definitely something we need to sort out.