Skip to content

[services] Implement dynamic JS/TS cron service detection#16333

Open
dnwpark wants to merge 4 commits into
mainfrom
dnwpark/js-cron-dynamic-pr3
Open

[services] Implement dynamic JS/TS cron service detection#16333
dnwpark wants to merge 4 commits into
mainfrom
dnwpark/js-cron-dynamic-pr3

Conversation

@dnwpark
Copy link
Copy Markdown
Contributor

@dnwpark dnwpark commented May 14, 2026

Followup to #16302 and #16310. Part of a breakdown of #16201.

Detects dynamic crons during the build step:

  • Stage the rolldown bundle in a temporary dir via stageBundleOnDisk
  • Import the bundled entrypoint
  • Call the default export
  • Validate the resulting {handler, schedule} entries
  • The handler field must name a valid function export

Note: this PR does not actually connect the detection to the build system yet.

@dnwpark dnwpark requested a review from a team as a code owner May 14, 2026 17:36
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 14, 2026

🦋 Changeset detected

Latest commit: 999fcdc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@vercel/backends Minor
@vercel/cervel Patch
vercel Patch
@vercel/express Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

🧪 Unit Test Strategy

Comparing: b1db109999fcdc (view diff)

Strategy: Affected packages only

✅ Only testing packages that have been modified or depend on modified packages.

Affected packages - 4 (9%)
  1. @vercel/backends
  2. @vercel/cervel
  3. @vercel/express
  4. vercel
Unaffected packages - 39 (91%)
  1. @vercel-internals/get-package-json
  2. @vercel/build-utils
  3. @vercel/cli-auth
  4. @vercel/cli-config
  5. @vercel/cli-exec
  6. @vercel/client
  7. @vercel/config
  8. @vercel/detect-agent
  9. @vercel/edge
  10. @vercel/elysia
  11. @vercel/error-utils
  12. @vercel/fastify
  13. @vercel/firewall
  14. @vercel/frameworks
  15. @vercel/fs-detectors
  16. @vercel/functions
  17. @vercel/gatsby-plugin-vercel-analytics
  18. @vercel/gatsby-plugin-vercel-builder
  19. @vercel/go
  20. @vercel/h3
  21. @vercel/hono
  22. @vercel/hydrogen
  23. @vercel/koa
  24. @vercel/nestjs
  25. @vercel/next
  26. @vercel/node
  27. @vercel/oidc
  28. @vercel/oidc-aws-credentials-provider
  29. @vercel/python
  30. @vercel/python-analysis
  31. @vercel/redwood
  32. @vercel/related-projects
  33. @vercel/remix-builder
  34. @vercel/routing-utils
  35. @vercel/ruby
  36. @vercel/rust
  37. @vercel/static-build
  38. @vercel/static-config
  39. examples

Results

  • Unit tests: Only affected packages will run unit tests
  • E2E tests: Running in parallel in this workflow
  • Type checks: Only affected packages will run type checks

This comment is automatically generated based on the affected testing strategy

@dnwpark dnwpark changed the title [services] Implement dynamic cron detection [services] Implement dynamic JS/TS cron service detection May 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

📦 CLI Tarball Ready

The Vercel CLI tarball for this PR is now available!

Quick Test

You can test this PR's CLI directly by running:

npx https://vercel-lmj8rgme0.vercel.sh/tarballs/vercel.tgz --help

Use in vercel.json

To use this CLI version in your project builds, add to your vercel.json:

{
  "build": {
    "env": {
      "VERCEL_CLI_VERSION": "vercel@https://vercel-lmj8rgme0.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

Python Runtime Wheel

A vercel-runtime wheel was also built for this PR.
To use in your Python project builds, also set this environment variable:

VERCEL_RUNTIME_PYTHON="vercel-runtime @ https://vercel-lmj8rgme0.vercel.sh/tarballs/vercel_runtime-0.14.0.dev1778799081+999fcdc-py3-none-any.whl"

Python Workers Wheel

A vercel-workers wheel was also built for this PR.
To use in your Python project builds, also set this environment variable:

VERCEL_WORKERS_PYTHON="vercel-workers @ https://vercel-lmj8rgme0.vercel.sh/tarballs/vercel_workers-0.1.0.dev1778799081+999fcdc-py3-none-any.whl"

This comment is automatically generated

dnwpark added 2 commits May 14, 2026 14:27
Materializes an in-memory Files map (typically rolldown's `write: false`
output) onto disk under workPath so the bundle can be `import()`ed.
Caller owns cleanup of the returned path.

Resequence-Id: g1-c1
Resequence-Id: g1-c2
@dnwpark dnwpark force-pushed the dnwpark/js-cron-dynamic-pr3 branch from d57f12d to 5de7299 Compare May 14, 2026 21:31
dnwpark added 2 commits May 14, 2026 15:51
Implements detectDynamicCrons: import the bundled entrypoint via
pathToFileURL, call its default export, validate the returned
{handler, schedule} entries (non-empty strings, allowed-chars handler,
no duplicates, handler must resolve to a function export), and return
BackendsCronEntry entries pointing at the dispatcher.

Resequence-Id: g2-c1
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