Skip to content

fix(create-blocks-app): lazy-load React template backend#235

Open
ikenyal wants to merge 1 commit into
aws-devtools-labs:mainfrom
ikenyal:fix/react-template-lambda-factory
Open

fix(create-blocks-app): lazy-load React template backend#235
ikenyal wants to merge 1 commit into
aws-devtools-labs:mainfrom
ikenyal:fix/react-template-lambda-factory

Conversation

@ikenyal

@ikenyal ikenyal commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Problem

The React template passes an eagerly imported backend module to createLambdaHandler, but the handler accepts a lazy async factory. This makes the React template inconsistent with every other template and imports the backend before runtime config is loaded.

Issue #, if available: #221

Changes

  • Replace the eager backend import in the React template with () => import('./index.js').
  • Add a scaffold regression test that verifies the generated React handler uses the lazy factory and does not import the backend eagerly.
  • Add a patch changeset for @aws-blocks/create-blocks-app.

Validation

  • npm run build --workspace @aws-blocks/create-blocks-app
  • npm test --workspace @aws-blocks/create-blocks-app (51 passing tests)
  • npm run lint:deps
  • changeset status --since=origin/main

Checklist

  • PR description included
  • Tests are changed or added
  • Relevant documentation is changed or added (not applicable: this aligns the generated implementation with the existing documented handler API)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ikenyal
ikenyal requested a review from a team as a code owner July 19, 2026 20:24
@changeset-bot

changeset-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b3a560f

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

This PR includes changesets to release 1 package
Name Type
@aws-blocks/create-blocks-app 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

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