fetch-client icon indicating copy to clipboard operation
fetch-client copied to clipboard

Is this package version number following semver?

Open jrencz opened this issue 5 years ago • 5 comments

Background:

Recently I had to wipe out my old package-lock.json which kept me at 1.4.x because I lost access to the private instance of NPM registry I used to have. Current latest was installed: 1.8.2

Problem: It made my app throw errors saying some function from _aureliaPal.DOM is not there.

Solution: Eventually I found out that there's aurelia-pal and aurelia-pal-browser now and one needs to call initialize. Everything is OK now.

But that made me think: the constraint was expressed ^1.4.0 so npm was allowed to install 1.8.2 once I removed the lock. The problem is that 1.5.0 is not backwards compatible with 1.4.0. It's requird to initialize the PAL. Once I found that out I was like: "PAL is really a great idea!", but there's also no notice about that in the readme.

I imagine users of aurelia-fetch-client inside aurelia-framework have no such problem (I have no aurelia apps to find out quickly)

I suggest at least a notice about how to use the aurelia-fetch-client package stand-alone should be added to the readme. I'm using aurelia-fetch-client stand-alone, without aurelia-framework. I do it because I like its features but the app it's used in is not aurelia app. It would be great to have it mentioned in readme in here and in any other packages suitable to be used stand-alone as well.

jrencz avatar Apr 05 '19 12:04 jrencz

I guess when we made that changes, this module being used in non-Aurelia apps was not considered carefully. So, for Aurelia apps: not a breaking change. For non-Aurelia apps: it was a breaking changes. Now, it's hard to answer your Q

bigopon avatar Apr 05 '19 12:04 bigopon

That's what I guessed :)

I'm aware that stand-alone usage is not a first-class usage, but I'd like to raise awareness on that. I'd be grateful if this example made the team consider such usage in the future

I'm not currently aware of where's the best place to put the informacji about necessity to use aurelia-pal-browser. I know that being a user of aurelia-fetch-client stand alone I'd look for such information either in README.md of the package (most obvious way) or maybe in package docs on aurelia page

Maybe a good way would be to add a section about stand-alone usage linking to an article in the docs?

jrencz avatar Apr 05 '19 14:04 jrencz

Would an explicit peerdependency on the respective version of pal help?

zewa666 avatar Apr 05 '19 15:04 zewa666

Would an explicit peerdependency on the respective version of pal help?

Setting aurelia-pal-browser as a peer dependency of aurelia-fetch-client, right? This might help but I'm not sure if it will draw as much attention as it deserves (all in all - if the PAL is not initialized then client will fail on first request)

I also have an idea: checking if PAL is initialized when client is created and warning the developer in console.

It will be a message just in time.

jrencz avatar Apr 05 '19 16:04 jrencz

What are the versions? Looking at NPM and it goes from 0.9.0 (I'm not counting 0.10.0-dev* as releases for general usage) to 2.* alpha/dev. 1.* is completely missing.

https://www.npmjs.com/package/@aurelia/fetch-client

johnmanko avatar Oct 30 '21 04:10 johnmanko