Skip to content

Commit df73ccc

Browse files
committed
Release version 2.0.1 with enhancements and fixes
- Added tests for PDF.js loader, improving coverage for worker URL handling and fallback mechanisms. - Changed default PDF.js worker asset to `pdf.worker.min.js` for correct MIME type handling. - Updated worker URL resolution to support absolute paths and fallback for lazy-loaded scripts. - Fixed missing AcroForm editor modal keys in 10 locales and corrected Turkish YAML parsing issues. - Updated documentation to reflect changes in worker handling and upgrade steps from 2.0.0.
1 parent 5f4b145 commit df73ccc

File tree

3 files changed

+52
-10
lines changed

3 files changed

+52
-10
lines changed

docs/CHANGELOG.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121

2222
---
2323

24+
## [2.0.1] - 2026-02-16
25+
26+
### Added
27+
28+
- **Tests:** More coverage for PDF.js loader (`getWorkerUrl` absolute URL conversion, protocol-relative and empty-string handling, `querySelector` fallback when `currentScript` is null; `getPdfJsLib` CDN path). PHP test for default `pdfjs_worker_url` null in `SignatureCoordinatesType`. Extra `url-and-scale` tests (empty proxy, `getScaleForFitPage` with null container).
29+
30+
### Changed
31+
32+
- **PDF.js worker:** Default worker asset is now **`pdf.worker.min.js`** (was `pdf.worker.min.mjs`) so typical servers serve it with `Content-Type: application/javascript`, avoiding “Failed to fetch dynamically imported module” and “Setting up fake worker” in development. Theme and loader default to `bundles/nowopdfsignable/js/pdf.worker.min.js`. Vite build copies the worker from `node_modules/pdfjs-dist/build` to the output dir; `copy-worker` script and `postinstall` still output the same file for installs without a full build.
33+
- **Worker URL resolution:** Relative worker URLs are converted to absolute (using `window.location.origin`) so the worker loads correctly in SPAs and when the script is served from a different base. Fallback: when `document.currentScript` has no `src` (e.g. lazy-loaded script), the loader looks for a script tag with `src` containing `pdf-signable.js` or `acroform-editor.js` and derives the worker path from it.
34+
35+
### Fixed
36+
37+
- **Translations:** Added missing AcroForm editor modal keys to 10 locales (ca, cs, de, fr, it, nl, pl, pt, ru, tr): `acroform_editor.modal_create_if_missing`, `modal_field_name`, `modal_field_name_placeholder`, `modal_hidden`, `modal_max_len`, `modal_max_len_placeholder`. Ensures `make validate-translations` passes.
38+
- **Turkish (tr) YAML:** Fixed invalid escape in single-quoted strings (`PDF\'deki``"PDF'deki alan adı"`) so the file parses correctly.
39+
40+
### Documentation
41+
42+
- [USAGE](USAGE.md): Default worker asset and MIME-type note for “Setting up fake worker” / “Failed to fetch dynamically imported module”.
43+
44+
For upgrade steps from 2.0.0, see [UPGRADING](UPGRADING.md).
45+
46+
---
47+
2448
## [2.0.0] - 2026-02-16
2549

2650
### Breaking
@@ -326,7 +350,8 @@ First stable release.
326350

327351
---
328352

329-
[Unreleased]: https://github.com/nowo-tech/pdfSignableBundle/compare/v2.0.0...HEAD
353+
[Unreleased]: https://github.com/nowo-tech/pdfSignableBundle/compare/v2.0.1...HEAD
354+
[2.0.1]: https://github.com/nowo-tech/pdfSignableBundle/releases/tag/v2.0.1
330355
[2.0.0]: https://github.com/nowo-tech/pdfSignableBundle/releases/tag/v2.0.0
331356
[1.5.4]: https://github.com/nowo-tech/pdfSignableBundle/releases/tag/v1.5.4
332357
[1.5.3]: https://github.com/nowo-tech/pdfSignableBundle/releases/tag/v1.5.3

docs/RELEASE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@
3434

3535
---
3636

37-
## Ready for v2.0.0 (2026-02-16)
37+
## Ready for v2.0.1 (2026-02-16)
3838

39-
- [x] CHANGELOG: [2.0.0] with date; [Unreleased] at top; links updated.
40-
- [x] UPGRADING: “Upgrading to 2.0.0” with release date and upgrade steps; version table includes 2.0.x.
41-
- [x] RELEASE: this checklist for v2.0.0.
39+
- [x] CHANGELOG: [2.0.1] with date; [Unreleased] at top; links updated.
40+
- [x] UPGRADING: “Upgrading to 2.0.1" with release date and upgrade steps; version table updated.
41+
- [x] RELEASE: this checklist for v2.0.1.
4242
- [ ] Run `make test` and `make cs-check`.
43-
- [ ] Run `make assets` (bundle JS built).
43+
- [ ] Run `make assets` (bundle JS + worker built).
4444
- [ ] Run `make validate-translations`.
45-
- [ ] Commit and push: `git add -A && git commit -m "Prepare v2.0.0 release" && git push origin HEAD`
46-
- [ ] Create and push tag: `git tag -a v2.0.0 -m "Release v2.0.0"` then `git push origin v2.0.0`
45+
- [ ] Commit and push: `git add -A && git commit -m "Prepare v2.0.1 release" && git push origin HEAD`
46+
- [ ] Create and push tag: `git tag -a v2.0.1 -m "Release v2.0.1"` then `git push origin v2.0.1`
4747

4848
---
4949

50-
## Next release (e.g. v2.0.1)
50+
## Next release (e.g. v2.0.2)
5151

5252
- [ ] CHANGELOG: Move [Unreleased] entries into `[X.Y.Z]` with date; add new empty [Unreleased] at top; update version links at bottom.
5353
- [ ] UPGRADING: Add section "Upgrading to X.Y.Z" with release date, what's new, breaking changes (if any), and upgrade steps; update version compatibility table.

docs/UPGRADING.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,23 @@ For the full list of options in the new structure, see [CONFIGURATION.md](CONFIG
142142

143143
---
144144

145+
### Upgrading to 2.0.1 (2026-02-16)
146+
147+
**Release date:** 2026-02-16
148+
149+
**Patch release:** No breaking changes. Fixes translations (missing AcroForm modal keys in 10 locales, Turkish YAML), PDF.js worker loading (default worker is now `.js` for correct MIME type; absolute URL resolution and script fallback), and adds tests.
150+
151+
#### Upgrade steps (from 2.0.0)
152+
153+
1. Run `composer update nowo-tech/pdf-signable-bundle`.
154+
2. Rebuild assets if you use the bundle’s JS so the default worker `pdf.worker.min.js` is emitted: `pnpm run build` in the bundle repo, or `php bin/console assets:install` in your app to copy updated public files.
155+
3. Optional: run `make validate-translations` in the bundle repo.
156+
4. Clear cache: `php bin/console cache:clear`.
157+
158+
If you override `pdfjs_worker_url`, you can point it to `bundles/nowopdfsignable/js/pdf.worker.min.js` or leave it null for the theme default. See [CHANGELOG.md](CHANGELOG.md) for the full list of changes.
159+
160+
---
161+
145162
### Upgrading to 1.5.4
146163

147164
**Release date**: 2026-02-11
@@ -412,7 +429,7 @@ Always read [CHANGELOG.md](CHANGELOG.md) for the target version before upgrading
412429

413430
| Bundle version | Symfony | PHP | Notes |
414431
|----------------|-------------|-------|-------|
415-
| 2.0.x | 6.1+, 7.x, 8.x | 8.1+ | **Breaking:** Signature config under `signature` node (global + configs by alias). AcroForm config under single `acroform` node (was `acroform_editor` + `acroform_configs`). See upgrade steps above. |
432+
| 2.0.x | 6.1+, 7.x, 8.x | 8.1+ | **2.0.0 breaking:** Signature under `signature` node; AcroForm under single `acroform` node. **2.0.1:** PDF.js worker default `.js` (MIME fix), worker URL absolute/fallback, translations (AcroForm modal keys + tr YAML), tests. |
416433
| 1.5.x | 6.1+, 7.x, 8.x | 8.1+ | 1.5.0: guides and grid, viewer lazy load, advanced signing, single asset inclusion, larger handles, rotated box drag fix, 19 demos. 1.5.1: named config merge fix, demo symlink. 1.5.2: element lookup by data-pdf-signable (with class/name fallbacks), WORKFLOW.md, override form theme note, recipe complete example. 1.5.3: box-item class fallback (.signature-box-item), extended debug logging. 1.5.4: show_acroform option (default true), AcroForm outline overlay; recipe and demos set show_acroform: true in signature.configs / acroform.configs. |
417434
| 1.4.x | 6.1+, 7.x, 8.x | 8.1+ | Signing in boxes (draw/upload), consent, signedAt, auditMetadata, signing_only, signature pad, demo sidebar. 1.4.1: consent translations in all locales, test fix. |
418435
| 1.3.x | 6.1+, 7.x, 8.x | 8.1+ | PDF viewer zoom (in/out/fit), debug config, zoom translations. |

0 commit comments

Comments
 (0)