Skip to content

[next] Allow implicit react imports - #504

Closed
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-next-config-loader
Closed

[next] Allow implicit react imports#504
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-next-config-loader

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Dec 2, 2025

Copy link
Copy Markdown
Member

This is a potential fix for #212, where workflow/step bundling throws ReferenceError: React is not defined if react imports aren't explicitly defined, even though the TSConfig handles the implicit import fine.

Not sure if this makes sense or not.

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c4c6d3

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

This PR includes changesets to release 4 packages
NameType
@workflow/nextPatch
workflowPatch
@workflow/aiPatch
@workflow/world-testingPatch

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

@vercel

vercelBot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.041s (-2.6%)1.015s (~)0.974s1.00x
💻 LocalNitro0.043s (+0.9%)1.007s (~)0.964s1.05x
💻 LocalExpress0.043s (-3.1%)1.007s (~)0.964s1.05x
🐘 PostgresNitro0.341s (+16.3% 🔺)1.012s (~)0.671s8.29x
🐘 PostgresNext.js (Turbopack)0.381s (+134.5% 🔺)1.022s (~)0.641s9.27x
▲ VercelExpress0.444s (-16.3% 🟢)1.435s (+2.1%)0.991s10.80x
🐘 PostgresExpress0.480s (+167.7% 🔺)1.048s (+3.4%)0.568s11.68x
▲ VercelNitro0.491s (-4.8%)1.438s (+2.0%)0.947s11.95x
▲ VercelNext.js (Turbopack)0.531s (+5.1% 🔺)1.442s (-2.3%)0.911s12.93x

workflow with 1 step

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.102s (-1.0%)1.011s (~)0.909s1.00x
💻 LocalExpress0.110s (-1.8%)1.006s (~)0.895s1.09x
💻 LocalNitro0.111s (~)1.006s (~)0.895s1.09x
🐘 PostgresNext.js (Turbopack)0.744s (-19.4% 🟢)1.014s (~)0.270s7.32x
🐘 PostgresNitro1.219s (+16.5% 🔺)2.012s (+10.9% 🔺)0.792s11.99x
🐘 PostgresExpress1.390s (+11.1% 🔺)2.012s (~)0.621s13.67x
▲ VercelNext.js (Turbopack)1.452s (-4.5%)2.384s (-5.2% 🟢)0.932s14.27x
▲ VercelNitro1.519s (+7.3% 🔺)2.332s (-3.1%)0.813s14.94x
▲ VercelExpress1.532s (+2.5%)2.435s (-5.1% 🟢)0.904s15.06x

workflow with 10 sequential steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.644s (+1.1%)1.010s (~)0.366s1.00x
💻 LocalExpress0.763s (-2.5%)1.006s (~)0.243s1.18x
💻 LocalNitro0.782s (~)1.005s (~)0.223s1.21x
🐘 PostgresNext.js (Turbopack)5.220s (-1.5%)6.024s (~)0.804s8.10x
🐘 PostgresNitro10.199s (+87.3% 🔺)11.025s (+83.1% 🔺)0.826s15.83x
🐘 PostgresExpress10.261s (+43.8% 🔺)11.022s (+44.7% 🔺)0.761s15.93x
▲ VercelNext.js (Turbopack)10.263s (-2.2%)10.842s (-4.4%)0.579s15.93x
▲ VercelNitro10.507s (-3.1%)11.194s (-2.4%)0.687s16.31x
▲ VercelExpress10.623s (+1.9%)11.472s (+4.5%)0.849s16.49x

workflow with 10 parallel steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Nitro0.396s (-6.4% 🟢)1.006s (~)0.610s1.00x
💻 LocalNext.js (Turbopack)0.401s (-6.9% 🟢)1.010s (~)0.608s1.01x
💻 LocalExpress0.403s (+1.8%)1.005s (~)0.602s1.02x
🐘 PostgresNext.js (Turbopack)1.184s (+29.6% 🔺)1.851s (+82.5% 🔺)0.666s2.99x
🐘 PostgresExpress1.376s (-11.6% 🟢)2.010s (~)0.635s3.47x
🐘 PostgresNitro1.712s (+4.5%)2.012s (~)0.299s4.32x
▲ VercelNext.js (Turbopack)2.538s (-3.0%)3.435s (-4.0%)0.897s6.40x
▲ VercelNitro2.580s (-7.6% 🟢)3.497s (-1.3%)0.917s6.51x
▲ VercelExpress2.868s (+6.2% 🔺)3.453s (~)0.585s7.24x

Stream Benchmarks

Stream benchmarks include Time to First Byte (TTFB) metrics.

workflow with stream

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.174s (+18.1% 🔺)1.003s (~)1.015s (~)0.841s1.00x
💻 LocalExpress0.176s (+0.6%)0.992s (~)1.008s (~)0.833s1.01x
💻 LocalNitro0.178s (-0.5%)0.992s (~)1.008s (~)0.830s1.02x
🐘 PostgresExpress0.948s (-25.6% 🟢)1.659s (-7.1% 🟢)1.711s (-14.9% 🟢)0.762s5.45x
🐘 PostgresNext.js (Turbopack)1.200s (+15.3% 🔺)1.847s (+10.2% 🔺)2.015s (+17.3% 🔺)0.815s6.89x
🐘 PostgresNitro1.439s (+8.5% 🔺)1.654s (-3.5%)2.011s (~)0.572s8.26x
▲ VercelNext.js (Turbopack)2.350s (-7.0% 🟢)2.777s (-6.4% 🟢)3.134s (-7.4% 🟢)0.784s13.50x
▲ VercelExpress2.472s (-6.1% 🟢)2.948s (-4.2%)3.337s (-4.5%)0.864s14.20x
▲ VercelNitro2.533s (-3.9%)3.113s (+1.8%)3.499s (+2.2%)0.967s14.55x

Summary: Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)4/5
🐘 PostgresNext.js (Turbopack)3/5
▲ VercelNext.js (Turbopack)4/5

Summary: Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local5/5
Next.js (Turbopack)💻 Local5/5
Nitro💻 Local5/5
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world
  • 🐘 Postgres: PostgreSQL database world
  • ▲ Vercel: Vercel production world

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

e2e test would be nice

target: 'es2022',
transform: {
react: {
runtime: 'automatic',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally we don't actually transform JSX at all so that the upstream tool can consume how it needs to e.g. Next.js might process one way but then vite expects to process a different way. Let me see if I can get that to work

@VaguelySerious

Copy link
Copy Markdown
MemberAuthor

Closing in favor of #507

Sign up for freeto 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.

3 participants

@VaguelySerious@TooTallNate@ijjk
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
[next] Allow implicit react imports by VaguelySerious · Pull Request #504 · vercel/workflow · GitHub
Skip to content

[next] Allow implicit react imports - #504

Closed
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-next-config-loader
Closed

[next] Allow implicit react imports#504
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-next-config-loader

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Dec 2, 2025

Copy link
Copy Markdown
Member

This is a potential fix for #212, where workflow/step bundling throws ReferenceError: React is not defined if react imports aren't explicitly defined, even though the TSConfig handles the implicit import fine.

Not sure if this makes sense or not.

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c4c6d3

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

This PR includes changesets to release 4 packages
NameType
@workflow/nextPatch
workflowPatch
@workflow/aiPatch
@workflow/world-testingPatch

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

@vercel

vercelBot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.041s (-2.6%)1.015s (~)0.974s1.00x
💻 LocalNitro0.043s (+0.9%)1.007s (~)0.964s1.05x
💻 LocalExpress0.043s (-3.1%)1.007s (~)0.964s1.05x
🐘 PostgresNitro0.341s (+16.3% 🔺)1.012s (~)0.671s8.29x
🐘 PostgresNext.js (Turbopack)0.381s (+134.5% 🔺)1.022s (~)0.641s9.27x
▲ VercelExpress0.444s (-16.3% 🟢)1.435s (+2.1%)0.991s10.80x
🐘 PostgresExpress0.480s (+167.7% 🔺)1.048s (+3.4%)0.568s11.68x
▲ VercelNitro0.491s (-4.8%)1.438s (+2.0%)0.947s11.95x
▲ VercelNext.js (Turbopack)0.531s (+5.1% 🔺)1.442s (-2.3%)0.911s12.93x

workflow with 1 step

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.102s (-1.0%)1.011s (~)0.909s1.00x
💻 LocalExpress0.110s (-1.8%)1.006s (~)0.895s1.09x
💻 LocalNitro0.111s (~)1.006s (~)0.895s1.09x
🐘 PostgresNext.js (Turbopack)0.744s (-19.4% 🟢)1.014s (~)0.270s7.32x
🐘 PostgresNitro1.219s (+16.5% 🔺)2.012s (+10.9% 🔺)0.792s11.99x
🐘 PostgresExpress1.390s (+11.1% 🔺)2.012s (~)0.621s13.67x
▲ VercelNext.js (Turbopack)1.452s (-4.5%)2.384s (-5.2% 🟢)0.932s14.27x
▲ VercelNitro1.519s (+7.3% 🔺)2.332s (-3.1%)0.813s14.94x
▲ VercelExpress1.532s (+2.5%)2.435s (-5.1% 🟢)0.904s15.06x

workflow with 10 sequential steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.644s (+1.1%)1.010s (~)0.366s1.00x
💻 LocalExpress0.763s (-2.5%)1.006s (~)0.243s1.18x
💻 LocalNitro0.782s (~)1.005s (~)0.223s1.21x
🐘 PostgresNext.js (Turbopack)5.220s (-1.5%)6.024s (~)0.804s8.10x
🐘 PostgresNitro10.199s (+87.3% 🔺)11.025s (+83.1% 🔺)0.826s15.83x
🐘 PostgresExpress10.261s (+43.8% 🔺)11.022s (+44.7% 🔺)0.761s15.93x
▲ VercelNext.js (Turbopack)10.263s (-2.2%)10.842s (-4.4%)0.579s15.93x
▲ VercelNitro10.507s (-3.1%)11.194s (-2.4%)0.687s16.31x
▲ VercelExpress10.623s (+1.9%)11.472s (+4.5%)0.849s16.49x

workflow with 10 parallel steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Nitro0.396s (-6.4% 🟢)1.006s (~)0.610s1.00x
💻 LocalNext.js (Turbopack)0.401s (-6.9% 🟢)1.010s (~)0.608s1.01x
💻 LocalExpress0.403s (+1.8%)1.005s (~)0.602s1.02x
🐘 PostgresNext.js (Turbopack)1.184s (+29.6% 🔺)1.851s (+82.5% 🔺)0.666s2.99x
🐘 PostgresExpress1.376s (-11.6% 🟢)2.010s (~)0.635s3.47x
🐘 PostgresNitro1.712s (+4.5%)2.012s (~)0.299s4.32x
▲ VercelNext.js (Turbopack)2.538s (-3.0%)3.435s (-4.0%)0.897s6.40x
▲ VercelNitro2.580s (-7.6% 🟢)3.497s (-1.3%)0.917s6.51x
▲ VercelExpress2.868s (+6.2% 🔺)3.453s (~)0.585s7.24x

Stream Benchmarks

Stream benchmarks include Time to First Byte (TTFB) metrics.

workflow with stream

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.174s (+18.1% 🔺)1.003s (~)1.015s (~)0.841s1.00x
💻 LocalExpress0.176s (+0.6%)0.992s (~)1.008s (~)0.833s1.01x
💻 LocalNitro0.178s (-0.5%)0.992s (~)1.008s (~)0.830s1.02x
🐘 PostgresExpress0.948s (-25.6% 🟢)1.659s (-7.1% 🟢)1.711s (-14.9% 🟢)0.762s5.45x
🐘 PostgresNext.js (Turbopack)1.200s (+15.3% 🔺)1.847s (+10.2% 🔺)2.015s (+17.3% 🔺)0.815s6.89x
🐘 PostgresNitro1.439s (+8.5% 🔺)1.654s (-3.5%)2.011s (~)0.572s8.26x
▲ VercelNext.js (Turbopack)2.350s (-7.0% 🟢)2.777s (-6.4% 🟢)3.134s (-7.4% 🟢)0.784s13.50x
▲ VercelExpress2.472s (-6.1% 🟢)2.948s (-4.2%)3.337s (-4.5%)0.864s14.20x
▲ VercelNitro2.533s (-3.9%)3.113s (+1.8%)3.499s (+2.2%)0.967s14.55x

Summary: Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)4/5
🐘 PostgresNext.js (Turbopack)3/5
▲ VercelNext.js (Turbopack)4/5

Summary: Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local5/5
Next.js (Turbopack)💻 Local5/5
Nitro💻 Local5/5
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world
  • 🐘 Postgres: PostgreSQL database world
  • ▲ Vercel: Vercel production world

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

e2e test would be nice

target: 'es2022',
transform: {
react: {
runtime: 'automatic',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally we don't actually transform JSX at all so that the upstream tool can consume how it needs to e.g. Next.js might process one way but then vite expects to process a different way. Let me see if I can get that to work

@VaguelySerious

Copy link
Copy Markdown
MemberAuthor

Closing in favor of #507

Sign up for freeto 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.

3 participants

@VaguelySerious@TooTallNate@ijjk
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' [next] Allow implicit react imports by VaguelySerious · Pull Request #504 · vercel/workflow · GitHub
Skip to content

[next] Allow implicit react imports - #504

Closed
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-next-config-loader
Closed

[next] Allow implicit react imports#504
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-next-config-loader

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Dec 2, 2025

Copy link
Copy Markdown
Member

This is a potential fix for #212, where workflow/step bundling throws ReferenceError: React is not defined if react imports aren't explicitly defined, even though the TSConfig handles the implicit import fine.

Not sure if this makes sense or not.

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c4c6d3

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

This PR includes changesets to release 4 packages
NameType
@workflow/nextPatch
workflowPatch
@workflow/aiPatch
@workflow/world-testingPatch

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

@vercel

vercelBot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.041s (-2.6%)1.015s (~)0.974s1.00x
💻 LocalNitro0.043s (+0.9%)1.007s (~)0.964s1.05x
💻 LocalExpress0.043s (-3.1%)1.007s (~)0.964s1.05x
🐘 PostgresNitro0.341s (+16.3% 🔺)1.012s (~)0.671s8.29x
🐘 PostgresNext.js (Turbopack)0.381s (+134.5% 🔺)1.022s (~)0.641s9.27x
▲ VercelExpress0.444s (-16.3% 🟢)1.435s (+2.1%)0.991s10.80x
🐘 PostgresExpress0.480s (+167.7% 🔺)1.048s (+3.4%)0.568s11.68x
▲ VercelNitro0.491s (-4.8%)1.438s (+2.0%)0.947s11.95x
▲ VercelNext.js (Turbopack)0.531s (+5.1% 🔺)1.442s (-2.3%)0.911s12.93x

workflow with 1 step

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.102s (-1.0%)1.011s (~)0.909s1.00x
💻 LocalExpress0.110s (-1.8%)1.006s (~)0.895s1.09x
💻 LocalNitro0.111s (~)1.006s (~)0.895s1.09x
🐘 PostgresNext.js (Turbopack)0.744s (-19.4% 🟢)1.014s (~)0.270s7.32x
🐘 PostgresNitro1.219s (+16.5% 🔺)2.012s (+10.9% 🔺)0.792s11.99x
🐘 PostgresExpress1.390s (+11.1% 🔺)2.012s (~)0.621s13.67x
▲ VercelNext.js (Turbopack)1.452s (-4.5%)2.384s (-5.2% 🟢)0.932s14.27x
▲ VercelNitro1.519s (+7.3% 🔺)2.332s (-3.1%)0.813s14.94x
▲ VercelExpress1.532s (+2.5%)2.435s (-5.1% 🟢)0.904s15.06x

workflow with 10 sequential steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.644s (+1.1%)1.010s (~)0.366s1.00x
💻 LocalExpress0.763s (-2.5%)1.006s (~)0.243s1.18x
💻 LocalNitro0.782s (~)1.005s (~)0.223s1.21x
🐘 PostgresNext.js (Turbopack)5.220s (-1.5%)6.024s (~)0.804s8.10x
🐘 PostgresNitro10.199s (+87.3% 🔺)11.025s (+83.1% 🔺)0.826s15.83x
🐘 PostgresExpress10.261s (+43.8% 🔺)11.022s (+44.7% 🔺)0.761s15.93x
▲ VercelNext.js (Turbopack)10.263s (-2.2%)10.842s (-4.4%)0.579s15.93x
▲ VercelNitro10.507s (-3.1%)11.194s (-2.4%)0.687s16.31x
▲ VercelExpress10.623s (+1.9%)11.472s (+4.5%)0.849s16.49x

workflow with 10 parallel steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Nitro0.396s (-6.4% 🟢)1.006s (~)0.610s1.00x
💻 LocalNext.js (Turbopack)0.401s (-6.9% 🟢)1.010s (~)0.608s1.01x
💻 LocalExpress0.403s (+1.8%)1.005s (~)0.602s1.02x
🐘 PostgresNext.js (Turbopack)1.184s (+29.6% 🔺)1.851s (+82.5% 🔺)0.666s2.99x
🐘 PostgresExpress1.376s (-11.6% 🟢)2.010s (~)0.635s3.47x
🐘 PostgresNitro1.712s (+4.5%)2.012s (~)0.299s4.32x
▲ VercelNext.js (Turbopack)2.538s (-3.0%)3.435s (-4.0%)0.897s6.40x
▲ VercelNitro2.580s (-7.6% 🟢)3.497s (-1.3%)0.917s6.51x
▲ VercelExpress2.868s (+6.2% 🔺)3.453s (~)0.585s7.24x

Stream Benchmarks

Stream benchmarks include Time to First Byte (TTFB) metrics.

workflow with stream

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.174s (+18.1% 🔺)1.003s (~)1.015s (~)0.841s1.00x
💻 LocalExpress0.176s (+0.6%)0.992s (~)1.008s (~)0.833s1.01x
💻 LocalNitro0.178s (-0.5%)0.992s (~)1.008s (~)0.830s1.02x
🐘 PostgresExpress0.948s (-25.6% 🟢)1.659s (-7.1% 🟢)1.711s (-14.9% 🟢)0.762s5.45x
🐘 PostgresNext.js (Turbopack)1.200s (+15.3% 🔺)1.847s (+10.2% 🔺)2.015s (+17.3% 🔺)0.815s6.89x
🐘 PostgresNitro1.439s (+8.5% 🔺)1.654s (-3.5%)2.011s (~)0.572s8.26x
▲ VercelNext.js (Turbopack)2.350s (-7.0% 🟢)2.777s (-6.4% 🟢)3.134s (-7.4% 🟢)0.784s13.50x
▲ VercelExpress2.472s (-6.1% 🟢)2.948s (-4.2%)3.337s (-4.5%)0.864s14.20x
▲ VercelNitro2.533s (-3.9%)3.113s (+1.8%)3.499s (+2.2%)0.967s14.55x

Summary: Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)4/5
🐘 PostgresNext.js (Turbopack)3/5
▲ VercelNext.js (Turbopack)4/5

Summary: Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local5/5
Next.js (Turbopack)💻 Local5/5
Nitro💻 Local5/5
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world
  • 🐘 Postgres: PostgreSQL database world
  • ▲ Vercel: Vercel production world

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

e2e test would be nice

target: 'es2022',
transform: {
react: {
runtime: 'automatic',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally we don't actually transform JSX at all so that the upstream tool can consume how it needs to e.g. Next.js might process one way but then vite expects to process a different way. Let me see if I can get that to work

@VaguelySerious

Copy link
Copy Markdown
MemberAuthor

Closing in favor of #507

Sign up for freeto 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.

3 participants

@VaguelySerious@TooTallNate@ijjk
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' [next] Allow implicit react imports by VaguelySerious · Pull Request #504 · vercel/workflow · GitHub
Skip to content

[next] Allow implicit react imports - #504

Closed
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-next-config-loader
Closed

[next] Allow implicit react imports#504
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-next-config-loader

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Dec 2, 2025

Copy link
Copy Markdown
Member

This is a potential fix for #212, where workflow/step bundling throws ReferenceError: React is not defined if react imports aren't explicitly defined, even though the TSConfig handles the implicit import fine.

Not sure if this makes sense or not.

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c4c6d3

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

This PR includes changesets to release 4 packages
NameType
@workflow/nextPatch
workflowPatch
@workflow/aiPatch
@workflow/world-testingPatch

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

@vercel

vercelBot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.041s (-2.6%)1.015s (~)0.974s1.00x
💻 LocalNitro0.043s (+0.9%)1.007s (~)0.964s1.05x
💻 LocalExpress0.043s (-3.1%)1.007s (~)0.964s1.05x
🐘 PostgresNitro0.341s (+16.3% 🔺)1.012s (~)0.671s8.29x
🐘 PostgresNext.js (Turbopack)0.381s (+134.5% 🔺)1.022s (~)0.641s9.27x
▲ VercelExpress0.444s (-16.3% 🟢)1.435s (+2.1%)0.991s10.80x
🐘 PostgresExpress0.480s (+167.7% 🔺)1.048s (+3.4%)0.568s11.68x
▲ VercelNitro0.491s (-4.8%)1.438s (+2.0%)0.947s11.95x
▲ VercelNext.js (Turbopack)0.531s (+5.1% 🔺)1.442s (-2.3%)0.911s12.93x

workflow with 1 step

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.102s (-1.0%)1.011s (~)0.909s1.00x
💻 LocalExpress0.110s (-1.8%)1.006s (~)0.895s1.09x
💻 LocalNitro0.111s (~)1.006s (~)0.895s1.09x
🐘 PostgresNext.js (Turbopack)0.744s (-19.4% 🟢)1.014s (~)0.270s7.32x
🐘 PostgresNitro1.219s (+16.5% 🔺)2.012s (+10.9% 🔺)0.792s11.99x
🐘 PostgresExpress1.390s (+11.1% 🔺)2.012s (~)0.621s13.67x
▲ VercelNext.js (Turbopack)1.452s (-4.5%)2.384s (-5.2% 🟢)0.932s14.27x
▲ VercelNitro1.519s (+7.3% 🔺)2.332s (-3.1%)0.813s14.94x
▲ VercelExpress1.532s (+2.5%)2.435s (-5.1% 🟢)0.904s15.06x

workflow with 10 sequential steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.644s (+1.1%)1.010s (~)0.366s1.00x
💻 LocalExpress0.763s (-2.5%)1.006s (~)0.243s1.18x
💻 LocalNitro0.782s (~)1.005s (~)0.223s1.21x
🐘 PostgresNext.js (Turbopack)5.220s (-1.5%)6.024s (~)0.804s8.10x
🐘 PostgresNitro10.199s (+87.3% 🔺)11.025s (+83.1% 🔺)0.826s15.83x
🐘 PostgresExpress10.261s (+43.8% 🔺)11.022s (+44.7% 🔺)0.761s15.93x
▲ VercelNext.js (Turbopack)10.263s (-2.2%)10.842s (-4.4%)0.579s15.93x
▲ VercelNitro10.507s (-3.1%)11.194s (-2.4%)0.687s16.31x
▲ VercelExpress10.623s (+1.9%)11.472s (+4.5%)0.849s16.49x

workflow with 10 parallel steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Nitro0.396s (-6.4% 🟢)1.006s (~)0.610s1.00x
💻 LocalNext.js (Turbopack)0.401s (-6.9% 🟢)1.010s (~)0.608s1.01x
💻 LocalExpress0.403s (+1.8%)1.005s (~)0.602s1.02x
🐘 PostgresNext.js (Turbopack)1.184s (+29.6% 🔺)1.851s (+82.5% 🔺)0.666s2.99x
🐘 PostgresExpress1.376s (-11.6% 🟢)2.010s (~)0.635s3.47x
🐘 PostgresNitro1.712s (+4.5%)2.012s (~)0.299s4.32x
▲ VercelNext.js (Turbopack)2.538s (-3.0%)3.435s (-4.0%)0.897s6.40x
▲ VercelNitro2.580s (-7.6% 🟢)3.497s (-1.3%)0.917s6.51x
▲ VercelExpress2.868s (+6.2% 🔺)3.453s (~)0.585s7.24x

Stream Benchmarks

Stream benchmarks include Time to First Byte (TTFB) metrics.

workflow with stream

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.174s (+18.1% 🔺)1.003s (~)1.015s (~)0.841s1.00x
💻 LocalExpress0.176s (+0.6%)0.992s (~)1.008s (~)0.833s1.01x
💻 LocalNitro0.178s (-0.5%)0.992s (~)1.008s (~)0.830s1.02x
🐘 PostgresExpress0.948s (-25.6% 🟢)1.659s (-7.1% 🟢)1.711s (-14.9% 🟢)0.762s5.45x
🐘 PostgresNext.js (Turbopack)1.200s (+15.3% 🔺)1.847s (+10.2% 🔺)2.015s (+17.3% 🔺)0.815s6.89x
🐘 PostgresNitro1.439s (+8.5% 🔺)1.654s (-3.5%)2.011s (~)0.572s8.26x
▲ VercelNext.js (Turbopack)2.350s (-7.0% 🟢)2.777s (-6.4% 🟢)3.134s (-7.4% 🟢)0.784s13.50x
▲ VercelExpress2.472s (-6.1% 🟢)2.948s (-4.2%)3.337s (-4.5%)0.864s14.20x
▲ VercelNitro2.533s (-3.9%)3.113s (+1.8%)3.499s (+2.2%)0.967s14.55x

Summary: Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)4/5
🐘 PostgresNext.js (Turbopack)3/5
▲ VercelNext.js (Turbopack)4/5

Summary: Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local5/5
Next.js (Turbopack)💻 Local5/5
Nitro💻 Local5/5
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world
  • 🐘 Postgres: PostgreSQL database world
  • ▲ Vercel: Vercel production world

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

e2e test would be nice

target: 'es2022',
transform: {
react: {
runtime: 'automatic',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally we don't actually transform JSX at all so that the upstream tool can consume how it needs to e.g. Next.js might process one way but then vite expects to process a different way. Let me see if I can get that to work

@VaguelySerious

Copy link
Copy Markdown
MemberAuthor

Closing in favor of #507

Sign up for freeto 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.

3 participants

@VaguelySerious@TooTallNate@ijjk
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' [next] Allow implicit react imports by VaguelySerious · Pull Request #504 · vercel/workflow · GitHub
Skip to content

[next] Allow implicit react imports - #504

Closed
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-next-config-loader
Closed

[next] Allow implicit react imports#504
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-next-config-loader

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Dec 2, 2025

Copy link
Copy Markdown
Member

This is a potential fix for #212, where workflow/step bundling throws ReferenceError: React is not defined if react imports aren't explicitly defined, even though the TSConfig handles the implicit import fine.

Not sure if this makes sense or not.

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c4c6d3

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

This PR includes changesets to release 4 packages
NameType
@workflow/nextPatch
workflowPatch
@workflow/aiPatch
@workflow/world-testingPatch

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

@vercel

vercelBot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.041s (-2.6%)1.015s (~)0.974s1.00x
💻 LocalNitro0.043s (+0.9%)1.007s (~)0.964s1.05x
💻 LocalExpress0.043s (-3.1%)1.007s (~)0.964s1.05x
🐘 PostgresNitro0.341s (+16.3% 🔺)1.012s (~)0.671s8.29x
🐘 PostgresNext.js (Turbopack)0.381s (+134.5% 🔺)1.022s (~)0.641s9.27x
▲ VercelExpress0.444s (-16.3% 🟢)1.435s (+2.1%)0.991s10.80x
🐘 PostgresExpress0.480s (+167.7% 🔺)1.048s (+3.4%)0.568s11.68x
▲ VercelNitro0.491s (-4.8%)1.438s (+2.0%)0.947s11.95x
▲ VercelNext.js (Turbopack)0.531s (+5.1% 🔺)1.442s (-2.3%)0.911s12.93x

workflow with 1 step

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.102s (-1.0%)1.011s (~)0.909s1.00x
💻 LocalExpress0.110s (-1.8%)1.006s (~)0.895s1.09x
💻 LocalNitro0.111s (~)1.006s (~)0.895s1.09x
🐘 PostgresNext.js (Turbopack)0.744s (-19.4% 🟢)1.014s (~)0.270s7.32x
🐘 PostgresNitro1.219s (+16.5% 🔺)2.012s (+10.9% 🔺)0.792s11.99x
🐘 PostgresExpress1.390s (+11.1% 🔺)2.012s (~)0.621s13.67x
▲ VercelNext.js (Turbopack)1.452s (-4.5%)2.384s (-5.2% 🟢)0.932s14.27x
▲ VercelNitro1.519s (+7.3% 🔺)2.332s (-3.1%)0.813s14.94x
▲ VercelExpress1.532s (+2.5%)2.435s (-5.1% 🟢)0.904s15.06x

workflow with 10 sequential steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.644s (+1.1%)1.010s (~)0.366s1.00x
💻 LocalExpress0.763s (-2.5%)1.006s (~)0.243s1.18x
💻 LocalNitro0.782s (~)1.005s (~)0.223s1.21x
🐘 PostgresNext.js (Turbopack)5.220s (-1.5%)6.024s (~)0.804s8.10x
🐘 PostgresNitro10.199s (+87.3% 🔺)11.025s (+83.1% 🔺)0.826s15.83x
🐘 PostgresExpress10.261s (+43.8% 🔺)11.022s (+44.7% 🔺)0.761s15.93x
▲ VercelNext.js (Turbopack)10.263s (-2.2%)10.842s (-4.4%)0.579s15.93x
▲ VercelNitro10.507s (-3.1%)11.194s (-2.4%)0.687s16.31x
▲ VercelExpress10.623s (+1.9%)11.472s (+4.5%)0.849s16.49x

workflow with 10 parallel steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Nitro0.396s (-6.4% 🟢)1.006s (~)0.610s1.00x
💻 LocalNext.js (Turbopack)0.401s (-6.9% 🟢)1.010s (~)0.608s1.01x
💻 LocalExpress0.403s (+1.8%)1.005s (~)0.602s1.02x
🐘 PostgresNext.js (Turbopack)1.184s (+29.6% 🔺)1.851s (+82.5% 🔺)0.666s2.99x
🐘 PostgresExpress1.376s (-11.6% 🟢)2.010s (~)0.635s3.47x
🐘 PostgresNitro1.712s (+4.5%)2.012s (~)0.299s4.32x
▲ VercelNext.js (Turbopack)2.538s (-3.0%)3.435s (-4.0%)0.897s6.40x
▲ VercelNitro2.580s (-7.6% 🟢)3.497s (-1.3%)0.917s6.51x
▲ VercelExpress2.868s (+6.2% 🔺)3.453s (~)0.585s7.24x

Stream Benchmarks

Stream benchmarks include Time to First Byte (TTFB) metrics.

workflow with stream

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.174s (+18.1% 🔺)1.003s (~)1.015s (~)0.841s1.00x
💻 LocalExpress0.176s (+0.6%)0.992s (~)1.008s (~)0.833s1.01x
💻 LocalNitro0.178s (-0.5%)0.992s (~)1.008s (~)0.830s1.02x
🐘 PostgresExpress0.948s (-25.6% 🟢)1.659s (-7.1% 🟢)1.711s (-14.9% 🟢)0.762s5.45x
🐘 PostgresNext.js (Turbopack)1.200s (+15.3% 🔺)1.847s (+10.2% 🔺)2.015s (+17.3% 🔺)0.815s6.89x
🐘 PostgresNitro1.439s (+8.5% 🔺)1.654s (-3.5%)2.011s (~)0.572s8.26x
▲ VercelNext.js (Turbopack)2.350s (-7.0% 🟢)2.777s (-6.4% 🟢)3.134s (-7.4% 🟢)0.784s13.50x
▲ VercelExpress2.472s (-6.1% 🟢)2.948s (-4.2%)3.337s (-4.5%)0.864s14.20x
▲ VercelNitro2.533s (-3.9%)3.113s (+1.8%)3.499s (+2.2%)0.967s14.55x

Summary: Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)4/5
🐘 PostgresNext.js (Turbopack)3/5
▲ VercelNext.js (Turbopack)4/5

Summary: Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local5/5
Next.js (Turbopack)💻 Local5/5
Nitro💻 Local5/5
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world
  • 🐘 Postgres: PostgreSQL database world
  • ▲ Vercel: Vercel production world

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

e2e test would be nice

target: 'es2022',
transform: {
react: {
runtime: 'automatic',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally we don't actually transform JSX at all so that the upstream tool can consume how it needs to e.g. Next.js might process one way but then vite expects to process a different way. Let me see if I can get that to work

@VaguelySerious

Copy link
Copy Markdown
MemberAuthor

Closing in favor of #507

Sign up for freeto 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.

3 participants

@VaguelySerious@TooTallNate@ijjk
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' [next] Allow implicit react imports by VaguelySerious · Pull Request #504 · vercel/workflow · GitHub
Skip to content

[next] Allow implicit react imports - #504

Closed
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-next-config-loader
Closed

[next] Allow implicit react imports#504
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-next-config-loader

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Dec 2, 2025

Copy link
Copy Markdown
Member

This is a potential fix for #212, where workflow/step bundling throws ReferenceError: React is not defined if react imports aren't explicitly defined, even though the TSConfig handles the implicit import fine.

Not sure if this makes sense or not.

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c4c6d3

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

This PR includes changesets to release 4 packages
NameType
@workflow/nextPatch
workflowPatch
@workflow/aiPatch
@workflow/world-testingPatch

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

@vercel

vercelBot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.041s (-2.6%)1.015s (~)0.974s1.00x
💻 LocalNitro0.043s (+0.9%)1.007s (~)0.964s1.05x
💻 LocalExpress0.043s (-3.1%)1.007s (~)0.964s1.05x
🐘 PostgresNitro0.341s (+16.3% 🔺)1.012s (~)0.671s8.29x
🐘 PostgresNext.js (Turbopack)0.381s (+134.5% 🔺)1.022s (~)0.641s9.27x
▲ VercelExpress0.444s (-16.3% 🟢)1.435s (+2.1%)0.991s10.80x
🐘 PostgresExpress0.480s (+167.7% 🔺)1.048s (+3.4%)0.568s11.68x
▲ VercelNitro0.491s (-4.8%)1.438s (+2.0%)0.947s11.95x
▲ VercelNext.js (Turbopack)0.531s (+5.1% 🔺)1.442s (-2.3%)0.911s12.93x

workflow with 1 step

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.102s (-1.0%)1.011s (~)0.909s1.00x
💻 LocalExpress0.110s (-1.8%)1.006s (~)0.895s1.09x
💻 LocalNitro0.111s (~)1.006s (~)0.895s1.09x
🐘 PostgresNext.js (Turbopack)0.744s (-19.4% 🟢)1.014s (~)0.270s7.32x
🐘 PostgresNitro1.219s (+16.5% 🔺)2.012s (+10.9% 🔺)0.792s11.99x
🐘 PostgresExpress1.390s (+11.1% 🔺)2.012s (~)0.621s13.67x
▲ VercelNext.js (Turbopack)1.452s (-4.5%)2.384s (-5.2% 🟢)0.932s14.27x
▲ VercelNitro1.519s (+7.3% 🔺)2.332s (-3.1%)0.813s14.94x
▲ VercelExpress1.532s (+2.5%)2.435s (-5.1% 🟢)0.904s15.06x

workflow with 10 sequential steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.644s (+1.1%)1.010s (~)0.366s1.00x
💻 LocalExpress0.763s (-2.5%)1.006s (~)0.243s1.18x
💻 LocalNitro0.782s (~)1.005s (~)0.223s1.21x
🐘 PostgresNext.js (Turbopack)5.220s (-1.5%)6.024s (~)0.804s8.10x
🐘 PostgresNitro10.199s (+87.3% 🔺)11.025s (+83.1% 🔺)0.826s15.83x
🐘 PostgresExpress10.261s (+43.8% 🔺)11.022s (+44.7% 🔺)0.761s15.93x
▲ VercelNext.js (Turbopack)10.263s (-2.2%)10.842s (-4.4%)0.579s15.93x
▲ VercelNitro10.507s (-3.1%)11.194s (-2.4%)0.687s16.31x
▲ VercelExpress10.623s (+1.9%)11.472s (+4.5%)0.849s16.49x

workflow with 10 parallel steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Nitro0.396s (-6.4% 🟢)1.006s (~)0.610s1.00x
💻 LocalNext.js (Turbopack)0.401s (-6.9% 🟢)1.010s (~)0.608s1.01x
💻 LocalExpress0.403s (+1.8%)1.005s (~)0.602s1.02x
🐘 PostgresNext.js (Turbopack)1.184s (+29.6% 🔺)1.851s (+82.5% 🔺)0.666s2.99x
🐘 PostgresExpress1.376s (-11.6% 🟢)2.010s (~)0.635s3.47x
🐘 PostgresNitro1.712s (+4.5%)2.012s (~)0.299s4.32x
▲ VercelNext.js (Turbopack)2.538s (-3.0%)3.435s (-4.0%)0.897s6.40x
▲ VercelNitro2.580s (-7.6% 🟢)3.497s (-1.3%)0.917s6.51x
▲ VercelExpress2.868s (+6.2% 🔺)3.453s (~)0.585s7.24x

Stream Benchmarks

Stream benchmarks include Time to First Byte (TTFB) metrics.

workflow with stream

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.174s (+18.1% 🔺)1.003s (~)1.015s (~)0.841s1.00x
💻 LocalExpress0.176s (+0.6%)0.992s (~)1.008s (~)0.833s1.01x
💻 LocalNitro0.178s (-0.5%)0.992s (~)1.008s (~)0.830s1.02x
🐘 PostgresExpress0.948s (-25.6% 🟢)1.659s (-7.1% 🟢)1.711s (-14.9% 🟢)0.762s5.45x
🐘 PostgresNext.js (Turbopack)1.200s (+15.3% 🔺)1.847s (+10.2% 🔺)2.015s (+17.3% 🔺)0.815s6.89x
🐘 PostgresNitro1.439s (+8.5% 🔺)1.654s (-3.5%)2.011s (~)0.572s8.26x
▲ VercelNext.js (Turbopack)2.350s (-7.0% 🟢)2.777s (-6.4% 🟢)3.134s (-7.4% 🟢)0.784s13.50x
▲ VercelExpress2.472s (-6.1% 🟢)2.948s (-4.2%)3.337s (-4.5%)0.864s14.20x
▲ VercelNitro2.533s (-3.9%)3.113s (+1.8%)3.499s (+2.2%)0.967s14.55x

Summary: Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)4/5
🐘 PostgresNext.js (Turbopack)3/5
▲ VercelNext.js (Turbopack)4/5

Summary: Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local5/5
Next.js (Turbopack)💻 Local5/5
Nitro💻 Local5/5
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world
  • 🐘 Postgres: PostgreSQL database world
  • ▲ Vercel: Vercel production world

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

e2e test would be nice

target: 'es2022',
transform: {
react: {
runtime: 'automatic',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally we don't actually transform JSX at all so that the upstream tool can consume how it needs to e.g. Next.js might process one way but then vite expects to process a different way. Let me see if I can get that to work

@VaguelySerious

Copy link
Copy Markdown
MemberAuthor

Closing in favor of #507

Sign up for freeto 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.

3 participants

@VaguelySerious@TooTallNate@ijjk
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); [next] Allow implicit react imports by VaguelySerious · Pull Request #504 · vercel/workflow · GitHub
Skip to content

[next] Allow implicit react imports - #504

Closed
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-next-config-loader
Closed

[next] Allow implicit react imports#504
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-next-config-loader

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Dec 2, 2025

Copy link
Copy Markdown
Member

This is a potential fix for #212, where workflow/step bundling throws ReferenceError: React is not defined if react imports aren't explicitly defined, even though the TSConfig handles the implicit import fine.

Not sure if this makes sense or not.

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c4c6d3

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

This PR includes changesets to release 4 packages
NameType
@workflow/nextPatch
workflowPatch
@workflow/aiPatch
@workflow/world-testingPatch

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

@vercel

vercelBot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.041s (-2.6%)1.015s (~)0.974s1.00x
💻 LocalNitro0.043s (+0.9%)1.007s (~)0.964s1.05x
💻 LocalExpress0.043s (-3.1%)1.007s (~)0.964s1.05x
🐘 PostgresNitro0.341s (+16.3% 🔺)1.012s (~)0.671s8.29x
🐘 PostgresNext.js (Turbopack)0.381s (+134.5% 🔺)1.022s (~)0.641s9.27x
▲ VercelExpress0.444s (-16.3% 🟢)1.435s (+2.1%)0.991s10.80x
🐘 PostgresExpress0.480s (+167.7% 🔺)1.048s (+3.4%)0.568s11.68x
▲ VercelNitro0.491s (-4.8%)1.438s (+2.0%)0.947s11.95x
▲ VercelNext.js (Turbopack)0.531s (+5.1% 🔺)1.442s (-2.3%)0.911s12.93x

workflow with 1 step

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.102s (-1.0%)1.011s (~)0.909s1.00x
💻 LocalExpress0.110s (-1.8%)1.006s (~)0.895s1.09x
💻 LocalNitro0.111s (~)1.006s (~)0.895s1.09x
🐘 PostgresNext.js (Turbopack)0.744s (-19.4% 🟢)1.014s (~)0.270s7.32x
🐘 PostgresNitro1.219s (+16.5% 🔺)2.012s (+10.9% 🔺)0.792s11.99x
🐘 PostgresExpress1.390s (+11.1% 🔺)2.012s (~)0.621s13.67x
▲ VercelNext.js (Turbopack)1.452s (-4.5%)2.384s (-5.2% 🟢)0.932s14.27x
▲ VercelNitro1.519s (+7.3% 🔺)2.332s (-3.1%)0.813s14.94x
▲ VercelExpress1.532s (+2.5%)2.435s (-5.1% 🟢)0.904s15.06x

workflow with 10 sequential steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.644s (+1.1%)1.010s (~)0.366s1.00x
💻 LocalExpress0.763s (-2.5%)1.006s (~)0.243s1.18x
💻 LocalNitro0.782s (~)1.005s (~)0.223s1.21x
🐘 PostgresNext.js (Turbopack)5.220s (-1.5%)6.024s (~)0.804s8.10x
🐘 PostgresNitro10.199s (+87.3% 🔺)11.025s (+83.1% 🔺)0.826s15.83x
🐘 PostgresExpress10.261s (+43.8% 🔺)11.022s (+44.7% 🔺)0.761s15.93x
▲ VercelNext.js (Turbopack)10.263s (-2.2%)10.842s (-4.4%)0.579s15.93x
▲ VercelNitro10.507s (-3.1%)11.194s (-2.4%)0.687s16.31x
▲ VercelExpress10.623s (+1.9%)11.472s (+4.5%)0.849s16.49x

workflow with 10 parallel steps

WorldFrameworkWorkflow TimeWall TimeOverheadvs Fastest
💻 Local🥇 Nitro0.396s (-6.4% 🟢)1.006s (~)0.610s1.00x
💻 LocalNext.js (Turbopack)0.401s (-6.9% 🟢)1.010s (~)0.608s1.01x
💻 LocalExpress0.403s (+1.8%)1.005s (~)0.602s1.02x
🐘 PostgresNext.js (Turbopack)1.184s (+29.6% 🔺)1.851s (+82.5% 🔺)0.666s2.99x
🐘 PostgresExpress1.376s (-11.6% 🟢)2.010s (~)0.635s3.47x
🐘 PostgresNitro1.712s (+4.5%)2.012s (~)0.299s4.32x
▲ VercelNext.js (Turbopack)2.538s (-3.0%)3.435s (-4.0%)0.897s6.40x
▲ VercelNitro2.580s (-7.6% 🟢)3.497s (-1.3%)0.917s6.51x
▲ VercelExpress2.868s (+6.2% 🔺)3.453s (~)0.585s7.24x

Stream Benchmarks

Stream benchmarks include Time to First Byte (TTFB) metrics.

workflow with stream

WorldFrameworkWorkflow TimeTTFBWall TimeOverheadvs Fastest
💻 Local🥇 Next.js (Turbopack)0.174s (+18.1% 🔺)1.003s (~)1.015s (~)0.841s1.00x
💻 LocalExpress0.176s (+0.6%)0.992s (~)1.008s (~)0.833s1.01x
💻 LocalNitro0.178s (-0.5%)0.992s (~)1.008s (~)0.830s1.02x
🐘 PostgresExpress0.948s (-25.6% 🟢)1.659s (-7.1% 🟢)1.711s (-14.9% 🟢)0.762s5.45x
🐘 PostgresNext.js (Turbopack)1.200s (+15.3% 🔺)1.847s (+10.2% 🔺)2.015s (+17.3% 🔺)0.815s6.89x
🐘 PostgresNitro1.439s (+8.5% 🔺)1.654s (-3.5%)2.011s (~)0.572s8.26x
▲ VercelNext.js (Turbopack)2.350s (-7.0% 🟢)2.777s (-6.4% 🟢)3.134s (-7.4% 🟢)0.784s13.50x
▲ VercelExpress2.472s (-6.1% 🟢)2.948s (-4.2%)3.337s (-4.5%)0.864s14.20x
▲ VercelNitro2.533s (-3.9%)3.113s (+1.8%)3.499s (+2.2%)0.967s14.55x

Summary: Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)4/5
🐘 PostgresNext.js (Turbopack)3/5
▲ VercelNext.js (Turbopack)4/5

Summary: Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local5/5
Next.js (Turbopack)💻 Local5/5
Nitro💻 Local5/5
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world
  • 🐘 Postgres: PostgreSQL database world
  • ▲ Vercel: Vercel production world

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

e2e test would be nice

target: 'es2022',
transform: {
react: {
runtime: 'automatic',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally we don't actually transform JSX at all so that the upstream tool can consume how it needs to e.g. Next.js might process one way but then vite expects to process a different way. Let me see if I can get that to work

@VaguelySerious

Copy link
Copy Markdown
MemberAuthor

Closing in favor of #507

Sign up for freeto 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.

3 participants

@VaguelySerious@TooTallNate@ijjk