Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kimwoodfield
Copy link
Contributor

@kimwoodfield kimwoodfield commented Sep 1, 2025

Related Ticket: TINY-12682

Description of Changes:

  • Bump typescript to 5.9.3
  • Modified the chunk handling in Http.ts to explicitly convert each chunk to a new Uint8Array to ensure we are always ending up with an ArrayBuffer rather than SharedArrayBuffer and behaviour remains consistent.

Pre-checks:

  • Changelog entry added
  • Tests have been added (if applicable)
  • Branch prefixed with feature/, hotfix/ or spike/

Review:

  • Milestone set
  • Docs ticket created (if applicable)

GitHub issues (if applicable):

Summary by CodeRabbit

  • Bug Fixes

    • Improved blob/chunk handling during file downloads for more reliable binary assembly.
    • Enhanced compatibility with SharedArrayBuffer environments by converting shared buffers when required.
  • Dependencies

    • Updated dev tooling: ts-loader and TypeScript to newer stable releases for improved build and language support.

✏️ Tip: You can customize this high-level summary in your review settings.

@kimwoodfield kimwoodfield added this to the 8.2 milestone Sep 1, 2025
@kimwoodfield kimwoodfield added the dependencies Pull requests that update a dependency file label Sep 1, 2025
@kimwoodfield kimwoodfield requested a review from a team as a code owner September 1, 2025 01:23
@coderabbitai
Copy link

coderabbitai bot commented Sep 1, 2025

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'auto_resolve_threads'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

Adjusts HTTP download chunk handling to convert chunks to Uint8Array before Blob creation, converts SharedArrayBuffer slices to non-shared ArrayBuffer in the mock HTTP client, and updates two devDependencies (ts-loader, TypeScript).

Changes

Cohort / File(s) Summary
HTTP download chunk conversion
modules/jax/src/main/ts/ephox/jax/core/Http.ts
Added Arr import; in fetchDownload, map accumulated chunks to new Uint8Array(chunk) (stored in properChunks) and construct the Blob from those Uint8Array instances with the same MIME type.
Mock client buffer handling
modules/agar/src/main/ts/ephox/agar/http/MockClient.ts
Replaced direct buffer slicing with guarded logic: derive sliced from chunk.buffer, detect SharedArrayBuffer usage and, if present, copy into a non-shared ArrayBuffer via Uint8Array(sliced).slice().buffer; otherwise reuse sliced.
Dev dependency bumps
package.json
Bumped devDependencies: ts-loader ^9.5.2 → ^9.5.4 and typescript ^5.7.3 → ^5.9.3.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Inspect fetchDownload conversion to ensure all chunk shapes (ArrayBuffer, TypedArray, etc.) are handled correctly.
  • Verify SharedArrayBuffer detection and the copy-to-non-shared-ArrayBuffer path in MockClient.ts preserves byte contents and performance considerations.
  • Run build/tests with updated TypeScript and ts-loader to confirm no toolchain regressions.

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'TINY-12682: Upgrade TypeScript to 5.9.3' accurately reflects the primary change in the pull request - upgrading TypeScript from 5.7.3 to 5.9.3, which is the main objective documented in the PR description.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 6f59f70 and 07e5e21.

📒 Files selected for processing (1)
  • modules/agar/src/main/ts/ephox/agar/http/MockClient.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • modules/agar/src/main/ts/ephox/agar/http/MockClient.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript)

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
modules/jax/src/main/ts/ephox/jax/core/Http.ts (1)

168-170: Avoid full-buffer copy on completion; type the chunk array as BlobPart[] instead

Copying each chunk doubles memory/time for large downloads. Prefer a typing fix so Blob accepts the parts without runtime copies.

Apply this minimal change:

@@
-    const chunks: Array<Uint8Array> = [];
+    const chunks: BlobPart[] = [];
@@
-        if (result.done) {
-          // TINY-12744: We can potentially remove this once when we upgrade to "target": "es2022"
-          const properChunks = chunks.map((chunk) => new Uint8Array(chunk));
-          resolve(Result.value(new Blob(properChunks, { type: mime.getOr('') })));
+        if (result.done) {
+          // TINY-12744: Temporary until we can rely on newer lib.dom types / "target": "es2022"
+          resolve(Result.value(new Blob(chunks, { type: mime.getOr('') })));

If TS still complains pre-#10546, use a localized cast instead of copying:

resolve(Result.value(new Blob(chunks as BlobPart[], { type: mime.getOr('') })));

Also consider adding a TODO referencing PR #10546 alongside TINY-12744 to make removal criteria explicit.

modules/oxide-components/eslint.config.ts (1)

34-47: Targeted rule override is reasonable; add removal guard

Disabling @stylistic/indent only for TSX and enforcing 2-space for TS is a pragmatic workaround for TS 5.9. Keep a TODO with the upstream issue and revisit once fixed.

Optional: add a dated TODO so it’s easy to prune later:

-// TINY-12801: Temporary workaround until issue with @stylistic/indent rule introduced in TypeScript 5.9.2 is resolved.
-// See https://github.com/microsoft/TypeScript/issues/62188
+// TINY-12801: Temporary workaround for @stylistic/indent + TS 5.9.2 (2025-09-01).
+// Upstream: https://github.com/microsoft/TypeScript/issues/62188 — remove when resolved and propagated.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between bd5cbe1 and 9ae4edd.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • modules/jax/src/main/ts/ephox/jax/core/Http.ts (1 hunks)
  • modules/oxide-components/eslint.config.ts (1 hunks)
  • package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
modules/oxide-components/eslint.config.ts (1)

34-41: Scoped TSX-only disable looks good and matches the linked TS 5.9 regression.

Good temporary workaround with clear references (TINY-12801, TS#62188). This leaves .ts unaffected, which answers the earlier question about broader scope.

🧹 Nitpick comments (1)
modules/oxide-components/eslint.config.ts (1)

37-41: Nit: align quotes with local style.

Use single quotes for consistency with the rest of this file.

-      files: ["**/*.tsx"],
+      files: [ '**/*.tsx' ],
-        "@stylistic/indent": "off"
+        '@stylistic/indent': 'off'
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 9ae4edd and 8819e7e.

📒 Files selected for processing (1)
  • modules/oxide-components/eslint.config.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript)

@jscasca jscasca modified the milestones: 8.2, 8.3.0 Oct 23, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between f060e74 and 567a9a4.

📒 Files selected for processing (3)
  • modules/agar/src/main/ts/ephox/agar/http/MockClient.ts (1 hunks)
  • modules/jax/src/main/ts/ephox/jax/core/Http.ts (2 hunks)
  • modules/oxide-components/eslint.config.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • modules/oxide-components/eslint.config.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
modules/jax/src/main/ts/ephox/jax/core/Http.ts (1)

1-1: LGTM: Import addition for Arr utility.

The Arr import is appropriately added to support the functional array mapping introduced in the chunk handling logic.

@kimwoodfield kimwoodfield marked this pull request as draft December 1, 2025 01:58
@kimwoodfield kimwoodfield changed the title TINY-12682: Upgrade TypeScript to 5.9.2 TINY-12682: Upgrade TypeScript to 5.9.3 Dec 1, 2025
@kimwoodfield kimwoodfield marked this pull request as ready for review December 2, 2025 02:34
@kimwoodfield kimwoodfield merged commit dc4a2fd into main Dec 4, 2025
6 checks passed
@kimwoodfield kimwoodfield deleted the feature/TINY-12682 branch December 4, 2025 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants