Skip to content

[APPS] Move inlineDynamicImports to shared backend build config#317

Draft
sdkennedy2 wants to merge 1 commit intomasterfrom
sdkennedy2/inline-dynamic-imports-shared-config
Draft

[APPS] Move inlineDynamicImports to shared backend build config#317
sdkennedy2 wants to merge 1 commit intomasterfrom
sdkennedy2/inline-dynamic-imports-shared-config

Conversation

@sdkennedy2
Copy link
Copy Markdown
Collaborator

@sdkennedy2 sdkennedy2 commented Apr 7, 2026

Motivation

Both the production build (buildBackendFunctions) and dev server build (bundleFunction) were independently setting inlineDynamicImports: true in their rollup output config. This duplication meant the shared base config didn't fully capture the contract that all backend function builds produce self-contained JS files.

Changes

Moved inlineDynamicImports: true into getBaseBackendBuildConfig so the shared config is the single source of truth for backend build behavior. Removed the redundant per-caller overrides and cleaned up stale comments that referenced the now-centralized setting.

Also inlined the virtualEntries variable in the production build loop — since we build one function at a time, there's no need for an intermediate variable holding a single-entry map.

QA Instructions

This is a pure refactor with no behavior change. The same inlineDynamicImports: true setting is applied in the same place — just from the shared config instead of each caller.

  • Existing unit tests for backend function building should pass
  • E2E tests for apps with backend functions should produce identical output

Blast Radius

  • Only affects the apps plugin's backend function build path (Vite only)
  • No customer-facing API or config changes
  • Gated behind the apps plugin feature flag

Documentation

Copy link
Copy Markdown
Collaborator Author

sdkennedy2 commented Apr 7, 2026

@sdkennedy2 sdkennedy2 changed the title Move inlineDynamicImports to shared build config, simplify per-function build [APPS] Move inlineDynamicImports to shared backend build config Apr 7, 2026
@datadog-official
Copy link
Copy Markdown

datadog-official bot commented Apr 7, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 3877b11 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

Base automatically changed from sdkennedy2/apps-vite-dev-server to master April 7, 2026 19:37
@sdkennedy2 sdkennedy2 force-pushed the sdkennedy2/inline-dynamic-imports-shared-config branch from 6898cb6 to 3877b11 Compare April 7, 2026 19:54
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