s-KaiNet / spfx-fast-serve

Improve your SharePoint Framework development flow by speeding up the "serve" command :rocket:
MIT License
132 stars 11 forks source link

Why did the latest spfx-fast-serve-helpers version go backwards to 1.17.7? #119

Closed kbeeveer46 closed 6 months ago

kbeeveer46 commented 6 months ago

Was that on purpose? I have 1.18.5 installed and it says I should install 1.17.7.

Is 1.17.7 only supposed to be used if you upgrade to spfx-fast-serve 4.0.0? I saw they both came out around the same time.

I'm current using SPFx 1.18.2, spfx-fast-serve-helpers 1.18.5, and spfx-fast-serve 3.0.7

s-KaiNet commented 6 months ago

What do you mean by "it says I should install 1.17.7"?

kbeeveer46 commented 6 months ago

When I run npm outdated it lists it as out of date. 17.7 is listed as being the latest in NPM https://www.npmjs.com/package/spfx-fast-serve-helpers?activeTab=versions

Package                  Current   Wanted   Latest  Location      
spfx-fast-serve-helpers   1.18.5   1.18.5   1.17.7  node_modules/spfx-fast-serve-helpers

When I've seen this in the past usually the dev accidentally published the wrong version number so I wanted to make this post and confirm if I should install 17.7.

s-KaiNet commented 6 months ago

yeah... 1.17.7 was the latest version I published. Npm works that way, that it sets "latest" tag to any package you published lastly, thus 1.17.7 received latest tag wrongly. I published 1.18.7 which is currently marked as latest. Sorry for the inconvenience. But in general, you should always follow "versions" rule. It means that your fast-serve minor version should always match SPFx minor, no matter what npm outdated says.

kbeeveer46 commented 6 months ago

Thanks. I've always been a little confused by the versioning. I know the docs say one thing but then new versions keep appearing. I will downgrade mine to 1.18.0 since I'm using SPFx 1.18.2. Just curious, what do you the patch updates do and why shouldn't anyone use them?

s-KaiNet commented 6 months ago

Well, you should always be on the latest patch version, for SPFx 1.18 it corresponds to fast-serve 1.18.7. You shouldn't downgrade to 1.18.0. But you should keep ~1.18.0 in your pacakge.json. With this technic, when you run npm install, the latest patch version will be automatically installed. In patch versions, I push new features or bug fixes.

s-KaiNet commented 6 months ago

A little bit more info on tilde ~ vs caret ^ dependencies in npm:

Thus the "versions" rule - always use ~1.[SPFx minor].0 version, because in this case npm will install the latest patch version with all the fixes and new features for fast-serve

kbeeveer46 commented 6 months ago

Thanks! I will go ahead and close this ticket. I upgraded to 4.0.0 and followed the upgrade guide and everything is working as expected.