Skip to content

feat(function): add local data conversion APIs - #7727

Open
waleedlatif1 wants to merge 2 commits into
stagingfrom
codex/function-data-globals
Open

feat(function): add local data conversion APIs#7727
waleedlatif1 wants to merge 2 commits into
stagingfrom
codex/function-data-globals

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Add isolate-local Buffer, base64, and text encoding APIs without changing runtime routing or limits.
  • Include worker packaging, documentation, and regression coverage.

Type of Change

  • Feature

Testing

1,093 runtime tests passed; type-check, lint, and all 46 audits passed.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@waleedlatif1
waleedlatif1 requested a review from a team as a code owner September 10, 2026 09:32
@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 10, 2026 9:55am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable new issues or outstanding previous findings remain.

Summary

  • Provides Buffer, atob, btoa, TextEncoder, and TextDecoder through a generated isolate-safe bundle.
  • Packages and initializes the bundle in the isolated worker while preserving execution isolation, timeout enforcement, and memory accounting.
  • Adds bundle-level and real-worker regression coverage.
  • Updates Function block guidance and user documentation.
  • Changes generated bundle banners to TSDoc, fully addressing the remaining previous review finding.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Function block JavaScript] --> B{Imports, mounted files,<br/>or selected sandbox?}
    B -->|Yes| C[Remote sandbox]
    B -->|No| D[Fresh local V8 isolate]
    D --> E[Load Function globals bundle]
    E --> F[Buffer]
    E --> G[atob / btoa]
    E --> H[TextEncoder / TextDecoder]
    F --> I[Execute user code]
    G --> I
    H --> I
Loading

Reviews (3) · Last reviewed commit: "chore(function): use TSDoc for generated..."

Comment thread apps/sim/lib/execution/isolated-vm-worker.cjs
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

Comment thread apps/sim/lib/execution/sandbox/bundles/function-globals.cjs Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

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.

1 participant