ng2-pdfjs-viewer icon indicating copy to clipboard operation
ng2-pdfjs-viewer copied to clipboard

Angular 14 compatibility

Open sgabb opened this issue 2 years ago • 14 comments

Hello, any plan to update compatibility and dependency to Angular 14?

sgabb avatar Jul 15 '22 07:07 sgabb

Soon, Will do in next couple of weeks

codehippie1 avatar Jul 22 '22 20:07 codehippie1

Any updates on this? :)

MotassemJa avatar Aug 11 '22 08:08 MotassemJa

really want support for angular 14 =)

Kreash avatar Aug 11 '22 12:08 Kreash

This is the last dependency I need for upgrading a project to Angular 14, so I'll probably start on a PR here soon. I don't believe there will be any particular changes between 13 and 14 that would cause any issues.

dereekb avatar Aug 13 '22 23:08 dereekb

I am out of country till school opening. But I should be able to merge changes from your PR. Please let me know once it is ready.

codehippie1 avatar Aug 14 '22 02:08 codehippie1

PR is created. Double check the changes, but all I did was bump the versions, create an ng-package.json file since they're required now apparently, merged those module declaration together, and ran build.

In the meantime if anyone is blocked by this you can pull down a special branch I've got that hosts the dist files directly:

"ng2-pdfjs-viewer": "git+https://[email protected]/dereekb/ng2-pdfjs-viewer#82b994d49db5406f64bc39229a04b3871b33d0b5",

Example of it working on my project:

Screen Shot 2022-08-14 at 12 34 45 AM

dereekb avatar Aug 14 '22 04:08 dereekb

Awaiting for the update .. need it badly.. 4 apps affected.. Please help.

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! While resolving: [email protected] npm ERR! Found: @angular/[email protected] npm ERR! node_modules/@angular/common npm ERR! @angular/common@"^14.1.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @angular/common@"^13.2.2" from [email protected] npm ERR! ng2-pdfjs-viewer@"*" from the root project

hemant-parmar avatar Aug 19 '22 07:08 hemant-parmar

@dereekb

In the meantime if anyone is blocked by this you can pull down a special branch I've got that hosts the dist files directly:

You mean the given reference "ng2-pdfjs-viewer": "git+...." should be added to the package.json file under dependencies?

hemant-parmar avatar Aug 19 '22 08:08 hemant-parmar

@dereekb

In the meantime if anyone is blocked by this you can pull down a special branch I've got that hosts the dist files directly:

You mean the given reference "ng2-pdfjs-viewer": "git+...." should be added to the package.json file under dependencies?

Yes you can add it to your package.json. But this is a temporary solution

MotassemJa avatar Aug 19 '22 08:08 MotassemJa

@dereekb I used your link as a temp solution in package.json. But got the below error: Error: NG04002: Cannot match any routes. URL Segment: 'assets/pdfjs/web/viewer.html'

Note that I have the below in the angular.json file's options-assets (it was there for the prev version's implementation) { "glob": "**/*", "input": "node_modules/ng2-pdfjs-viewer/pdfjs", "output": "/assets/pdfjs" }

Then I manually copied the the node_modules/ng2-pdfjs-viewer/pdfjs folder to the assets folder and then it worked. But is this the right way? I was not required to do this manual copy-paste earlier. Did I miss anything in implementing the temp solution?

hemant-parmar avatar Aug 22 '22 13:08 hemant-parmar

Edit: Misread. The README states you need to manually copy this folder. So yes, you are correct.

https://github.com/intbot/ng2-pdfjs-viewer/blob/25973eb38d3676666c09f38b045fd85334a18f41/README.MD#step-2-copy-task-for-pdfjs

## Step 2: Copy task for pdfjs
For several advanced options to work, you need a copy of pdfjs from this npm package.
Edit your project's `angular.json` file and use `ng build` as described here https://angular.io/guide/workspace-config#project-asset-configuration 
```json
"assets": [
  { "glob": "**/*", "input": "node_modules/ng2-pdfjs-viewer/pdfjs", "output": "/pdfjs" },
]

_Please note, you may manually Copy `node_modules\ng2-pdfjs-viewer\pdfjs` to your `public` or `asset` folder or use any copy script as part of your build process.

I change the word "may" to "must" in my PR to hopefully reduce confusion in the future.

dereekb avatar Aug 22 '22 19:08 dereekb

Any updates on when this will be released?

Laurens-makel avatar Aug 31 '22 14:08 Laurens-makel

I will return from vacation on Sep 12th. I could merge this the same week. Anyone interested in being a maintainer, let me know, would be happy to share the responsibilities.

codehippie1 avatar Aug 31 '22 17:08 codehippie1

Any updates on the release for this? Thank you!

NotTheSamAdamsGuy avatar Sep 15 '22 16:09 NotTheSamAdamsGuy

When exit new release?

Toso82 avatar Sep 26 '22 07:09 Toso82

@dereekb @Toso82 @NotTheSamAdamsGuy @Laurens-makel @hemant-parmar @sgabb @MotassemJa @Kreash New version is released with Angular 14. Also - Sample app and local deployment scripts are updated.

I am extremely sorry about the delay, I was out of country for a while and got back last week. On a side note @dereekb - Would you like to have permission to merge pull requests? From the looks of it - You went through the code already. I could certainly use a backup in my absence.

codehippie1 avatar Sep 26 '22 21:09 codehippie1

Thanks, that's great!

sgabb avatar Sep 26 '22 21:09 sgabb