Skip to content

Commit

Permalink
fix: return QrCodeModule to avoid breaking change (#109)
Browse files Browse the repository at this point in the history
As suggested in
#106 (comment)
bring back the `QrCodeModule` as a deprecated symbol to maintain
backwards compatibility
  • Loading branch information
mnahkies authored Jan 5, 2025
1 parent 422b983 commit e6d40d0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# 19.0.1 - 2025-01-05
- Bring back `QrCodeModule` for backwards compatibility (#109)

# 19.0.0 - 2025-01-05
- Support Angular 19 (#106)
- `QrCodeComponent` and `QrCodeDirective` are now `standalone` components

<strike>
*BREAKING CHANGES:*
- `QrCodeComponent` and `QrCodeDirective` are now `standalone` components
- `QrCodeModule` has been removed
</strike>

Update: 19.0.1 brings back the `QrCodeModule` such that this should be a non-breaking change. It's
still recommended to migrate away from using the `QrCodeModule`

See the [readme](https://github.com/mnahkies/ng-qrcode#importing) for instructions on how to import the
components correctly after these changes, but **tldr; replace imports of `QrCodeModule` with `QrCodeComponent`**
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ import { QrCodeComponent } from 'ng-qrcode';
})
```

There is also a deprecated `QrCodeModule` that can be imported.

## Usage

### Component
Expand Down
2 changes: 1 addition & 1 deletion projects/ng-qrcode/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ng-qrcode",
"description": "Simple AOT compatible QR code generator for your Angular project.",
"version": "19.0.0",
"version": "19.0.1",
"license": "MIT",
"author": {
"name": "Michael Nahkies",
Expand Down
23 changes: 23 additions & 0 deletions projects/ng-qrcode/src/lib/qr-code.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { CommonModule } from "@angular/common"
import { NgModule } from "@angular/core"
import { QrCodeComponent } from "./qr-code.component"
import { QrCodeDirective } from "./qr-code.directive"

/**
* @deprecated prefer importing `QrCodeComponent` or `QrCodeDirective` directly
*/
@NgModule({
declarations: [
],
imports: [
CommonModule,
QrCodeComponent,
QrCodeDirective,
],
exports: [
QrCodeComponent,
QrCodeDirective,
],
})
export class QrCodeModule {
}
1 change: 1 addition & 0 deletions projects/ng-qrcode/src/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

export * from "./lib/qr-code.component"
export * from "./lib/qr-code.directive"
export * from './lib/qr-code.module'
export * from "./lib/types"

0 comments on commit e6d40d0

Please sign in to comment.