Skip to content

⬆️ Updates canvas to v3 #2394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

⬆️ Updates canvas to v3 #2394

wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Dec 23, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
canvas 2.8.0 -> 3.1.0 age adoption passing confidence

Release Notes

Automattic/node-canvas (canvas)

v3.1.0

Compare Source

==================

  • Replaced simple-get with Node.js builtin fetch (#​2309)
  • ctx.font has a new C++ parser and is 2x-400x faster. Please file an issue if you experience different results, as caching has been removed.
  • The restriction of registering fonts before a canvas is created has been removed. You can now register a font as late as right before the fillText call (#​1921)
Added
  • Support for accessibility and links in PDFs
  • ctx.direction is implemented: 'rtl' or 'ltr' set the base direction of text
  • ctx.textAlign 'start' and 'end' are now 'right' and 'left' when ctx.direction === 'rtl'
Fixed
  • Fix a crash in getImageData when the rectangle is entirely outside the canvas. (#​2024)
  • Fix getImageData cropping the resulting ImageData when the given rectangle is partly outside the canvas. (#​1849)

v3.0.1

Compare Source

==================

Fixed
  • Fixed accidental depenency on ambient DOM types

v3.0.0

Compare Source

==================

This release notably changes to using N-API. 🎉

Breaking
  • Dropped support for Node.js 16.x and below.
Changed
  • Migrated to N-API (by way of node-addon-api) and removed libuv and v8 dependencies
  • Change from node-pre-gyp to prebuild-install
  • Defer the initialization of the op variable to the default switch case to avoid a compiler warning. (#​2229)
  • Use a default switch case with a null statement if some enum values aren't suppsed to be handled, this avoids a compiler warning. (#​2229)
  • Migrate from librsvg's deprecated rsvg_handle_get_dimensions() and rsvg_handle_render_cairo() functions to the new rsvg_handle_get_intrinsic_size_in_pixels() and rsvg_handle_render_document() respectively. (#​2229)
  • Avoid calling virtual methods in constructors/destructors to avoid bypassing virtual dispatch. (#​2229)
  • Remove unused private field backend in the Backend class. (#​2229)
  • Add Node.js v20 to CI. (#​2237)
  • Replaced dtslint with tsd (#​2313)
  • Changed PNG consts to static properties of Canvas class
  • Reverted improved font matching on Linux (#​1572) because it doesn't work if fonts are installed. If you experience degraded font selection, please file an issue and use v3.0.0-rc3 in the meantime.
Added
  • Added string tags to support class detection
  • Throw Cairo errors in canvas.toBuffer()
Fixed
  • Fix a case of use-after-free. (#​2229)
  • Fix usage of garbage value by filling the allocated memory entirely with zeros if it's not modified. (#​2229)
  • Fix a potential memory leak. (#​2229)
  • Fix the wrong type of setTransform
  • Fix the improper parsing of rgb functions issue. (#​2300)
  • Fix issue related to improper parsing of leading and trailing whitespaces in CSS color. (#​2301)
  • RGB functions should support real numbers now instead of just integers. (#​2339)
  • Allow alternate or properly escaped quotes within font-family names
  • Fix TextMetrics type to include alphabeticBaseline, emHeightAscent, and emHeightDescent properties
  • Fix class properties should have defaults as standard js classes (#​2390)
  • Fixed Exif orientation in JPEG files being ignored (#​1670)
  • Align DOMMatrix/DOMPoint to spec by adding missing methods

v2.11.2

Compare Source

==================

Fixed
  • Building on Windows in CI (and maybe other Windows configurations?) (#​2216)

v2.11.1

Compare Source

==================

Fixed
  • Add missing property canvas to the CanvasRenderingContext2D type
  • Fixed glyph positions getting rounded, resulting text having a slight letter-spacing effect
  • Fixed ctx.font not being restored correctly after ctx.restore() (#​1946)

v2.11.0

Compare Source

==================

Fixed
  • Replace triple-slash directive in types with own types to avoid polluting TS modules with globals (#​1656)

v2.10.2

Compare Source

==================

Fixed
  • Fix Assertion failed: (object->InternalFieldCount() > 0), function Unwrap, file nan_object_wrap.h, line 32. (#​2025)
  • textBaseline and textAlign were not saved/restored by save()/restore(). (#​1936)
  • Update nan to v2.17.0 to ensure Node.js v18+ support.
Changed
  • Improve performance and memory usage of save()/restore().
  • save()/restore() no longer have a maximum depth (previously 64 states).

v2.10.1

Compare Source

==================

Fixed
  • Fix actualBoundingBoxLeft and actualBoundingBoxRight when textAlign='center' or 'right' (#​1909)
  • Fix rgba(r,g,b,0) with alpha to 0 should parse as transparent, not opaque. (#​2110)

v2.10.0

Compare Source

==================

Added
Fixed
  • rgba(r,g,b) with no alpha should parse as opaque, not transparent. (#​2029)
  • Typo in PngConfig.filters types. (#​2072)
  • createPattern() always used "repeat" mode; now supports "repeat-x" and "repeat-y". (#​2066)
  • Crashes and hangs when using non-finite values in context.arc(). (#​2055)
  • Incorrect context.arc() geometry logic for full ellipses. (#​1808, (#​1736))
  • Added missing deregisterAllFonts to the Typescript declaration file (#​2096)
  • Add User-Agent header when requesting remote images (#​2099)

v2.9.3

Compare Source

==================

Fixed
  • Wrong fonts used when calling registerFont multiple times with the same family name (#​2041)

v2.9.2

Compare Source

==================

Fixed
  • All exports now work when Canvas is used in ES Modules (ESM). (#​2047)
  • npm rebuild will now re-fetch prebuilt binaries to avoid NODE_MODULE_VERSION mismatch errors. (#​1982)

v2.9.1

Compare Source

==================

Fixed
  • Stringify CanvasGradient, CanvasPattern and ImageData like browsers do. (#​1639, #​1646)
  • Add missing include for toupper.
  • Throw an error instead of crashing the process if getImageData or putImageData is called on a PDF or SVG canvas (#​1853)
  • Compatibility with Typescript 4.6
  • Near-perfect font matching on Linux (#​1572)
  • Fix multi-byte font path support on Windows.
  • Allow rebuild of this library

v2.9.0

Compare Source

==================

Changed
  • Refactor functions to classes.
  • Changed DOMPoint() constructor to check for parameter nullability.
  • Changed DOMMatrix.js to use string literals for non-special cases.
  • Remove semicolons from Dommatrix.js.
  • Update nan to v2.15.0 to ensure Node.js v14+ support.
  • Clean up inf/nan macros and slightly speed up argument checking.
Added
  • Added deregisterAllFonts method to free up memory and reduce font conflicts.
Fixed
  • Support Apple M1 Homebrew install that puts canvas install library files in /opt/homebrew/lib

Configuration

📅 Schedule: Branch creation - "after 10pm every weekday,before 5am every weekday,every weekend" in timezone Europe/Moscow, Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Copy link
Author

renovate bot commented Dec 23, 2024

Branch automerge failure

This PR was configured for branch automerge. However, this is not possible, so it has been raised as a PR instead.


  • Branch has one or more failed status checks

@auto-assign auto-assign bot requested a review from AlexRogalskiy December 23, 2024 22:46
Copy link

Thanks for opening an issue! Make sure you've followed CONTRIBUTING.md.

Copy link

Hello from PR Helper

Is your PR ready for review and processing? Mark the PR ready by including #pr-ready in a comment.

If you still have work to do, even after marking this ready. Put the PR on hold by including #pr-onhold in a comment.

Copy link

Thanks for the PR!

This section of the codebase is owner by https://github.com/AlexRogalskiy/ - if they write a comment saying "LGTM" then it will be merged.

Copy link

socket-security bot commented Dec 23, 2024

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] 🔁 npm/[email protected] Transitive: environment +3 856 kB calebhearon, domenic, kangax, ...5 more
npm/[email protected] filesystem Transitive: environment +4 452 kB pavelfeldman
npm/[email protected] filesystem, network +3 78.3 kB ljharb
npm/[email protected] None 0 63.3 kB ryanzim
npm/[email protected] None 0 129 kB chaabaj
npm/[email protected] None 0 8.1 kB stefanbuck
npm/[email protected] filesystem, network 0 269 kB sindresorhus
npm/[email protected] None +4 94.7 kB bokub
npm/[email protected] environment 0 8.88 MB jcfilben
npm/[email protected] filesystem +1 13.5 kB sindresorhus
npm/[email protected] filesystem 0 16 kB sindresorhus
npm/[email protected] None 0 18.3 kB dougwilson
npm/[email protected] None 0 74 kB evanhahn
npm/[email protected] None 0 19 kB domchristie
npm/[email protected] 🔁 npm/[email protected] None 0 4.87 kB sindresorhus
npm/[email protected] None 0 1.15 MB dcavanagh
npm/[email protected] None 0 35.7 kB ljharb
npm/[email protected] Transitive: network +1 165 kB developit
npm/[email protected] eval +7 2.6 MB simenb
npm/[email protected] None 0 4.74 kB simenb
npm/[email protected] None 0 978 kB bitwiseman
npm/[email protected] 🔁 npm/[email protected] Transitive: environment, filesystem +2 556 kB vitaly
npm/[email protected] None 0 12.8 kB rstacruz
npm/[email protected] eval, filesystem, network, shell, unsafe Transitive: environment +3 3 MB domenic
npm/[email protected] None 0 12 kB tgreyuk
npm/[email protected] None 0 18.3 kB coolaj86
npm/[email protected] filesystem 0 63.1 kB zaach
npm/[email protected] None +1 137 kB ziluvatar
npm/[email protected] filesystem Transitive: environment +3 584 kB brettz9
npm/[email protected] filesystem +5 235 kB davglass
npm/[email protected] 🔁 npm/[email protected] None 0 1.41 MB bnjmnt4n
npm/[email protected] environment +4 116 kB tcort
npm/[email protected] None 0 18.3 kB dougwilson
npm/[email protected] environment, filesystem 0 19.1 kB isaacs
npm/[email protected] environment 0 4.33 MB mweststrate
npm/[email protected] None 0 80.2 kB m03geek
npm/[email protected] None 0 59 kB addaleax
npm/[email protected] shell 0 6.21 kB domenic
npm/[email protected] filesystem +1 144 kB sindresorhus
npm/[email protected] None 0 5.41 kB sindresorhus
npm/[email protected] filesystem 0 5.41 kB sindresorhus
npm/[email protected] 🔁 npm/[email protected], npm/[email protected] None 0 11.2 MB prettier-bot
npm/[email protected] filesystem Transitive: environment, shell +4 220 kB jounqin
npm/[email protected] None 0 25.3 kB davidmerfield
npm/[email protected] None 0 9.35 kB wooorm
npm/[email protected] None 0 13 kB wooorm
npm/[email protected] None 0 9.47 kB wooorm
npm/[email protected] None 0 11.1 kB wooorm
npm/[email protected] Transitive: environment, filesystem, shell +8 294 kB davidtheclark
npm/[email protected] None 0 7.61 kB wooorm
npm/[email protected] filesystem, shell 0 30.1 kB wooorm
npm/[email protected] None 0 70.8 kB smelukov
npm/[email protected] None 0 27.1 kB matteo.collina
npm/[email protected] environment, network Transitive: filesystem, shell +12 581 kB semantic-release-bot
npm/[email protected] environment, filesystem 0 212 kB nfischer
npm/[email protected] None 0 20.9 kB simov
npm/[email protected] environment 0 3.02 MB probablyup
npm/[email protected] environment, filesystem, unsafe +1 356 kB kul
npm/[email protected] environment, filesystem, unsafe +2 3.13 MB blakeembrey
npm/[email protected] Transitive: environment, shell +7 348 kB agilgur5
npm/[email protected] 🔁 npm/[email protected] None 0 111 kB sindresorhus
npm/[email protected] environment, filesystem, network 0 154 kB wgasior
npm/[email protected] filesystem +1 2.9 MB tgreyuk
npm/[email protected] environment, filesystem, shell, unsafe +1 4.3 MB gerrit0
npm/[email protected] None 0 21 kB mleko
npm/[email protected] None 0 66.8 MB typescript-bot
npm/[email protected] filesystem 0 40.2 kB mhr3
npm/[email protected] None 0 26.1 kB ljharb
npm/[email protected] None 0 64.3 kB piotrwitek
npm/[email protected] None 0 116 kB ctavan
npm/[email protected] None 0 30.4 kB philbooth
npm/[email protected] filesystem 0 175 kB w-b-t
npm/[email protected] network 0 122 kB lpinca
npm/[email protected] None 0 41.4 kB nfarina
npm/[email protected] None 0 91 kB karfau
npm/[email protected] None 0 236 kB jlrishe
npm/[email protected] environment 0 448 kB eemeli
npm/[email protected] Transitive: environment, filesystem +2 845 kB jeremyfa
npm/[email protected] filesystem, network +6 434 kB hcodes

View full report↗︎

@renovate renovate bot force-pushed the renovate/canvas-3.x branch from 335ac5b to 72e39ce Compare December 31, 2024 22:13
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@renovate renovate bot force-pushed the renovate/canvas-3.x branch from 72e39ce to aca00e7 Compare January 22, 2025 06:46
Copy link

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Critical CVE npm/[email protected] ⚠︎

View full report↗︎

Next steps

What is a critical CVE?

Contains a Critical Common Vulnerability and Exposure (CVE).

Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants