Skip to content

fix(ios): support V8 14 native bridge APIs - #147

Merged
triniwiz merged 1 commit into
NativeScript:masterfrom
LorenzGit:contrib/v8-14-compatibility
Sep 9, 2026
Merged

triniwiz merged 1 commit into
NativeScript:masterfrom
LorenzGit:contrib/v8-14-compatibility

Conversation

@LorenzGit

@LorenzGit LorenzGit commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Adapt the Apple Canvas bridge to V8 14.9 while retaining V8 10 compatibility: tagged pointers, receiver/accessor APIs, UTF-8 APIs and the removed fast typed-array interface. Use the existing ordinary callbacks where newer V8 no longer exposes that fast API.

Validation

All 59 Apple bridge translation units passed syntax checks against both V8 10 and V8 14 framework headers. The source-built V8 14.9 tvOS app passes Canvas pixel/Unicode metrics, WebGL typed-buffer/readback and WebGPU compute tests. The mapping-progress regression separately requires #148. JIT-enabled iOS fast-path performance has not been benchmarked.

Reproduce

Revision-pinned reviewer setup builds the companion stack in an isolated workspace. It includes commands, requirements, dependency pins and physical-device limitations. No binary artifacts or private development paths are committed.

This PR contains one commit, ed84b43758e24751f2bc60a9a9a888ed944a1776, changing 128 files against 1fd6ef470dfdfd43b3385fa7ef43feddd1debd06. Its exported patch reproduces the committed tree from a fresh base index.

The source-built runtime was validated in the prepared runtime checkout; companion clones, native helpers, Canvas and clean npm installation were validated in a separate workspace on the same Mac. A second machine and one uninterrupted cold all run have not been tested.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8bba1462-d1cc-4677-bb65-68130b80a328

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@LorenzGit
LorenzGit marked this pull request as ready for review September 8, 2026 18:44
@triniwiz
triniwiz merged commit 41423e5 into NativeScript:master Sep 9, 2026
1 check passed
triniwiz added a commit that referenced this pull request Sep 14, 2026
Brings in #144-#149. Conflict resolution notes:

* #147 (V8 14 native bridge) overlapped almost entirely with the V8 14
  migration this branch already carries. Both sides fix the same API break;
  master does it with dual-version shims (canvas::GetAlignedPointer,
  canvas::Receiver, CANVAS_FAST_FUNCTION, #if V8_MAJOR_VERSION >= 14) so one
  tree can build against V8 10.3 and 14, while this branch targets a single
  vendored V8 14.9 (tools/scripts/download-v8.sh) and calls the native APIs
  directly. 118 of the 127 conflicting sources were that difference alone --
  after rewriting master's shims into this branch's idiom, 112 compared
  byte-identical -- so those keep this branch's spelling and the now-unused
  shim block is dropped from Common.h.

* Master's shims also compile fast API calls out on V8 >= 14
  (CANVAS_FAST_FUNCTION -> v8::CFunction{}, c_function -> nullptr). V8 14.9
  still declares both FunctionTemplate::New(..., const CFunction*) and
  NewWithCFunctionOverloads, and this branch's fast paths are built against
  it, so taking that would have silently disabled every fast call in the
  binding layer. Helpers.h keeps this branch's version; the four
  CANVAS_FAST_FUNCTION call sites that auto-merged into
  OES_vertex_array_objectImpl and WEBGL_draw_buffersImpl -- no conflict was
  raised for those -- are restored to v8::CFunction::Make.

* Master's *Array fast overloads are all guarded #if V8_MAJOR_VERSION < 14,
  so they are dead on 14 and equivalent to this branch having removed them.

* #149 (ImageData double free) applies unchanged. canvas_native_image_data_get_data
  borrows its argument and returns a U8Buffer holding a second refcounted
  handle to the same pixels, so ImageDataBuffer must release only the buffer --
  ~ImageDataImpl already releases the ImageData. The comment is reworded from
  master's, which described the buffer as owning a clone of the pixel storage;
  it is a shared handle, and that is what makes the JS data view live.

* Package versions stay on the 3.0.0-alpha line.
* canvas-release.aar keeps this branch's binary; it predates the Android
  render fixes in 638a265 and needs rebuilding from the merged sources.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants