AhsanAyaz / ngx-device-detector

An Angular v7+ library to detect the device, OS, and browser details.
https://ahsanayaz.github.io/ngx-device-detector
MIT License
517 stars 101 forks source link

Feature/migrate to angular 17 #286

Closed pvds closed 9 months ago

pvds commented 9 months ago

Make the ngx-device-detector library and demo app compatible with Angular 17

Fixes #282

pvds commented 9 months ago

@AhsanAyaz should I manually bump the version, changelog and readme?

Update: I'll do the same as you did in the NG16 PR

isoroka-plana commented 9 months ago

When can this be merged and released? This package is blocking me from migrating to v17 normally right now.

@pvds thanks a lot for doing the work on this.

pvds commented 9 months ago

@isoroka-plana the latest released package version works fine so until version 7 is released you could specify an override in your package.json to temporarily resolve the peer dependency mismatch.

For example for npm:

"overrides": {
    "ngx-device-detector": {
        "@angular/common": "$@angular/common",
        "@angular/core": "$@angular/core",
    }
}
isoroka-plana commented 9 months ago

@isoroka-plana the latest released package version works fine so until version 7 is released you could specify an override in your package.json to temporarily resolve the peer dependency mismatch.

For example for npm:

"overrides": {
    "nxg-device-detector": {
        "@angular/common": "$@angular/common",
        "@angular/core": "$@angular/core",
    }
}

thank you for this suggestion, I didn't know that overrides exist, but I tried and unfortunately it doesn't work in an npm workspace, as overrides can only be used in the root package.json. Starting to think that my best option is just to copy the service for now.

Frotty commented 9 months ago

@pvds Override is not working for me either

edit: Ah okay, you mistyped "ngx" as "nxg". with the correct name it works @isoroka-plana

isoroka-plana commented 9 months ago

I also realized a few hours later that there was a typo 🤣 But still I had to move the related packages to the root of the monorepo to be able to use overrides.

AhsanAyaz commented 9 months ago

Damn! What's going on here 😄 Sorry I was busy trying to wrap up the Angular Cookbook 2nd Edition so I can sleep in peace. I will look into this ASAP. Thanks for the work @isoroka-plana and @pvds

isoroka-plana commented 9 months ago

@AhsanAyaz thank you for merging it! Credit is all @pvds's, I am merely a passerby.

AhsanAyaz commented 9 months ago

@isoroka-plana sure thing 🙌🏽 Version 7.0.0 has been released and is available on npm now.