Skip to content

Expose a couple string utils - #28004

Merged
Joshua Smithrud (Josmithr) merged 6 commits into
microsoft:mainfrom
CraigMacomber:stringUtils
Aug 19, 2026
Merged

Expose a couple string utils#28004
Joshua Smithrud (Josmithr) merged 6 commits into
microsoft:mainfrom
CraigMacomber:stringUtils

Conversation

@CraigMacomber

@CraigMacomber Craig Macomber (Microsoft) (CraigMacomber) commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Description

These are somewhat questionable helper methods that we have some interest in using experimentally in some applications for now until we can think of a better approach (or decide they make sense and stabilize them more).

They are being exposed as alpha instead of internal to help with this.

Reviewer Guidance

The review process is outlined on this wiki page.

Copilot AI lite review requested due to automatic review settings August 18, 2026 18:28
@github-actions github-actions Bot added area: tools area: dds Issues related to distributed data structures area: contributor experience area: repo Repo related work area: website area: dds: tree base: main PRs targeted against main branch labels Aug 18, 2026
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (241 lines, 6 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Exposes existing Unicode string helper utilities from @fluidframework/tree by changing their TSDoc visibility to Alpha (@Alpha), and refactors validation/error behavior to use the shared validateIndex helper while expanding tests and adding benchmark coverage.

Changes:

  • Promote codePointCount and utf16LengthForCodePoints from @internal to @alpha, adding stability caveats in @privateRemarks.
  • Refactor utf16LengthForCodePoints argument validation to use validateIndex, aligning error messages and updating tests accordingly.
  • Add micro-benchmarks comparing the codePointAt approach with a reference implementation.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
packages/dds/tree/src/text/codePointUtils.ts Promote APIs to @alpha, add caveats, and refactor validation to validateIndex.
packages/dds/tree/src/test/text/codePointUtils.spec.ts Expand correctness tests to cover multiple implementations and add benchmark cases.
.vscode/settings.json Minor formatting cleanup and add misalign to cSpell dictionary.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/dds/tree/src/text/codePointUtils.ts
Comment thread packages/dds/tree/src/text/codePointUtils.ts
Comment thread packages/dds/tree/src/test/text/codePointUtils.spec.ts
Comment thread packages/dds/tree/src/text/codePointUtils.ts Outdated
@github-actions github-actions Bot added area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct public api change Changes to a public API labels Aug 18, 2026
Comment thread .vscode/settings.json
Comment thread packages/dds/tree/src/test/text/codePointUtils.spec.ts Outdated
Comment thread packages/dds/tree/src/test/text/codePointUtils.spec.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left a few suggestions. Overall looks good.

@github-actions

Copy link
Copy Markdown
Contributor

Bundle size comparison

Base commit: 4ef2d87f605f6d8947b691da4fbce3af6338f9b1
Head commit: 1ed310b117bb4b189d9fe2608c5313f4853e2a7f

Notable changes

No bundles changed by ≥ 500 bytes parsed.

Per-bundle deltas

@fluid-example/bundle-size-tests

  • fluidFrameworkAllAlpha.js: parsed 784481 → 784959 (+478), gzip 215047 → 215279 (+232)
  • azureClient.js: parsed 625038 → 625094 (+56), gzip 166669 → 166712 (+43)
  • odspClient.js: parsed 597494 → 597550 (+56), gzip 159859 → 159901 (+42)
  • aqueduct.js: parsed 531249 → 531284 (+35), gzip 142123 → 142151 (+28)
  • fluidFramework.js: parsed 403781 → 403802 (+21), gzip 114492 → 114508 (+16)
  • sharedTree.js: parsed 393185 → 393199 (+14), gzip 111934 → 111941 (+7)
  • containerRuntime.js: parsed 309170 → 309184 (+14), gzip 84577 → 84584 (+7)
  • sharedString.js: parsed 176536 → 176543 (+7), gzip 49804 → 49812 (+8)
  • experimentalSharedTree.js: parsed 160691 → 160691 (0), gzip 46272 → 46272 (0)
  • matrix.js: parsed 160367 → 160374 (+7), gzip 45805 → 45812 (+7)
  • loader.js: parsed 145725 → 145739 (+14), gzip 39292 → 39307 (+15)
  • odspDriver.js: parsed 104263 → 104284 (+21), gzip 32489 → 32496 (+7)
  • directory.js: parsed 67136 → 67143 (+7), gzip 18867 → 18874 (+7)
  • 578.js: parsed 58686 → 58686 (0), gzip 17657 → 17657 (0)
  • map.js: parsed 47231 → 47238 (+7), gzip 14462 → 14469 (+7)
  • odspPrefetchSnapshot.js: parsed 45751 → 45765 (+14), gzip 15260 → 15269 (+9)
  • 252.js: parsed 44362 → 44362 (0), gzip 13735 → 13735 (0)
  • summarizerDelayLoadedModule.js: parsed 30717 → 30717 (0), gzip 7716 → 7716 (0)
  • socketModule.js: parsed 26469 → 26476 (+7), gzip 7896 → 7903 (+7)
  • createNewModule.js: parsed 12474 → 12474 (0), gzip 4810 → 4810 (0)
  • summaryModule.js: parsed 3789 → 3789 (0), gzip 1857 → 1857 (0)
  • connectionState.js: parsed 909 → 909 (0), gzip 500 → 500 (0)
  • sharedTreeAttributes.js: parsed 847 → 854 (+7), gzip 499 → 508 (+9)
  • debugAssert.js: parsed 429 → 429 (0), gzip 299 → 299 (0)
  • FluidFramework-HashFallback.js: parsed 419 → 419 (0), gzip 313 → 313 (0)

@github-actions

Copy link
Copy Markdown
Contributor

🔗 Found some broken links! 💔

Run a link check locally to find them. See Checking for Broken Links for more information.

linkcheck output

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-website@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/
[ELIFECYCLE] Command failed with exit code 1.

@Josmithr
Joshua Smithrud (Josmithr) merged commit db77068 into microsoft:main Aug 19, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: contributor experience area: dds: tree area: dds Issues related to distributed data structures area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: repo Repo related work area: tools area: website base: main PRs targeted against main branch public api change Changes to a public API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants