@reckona/create-mreact-app 0.0.18 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -54,7 +54,7 @@ for API Gateway HTTP API v2 and Lambda Function URL payload format 2.0.
54
54
 
55
55
  For AWS Lambda production apps, add packages imported by loaders, middleware, route handlers, metadata, server actions, or their app-local helper modules to `importPolicy.allowedPackages` in the generated `src/lambda.ts`.
56
56
 
57
- Package Lambda deployments from a minimal asset directory, not the full project root. The generated `docs/deploy/aws-lambda.md` shows a `prepare-lambda-asset.sh` example that copies `.mreact/`, the bundled handler, manifests, lockfiles, and production `node_modules` into `.lambda/` so CDK/SAM/serverless assets stay below AWS's 250 MB unzipped deployment package limit. Generated Lambda projects build with `mreact-router build --target=node`, keeping Cloudflare Workers route modules out of Node-only artifacts and storing compiled server route artifacts in `.mreact/server/server-modules/*.json` instead of one large server manifest. The Lambda adapter treats `outDir` as read-only and materializes runtime files under `/tmp` by default, so `.mreact/` can stay inside the deployed package; generated Lambda handlers use top-level `await createPreloadedAwsLambdaRequestHandler()` so built runtime modules, middleware, route modules, layouts, and route metadata are imported during Lambda initialization rather than on the first request. For pnpm projects, the generated script uses `--config.node-linker=hoisted` and includes symlink and actual-file-byte checks because pnpm's default isolated linker can create Lambda artifacts that package larger than `du` suggests.
57
+ Package Lambda deployments from a minimal asset directory, not the full project root. The generated `docs/deploy/aws-lambda.md` shows a `prepare-lambda-asset.sh` example that copies `.mreact/`, the bundled handler, manifests, lockfiles, and production `node_modules` into `.lambda/` so CDK/SAM/serverless assets stay below AWS's 250 MB unzipped deployment package limit. Generated Lambda projects build with `mreact-router build --target=node`, keeping Cloudflare Workers route modules out of Node-only artifacts and storing compiled server route artifacts in `.mreact/server/server-modules/*.json` instead of one large server manifest. The Lambda adapter treats `outDir` as read-only and materializes runtime files under `/tmp` by default, so `.mreact/` can stay inside the deployed package; generated Lambda handlers use top-level `await createPreloadedAwsLambdaRequestHandler()` so built runtime modules, middleware, route modules, layouts, and route metadata are imported during Lambda initialization rather than on the first request. Static middleware matchers and loader redirects avoid unnecessary page render artifact work on unmatched health checks and simple redirects. For pnpm projects, the generated script uses `--config.node-linker=hoisted` and includes symlink and actual-file-byte checks because pnpm's default isolated linker can create Lambda artifacts that package larger than `du` suggests.
58
58
 
59
59
  Use `--src-dir` to generate a larger-app layout:
60
60
 
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { mkdir, readdir, readFile, writeFile } from "node:fs/promises";
2
2
  import { basename, dirname, join } from "node:path";
3
3
  const internalPackageVersions = {
4
- "@reckona/mreact-auth": "^0.0.18",
5
- "@reckona/mreact-devtools": "^0.0.18",
6
- "@reckona/mreact-forms": "^0.0.18",
7
- "@reckona/mreact": "^0.0.18",
8
- "@reckona/mreact-query": "^0.0.18",
9
- "@reckona/mreact-reactive-core": "^0.0.18",
10
- "@reckona/mreact-router": "^0.0.18",
4
+ "@reckona/mreact-auth": "^0.0.20",
5
+ "@reckona/mreact-devtools": "^0.0.20",
6
+ "@reckona/mreact-forms": "^0.0.20",
7
+ "@reckona/mreact": "^0.0.20",
8
+ "@reckona/mreact-query": "^0.0.20",
9
+ "@reckona/mreact-reactive-core": "^0.0.20",
10
+ "@reckona/mreact-router": "^0.0.20",
11
11
  };
12
12
  const currentMreactVersion = internalPackageVersions["@reckona/mreact"].replace(/^\^/, "");
13
13
  const typescriptVersion = "^6.0.3";
@@ -891,7 +891,7 @@ mreactRouter({
891
891
 
892
892
  AWS Lambda has a 250 MB unzipped deployment package limit. Do not point CDK, SAM, Serverless Framework, or Terraform at the full project root after a CI install, because that can include source files, tests, dev dependencies, Vite/Vitest/Playwright tooling, and package-manager caches. The mreact runtime only needs the built app output, the Lambda handler bundle, and production runtime dependencies.
893
893
 
894
- The Lambda adapter treats \`outDir\` as read-only. On cold start it materializes generated runtime files under \`/tmp/mreact-router/<hash>/runtime\` and creates a \`node_modules\` symlink back to the deployed package root so server-side imports resolve from the production dependencies. Pass \`runtimeDir\` to \`createAwsLambdaRequestHandler()\` only if you need a custom writable cache directory.
894
+ The Lambda adapter treats \`outDir\` as read-only. On cold start it materializes generated runtime files under \`/tmp/mreact-router/<hash>/runtime\` and creates a \`node_modules\` symlink back to the deployed package root so server-side imports resolve from the production dependencies. Static middleware \`config.matcher\` / \`config.id\` checks run before middleware module import, and loader redirects settle before page component server transforms for non-stream routes and stream routes without a loading boundary. Pass \`runtimeDir\` to \`createAwsLambdaRequestHandler()\` only if you need a custom writable cache directory.
895
895
 
896
896
  pnpm's default isolated linker creates a symlink-heavy \`node_modules\` tree. Some Lambda packaging tools dereference those links or count their targets differently, which can make an artifact look small locally but exceed the unzipped limit after packaging. For pnpm Lambda artifacts, install production dependencies into \`.lambda/\` with \`--config.node-linker=hoisted\`, then verify both symlink count and actual file bytes before upload.
897
897
 
@@ -962,7 +962,7 @@ export const handler = await createPreloadedAwsLambdaRequestHandler({
962
962
  });
963
963
  \`\`\`
964
964
 
965
- The generated handler uses top-level \`await\` with \`createPreloadedAwsLambdaRequestHandler()\` so the built runtime, middleware, route modules, layouts, and metadata are imported during the Lambda initialization phase instead of racing the first user request.
965
+ The generated handler uses top-level \`await\` with \`createPreloadedAwsLambdaRequestHandler()\` so the built runtime, middleware, route modules, layouts, and metadata are imported during the Lambda initialization phase instead of racing the first user request. Add \`timings: true\` while diagnosing production latency to emit \`router:request:timing\` and \`router:render:timing\` debug events for request conversion, render phases, loader wait, page render, layout render, response construction, and Lambda response conversion. Loader timing splits module load/evaluation from user loader execution with \`loaderModuleLoadMs\` and \`loaderExecutionMs\`; middleware timing similarly splits \`middlewareModuleLoadMs\` and \`middlewareExecutionMs\`.
966
966
 
967
967
  ## Streaming SSR
968
968
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reckona/create-mreact-app",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "Project scaffolder for mreact app-router applications.",
5
5
  "keywords": [
6
6
  "cli",