Skip to content

[pull] main from Shopify:main - #210

Merged
pull[bot] merged 3 commits into
code:mainfrom
Shopify:main
Jul 23, 2026
Merged

[pull] main from Shopify:main#210
pull[bot] merged 3 commits into
code:mainfrom
Shopify:main

Conversation

@pull

@pull pull Bot commented Jul 23, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

* feat: typed JSI bindings infra + JsiVideo/JsiSkFont exemplars

Phase-2 wave 1 of the NativeObject migration: convert raw JSI_HOST_FUNCTION
method bodies to typed C++ signatures converted through rnwgpu::JSIConverter.

- Add cpp/api/JsiSkConverters.h: JSIConverter specializations for wrapped
  Skia pointer types (sk_sp<T>, std::shared_ptr<T>) keyed on a
  JsiSkWrapperFor<T> trait, delegating to each wrapper's fromValue so
  plain-object fallbacks keep working. Value converters for SkRect, SkPoint,
  SkMatrix (fromJSI only) and SkISize. All converters are partial
  specializations so bodies instantiate lazily and headers stay cycle-free.
- Add installChainableMethod to JsiSkNativeObject for methods returning this.
- Qualify fromValue lookup in NativeObject typed installers as
  NativeObject<Derived>::fromValue: RNSkia wrappers shadow fromValue with a
  public static returning the wrapped inner object.
- Convert JsiVideo (all methods typed) and JsiSkFont (typed except
  getMetrics, which keeps a conditionally-present bounds property) as the
  reference pattern.

* feat: typed bindings for simple factories

Wave 2: convert JsiSkColorFilterFactory, JsiSkMaskFilterFactory,
JsiSkPathEffectFactory, JsiSkTextBlobFactory, JsiSkTypefaceFactory,
JsiSkFontMgrFactory, JsiSkRuntimeEffectFactory and
JsiSkDataFactory::fromBase64 to typed signatures.

Converter additions: JsiColor strong typedef (SkColor is a uint32_t
typedef, so colors need their own argument type), SkRSXform value
converter, and JsiOptional<T> (omitted | undefined | null all treated as
absent, matching the hasOptionalArgument pattern of the raw bindings).
JsiSkFont::getGlyphIDs and MakeDash switch to JsiOptional accordingly.

Still raw (cannot be typed): JsiSkDataFactory::fromURI (returns a
promise built from the runtime), fromBytes (typed-array introspection),
JsiSkPictureFactory::MakePicture (heterogeneous argument dispatch).

* feat: typed bindings for image filter and shader factories

Wave 3: convert JsiSkImageFilterFactory and JsiSkShaderFactory to typed
signatures using JsiOptional for the pervasive optional
input-filter/crop-rect/local-matrix arguments, plus a SkPoint3 converter
for lighting filters.

This also fixes a latent dangling pointer in the gradient factories:
getLocalMatrix() returned the raw pointer of a temporary
std::shared_ptr<SkMatrix>, which dangled when the matrix came from the
plain-array fallback; the typed signatures keep the shared_ptr alive for
the whole call.

* feat: typed bindings for path, image and surface factories

Wave 4: convert JsiSkPathFactory (all methods except Stroke, whose
options object is read leniently property by property),
JsiSkPathBuilderFactory, JsiSkAnimatedImageFactory,
JsiSkTypefaceFontProviderFactory, and the typeable parts of
JsiSkImageFactory (MakeNull, MakeImageFromEncoded,
MakeImageFromNativeBuffer, MakeImage) and JsiSkSurfaceFactory (Make).

Still raw: image factory promise/texture methods (MakeImageFromViewTag,
MakeImageFromNativeTextureUnstable, MakeImageFromTexture,
MakeTextureFromImage), SurfaceFactory::MakeOffscreen (options object),
and JsiSkSVGFactory (lenient fontMgr/asset-map parsing).

* feat: typed bindings for small instance classes

Wave 5: convert JsiSkRect, JsiSkPoint and JsiSkRRect (typed getters via
installGetter, which keeps them enumerable so the generic toJSON keeps
working), JsiSkPicture::makeShader, JsiSkAnimatedImage,
JsiSkRuntimeShaderBuilder, JsiSkSVG, JsiSkFontMgr,
JsiSkTypefaceFontProvider, JsiSkContourMeasure, JsiSkContourMeasureIter
(next returns std::optional so the JS result stays undefined, not null),
JsiSkVertices and JsiSkTypeface.

Still raw: JsiSkPicture::serialize (constructs a Uint8Array).

* feat: typed bindings for JsiSkMatrix and JsiSkPaint

Wave 6: JsiSkMatrix converts to typed chainable methods via the new
installChainableMethod (the JS functions still return this); concat
keeps accepting both Matrix wrappers and plain 9/16-element arrays
through the shared_ptr<SkMatrix> converter. JsiSkPaint converts fully:
colors go through the JsiColor strong typedef, and the nullable
setShader/setColorFilter/setImageFilter/setMaskFilter/setPathEffect
arguments use JsiOptional (null | undefined clear the effect, as
before).
* feat: typed JSI bindings infra + JsiVideo/JsiSkFont exemplars

Phase-2 wave 1 of the NativeObject migration: convert raw JSI_HOST_FUNCTION
method bodies to typed C++ signatures converted through rnwgpu::JSIConverter.

- Add cpp/api/JsiSkConverters.h: JSIConverter specializations for wrapped
  Skia pointer types (sk_sp<T>, std::shared_ptr<T>) keyed on a
  JsiSkWrapperFor<T> trait, delegating to each wrapper's fromValue so
  plain-object fallbacks keep working. Value converters for SkRect, SkPoint,
  SkMatrix (fromJSI only) and SkISize. All converters are partial
  specializations so bodies instantiate lazily and headers stay cycle-free.
- Add installChainableMethod to JsiSkNativeObject for methods returning this.
- Qualify fromValue lookup in NativeObject typed installers as
  NativeObject<Derived>::fromValue: RNSkia wrappers shadow fromValue with a
  public static returning the wrapped inner object.
- Convert JsiVideo (all methods typed) and JsiSkFont (typed except
  getMetrics, which keeps a conditionally-present bounds property) as the
  reference pattern.

* feat: typed bindings for simple factories

Wave 2: convert JsiSkColorFilterFactory, JsiSkMaskFilterFactory,
JsiSkPathEffectFactory, JsiSkTextBlobFactory, JsiSkTypefaceFactory,
JsiSkFontMgrFactory, JsiSkRuntimeEffectFactory and
JsiSkDataFactory::fromBase64 to typed signatures.

Converter additions: JsiColor strong typedef (SkColor is a uint32_t
typedef, so colors need their own argument type), SkRSXform value
converter, and JsiOptional<T> (omitted | undefined | null all treated as
absent, matching the hasOptionalArgument pattern of the raw bindings).
JsiSkFont::getGlyphIDs and MakeDash switch to JsiOptional accordingly.

Still raw (cannot be typed): JsiSkDataFactory::fromURI (returns a
promise built from the runtime), fromBytes (typed-array introspection),
JsiSkPictureFactory::MakePicture (heterogeneous argument dispatch).

* feat: typed bindings for image filter and shader factories

Wave 3: convert JsiSkImageFilterFactory and JsiSkShaderFactory to typed
signatures using JsiOptional for the pervasive optional
input-filter/crop-rect/local-matrix arguments, plus a SkPoint3 converter
for lighting filters.

This also fixes a latent dangling pointer in the gradient factories:
getLocalMatrix() returned the raw pointer of a temporary
std::shared_ptr<SkMatrix>, which dangled when the matrix came from the
plain-array fallback; the typed signatures keep the shared_ptr alive for
the whole call.

* feat: typed bindings for path, image and surface factories

Wave 4: convert JsiSkPathFactory (all methods except Stroke, whose
options object is read leniently property by property),
JsiSkPathBuilderFactory, JsiSkAnimatedImageFactory,
JsiSkTypefaceFontProviderFactory, and the typeable parts of
JsiSkImageFactory (MakeNull, MakeImageFromEncoded,
MakeImageFromNativeBuffer, MakeImage) and JsiSkSurfaceFactory (Make).

Still raw: image factory promise/texture methods (MakeImageFromViewTag,
MakeImageFromNativeTextureUnstable, MakeImageFromTexture,
MakeTextureFromImage), SurfaceFactory::MakeOffscreen (options object),
and JsiSkSVGFactory (lenient fontMgr/asset-map parsing).

* feat: typed bindings for small instance classes

Wave 5: convert JsiSkRect, JsiSkPoint and JsiSkRRect (typed getters via
installGetter, which keeps them enumerable so the generic toJSON keeps
working), JsiSkPicture::makeShader, JsiSkAnimatedImage,
JsiSkRuntimeShaderBuilder, JsiSkSVG, JsiSkFontMgr,
JsiSkTypefaceFontProvider, JsiSkContourMeasure, JsiSkContourMeasureIter
(next returns std::optional so the JS result stays undefined, not null),
JsiSkVertices and JsiSkTypeface.

Still raw: JsiSkPicture::serialize (constructs a Uint8Array).

* feat: typed bindings for JsiSkMatrix and JsiSkPaint

Wave 6: JsiSkMatrix converts to typed chainable methods via the new
installChainableMethod (the JS functions still return this); concat
keeps accepting both Matrix wrappers and plain 9/16-element arrays
through the shared_ptr<SkMatrix> converter. JsiSkPaint converts fully:
colors go through the JsiColor strong typedef, and the nullable
setShader/setColorFilter/setImageFilter/setMaskFilter/setPathEffect
arguments use JsiOptional (null | undefined clear the effect, as
before).

* feat: typed bindings for image, surface, runtime effect and skottie

Convert the remaining instance classes to typed signatures:

- JsiSkImage: width/height, getImageInfo, makeShaderOptions/Cubic,
  makeNonTextureImage, isTextureBacked, encodeToBase64 (nullable string
  via a new variant<nullptr_t, string> converter). encodeImageData takes
  typed optional format/quality; encodeToBytes stays raw (Uint8Array)
  and builds the optionals itself; readPixels and
  getNativeTextureUnstable stay raw.
- JsiSkImageInfo and JsiSkRSXform: typed getters (and RSXform::set).
- JsiSkSurface: width/height, getCanvas, flush; makeImageSnapshot stays
  raw (may return the recycled image argument itself).
- JsiSkRuntimeEffect: fully typed; castUniforms now takes the converted
  vector, getUniform returns RuntimeEffectUniform via a dedicated
  toJSI-only converter.
- JsiSkSkottie: typed except the prop/slot getters that build
  heterogeneous objects (getSlotInfo, getColorSlot, getVec2Slot,
  getTextSlot, get*Props). The count-guard methods keep returning false
  on missing arguments via JsiOptional parameters. New SkSize toJSI
  converter preserves the fractional size() result.

JsiSkData has no methods and needs no change.

Behavior notes: error strings for wrong argument types change
(std::runtime_error instead of jsi::JSError), and encode quality now
throws on non-number values instead of silently using 100.
* feat: typed JSI bindings infra + JsiVideo/JsiSkFont exemplars

Phase-2 wave 1 of the NativeObject migration: convert raw JSI_HOST_FUNCTION
method bodies to typed C++ signatures converted through rnwgpu::JSIConverter.

- Add cpp/api/JsiSkConverters.h: JSIConverter specializations for wrapped
  Skia pointer types (sk_sp<T>, std::shared_ptr<T>) keyed on a
  JsiSkWrapperFor<T> trait, delegating to each wrapper's fromValue so
  plain-object fallbacks keep working. Value converters for SkRect, SkPoint,
  SkMatrix (fromJSI only) and SkISize. All converters are partial
  specializations so bodies instantiate lazily and headers stay cycle-free.
- Add installChainableMethod to JsiSkNativeObject for methods returning this.
- Qualify fromValue lookup in NativeObject typed installers as
  NativeObject<Derived>::fromValue: RNSkia wrappers shadow fromValue with a
  public static returning the wrapped inner object.
- Convert JsiVideo (all methods typed) and JsiSkFont (typed except
  getMetrics, which keeps a conditionally-present bounds property) as the
  reference pattern.

* feat: typed bindings for simple factories

Wave 2: convert JsiSkColorFilterFactory, JsiSkMaskFilterFactory,
JsiSkPathEffectFactory, JsiSkTextBlobFactory, JsiSkTypefaceFactory,
JsiSkFontMgrFactory, JsiSkRuntimeEffectFactory and
JsiSkDataFactory::fromBase64 to typed signatures.

Converter additions: JsiColor strong typedef (SkColor is a uint32_t
typedef, so colors need their own argument type), SkRSXform value
converter, and JsiOptional<T> (omitted | undefined | null all treated as
absent, matching the hasOptionalArgument pattern of the raw bindings).
JsiSkFont::getGlyphIDs and MakeDash switch to JsiOptional accordingly.

Still raw (cannot be typed): JsiSkDataFactory::fromURI (returns a
promise built from the runtime), fromBytes (typed-array introspection),
JsiSkPictureFactory::MakePicture (heterogeneous argument dispatch).

* feat: typed bindings for image filter and shader factories

Wave 3: convert JsiSkImageFilterFactory and JsiSkShaderFactory to typed
signatures using JsiOptional for the pervasive optional
input-filter/crop-rect/local-matrix arguments, plus a SkPoint3 converter
for lighting filters.

This also fixes a latent dangling pointer in the gradient factories:
getLocalMatrix() returned the raw pointer of a temporary
std::shared_ptr<SkMatrix>, which dangled when the matrix came from the
plain-array fallback; the typed signatures keep the shared_ptr alive for
the whole call.

* feat: typed bindings for path, image and surface factories

Wave 4: convert JsiSkPathFactory (all methods except Stroke, whose
options object is read leniently property by property),
JsiSkPathBuilderFactory, JsiSkAnimatedImageFactory,
JsiSkTypefaceFontProviderFactory, and the typeable parts of
JsiSkImageFactory (MakeNull, MakeImageFromEncoded,
MakeImageFromNativeBuffer, MakeImage) and JsiSkSurfaceFactory (Make).

Still raw: image factory promise/texture methods (MakeImageFromViewTag,
MakeImageFromNativeTextureUnstable, MakeImageFromTexture,
MakeTextureFromImage), SurfaceFactory::MakeOffscreen (options object),
and JsiSkSVGFactory (lenient fontMgr/asset-map parsing).

* feat: typed bindings for small instance classes

Wave 5: convert JsiSkRect, JsiSkPoint and JsiSkRRect (typed getters via
installGetter, which keeps them enumerable so the generic toJSON keeps
working), JsiSkPicture::makeShader, JsiSkAnimatedImage,
JsiSkRuntimeShaderBuilder, JsiSkSVG, JsiSkFontMgr,
JsiSkTypefaceFontProvider, JsiSkContourMeasure, JsiSkContourMeasureIter
(next returns std::optional so the JS result stays undefined, not null),
JsiSkVertices and JsiSkTypeface.

Still raw: JsiSkPicture::serialize (constructs a Uint8Array).

* feat: typed bindings for JsiSkMatrix and JsiSkPaint

Wave 6: JsiSkMatrix converts to typed chainable methods via the new
installChainableMethod (the JS functions still return this); concat
keeps accepting both Matrix wrappers and plain 9/16-element arrays
through the shared_ptr<SkMatrix> converter. JsiSkPaint converts fully:
colors go through the JsiColor strong typedef, and the nullable
setShader/setColorFilter/setImageFilter/setMaskFilter/setPathEffect
arguments use JsiOptional (null | undefined clear the effect, as
before).

* feat: typed bindings for image, surface, runtime effect and skottie

Convert the remaining instance classes to typed signatures:

- JsiSkImage: width/height, getImageInfo, makeShaderOptions/Cubic,
  makeNonTextureImage, isTextureBacked, encodeToBase64 (nullable string
  via a new variant<nullptr_t, string> converter). encodeImageData takes
  typed optional format/quality; encodeToBytes stays raw (Uint8Array)
  and builds the optionals itself; readPixels and
  getNativeTextureUnstable stay raw.
- JsiSkImageInfo and JsiSkRSXform: typed getters (and RSXform::set).
- JsiSkSurface: width/height, getCanvas, flush; makeImageSnapshot stays
  raw (may return the recycled image argument itself).
- JsiSkRuntimeEffect: fully typed; castUniforms now takes the converted
  vector, getUniform returns RuntimeEffectUniform via a dedicated
  toJSI-only converter.
- JsiSkSkottie: typed except the prop/slot getters that build
  heterogeneous objects (getSlotInfo, getColorSlot, getVec2Slot,
  getTextSlot, get*Props). The count-guard methods keep returning false
  on missing arguments via JsiOptional parameters. New SkSize toJSI
  converter preserves the fractional size() result.

JsiSkData has no methods and needs no change.

Behavior notes: error strings for wrong argument types change
(std::runtime_error instead of jsi::JSError), and encode quality now
throws on non-number values instead of silently using 100.

* feat: typed bindings for JsiSkPath and JsiSkPathBuilder

Convert the two chainable-heavy path classes:

- Add installChainableMethodWithRuntime for chainable methods that need
  the calling runtime; the deprecated JsiSkPath mutators use it so they
  keep logging their JS-console deprecation warning while returning
  this for chaining.
- JsiSkPathBuilder converts fully via installChainableMethod; every
  query and build method is typed.
- JsiSkPath converts fully except stroke(), whose options object is
  read leniently property by property.
- SkPoint gets its own converter with a toJSI producing a plain {x, y}
  object (what the raw getLastPt bindings returned, not a Point
  wrapper); toCmds returns its command list as vector<vector<double>>.

Note: Path.equals keeps the pre-existing quirk of comparing its two
arguments rather than this against one argument (the TS interface
declares equals(other), so the documented one-argument call was already
broken in the native binding before this change).
@pull pull Bot locked and limited conversation to collaborators Jul 23, 2026
@pull pull Bot added the ⤵️ pull label Jul 23, 2026
@pull
pull Bot merged commit e5dbd52 into code:main Jul 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant