s-KaiNet/spfx-fast-serve

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

kbeeveer46 opened this issue · 7 comments

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

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

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.

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.

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?

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.

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

  • ~version “Approximately equivalent to version”, will update you to all future patch versions, without incrementing the minor version. ~1.2.3 will use releases from 1.2.3 to <1.3.0.

  • ^version “Compatible with version”, will update you to all future minor/patch versions, without incrementing the major version. ^1.2.3 will use releases from 1.2.3 to <2.0.0.

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

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.