Conversation
updated examples
2173cfd to
bd70294
Compare
There was a problem hiding this comment.
Pull request overview
This PR expands the repository’s examples/ as a pnpm workspace, adds several new FastEdge AssemblyScript examples (with supporting docs/config), updates plugin-source manifest mappings, and bumps the SDK/package versions and lockfiles accordingly.
Changes:
- Add pnpm workspace configuration to treat
examples/*as workspace packages. - Add new examples (A/B testing, API key, cache control, CORS, custom error pages, HTTP call, large dictionary) plus documentation and build configs; update existing examples’ docs.
- Update SDK/package versions and refresh lockfiles; expand
fastedge-plugin-source/manifest.jsonto include new blueprint/pattern sources and mappings.
Reviewed changes
Copilot reviewed 59 out of 67 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Declares examples/* as pnpm workspace packages. |
| pnpm-lock.yaml | Lockfile updated to include example importers and dependency bumps. |
| package.json | Bumps SDK version to 1.2.3. |
| fastedge-plugin-source/manifest.json | Bumps manifest version and adds new example sources + target mappings. |
| .npmrc | Enables workspace package linking (link-workspace-packages=true). |
| CLAUDE.md | Updates internal repo guidance (examples + dictionary notes). |
| context/research/COMPONENT_MODEL.md | Adds Component Model migration research document. |
| examples/README.md | Adds an index of all examples and build instructions. |
| examples/body/package.json | Switches SDK dependency to ^1.2.3. |
| examples/body/assembly/index.ts | Adjusts body example logging/property usage. |
| examples/body/README.md | Adds “Back to examples” link. |
| examples/headers/package.json | Switches SDK dependency to ^1.2.3. |
| examples/headers/README.md | Adds “Back to examples” link. |
| examples/helloWorld/package.json | Switches SDK dependency to ^1.2.3. |
| examples/helloWorld/README.md | Adds “Back to examples” link. |
| examples/jwt/package.json | Switches SDK dependency to ^1.2.3. |
| examples/jwt/README.md | Adds “Back to examples” link. |
| examples/kvStore/package.json | Switches SDK dependency to ^1.2.3. |
| examples/kvStore/README.md | Adds “Back to examples” link. |
| examples/logTime/package.json | Switches SDK dependency to ^1.2.3. |
| examples/logTime/README.md | Adds “Back to examples” link. |
| examples/properties/package.json | Switches SDK dependency to ^1.2.3. |
| examples/properties/README.md | Adds “Back to examples” link. |
| examples/variablesAndSecrets/package.json | Switches SDK dependency to ^1.2.3. |
| examples/variablesAndSecrets/README.md | Adds “Back to examples” link. |
| examples/geoBlock/package.json | Switches SDK dependency to ^1.2.3. |
| examples/geoBlock/README.md | Adds “Back to examples” link. |
| examples/geoRedirect/package.json | Switches SDK dependency to ^1.2.3. |
| examples/geoRedirect/README.md | Adds “Back to examples” link. |
| examples/geoRedirect/fixtures/.env | Adds fixture env values for geo-redirect tests. |
| examples/geoRedirect/fixtures/default.test.json | Adds default geo-redirect test fixture. |
| examples/geoRedirect/fixtures/germany.test.json | Adds DE geo-redirect test fixture. |
| examples/abTesting/pnpm-lock.yaml | Adds lockfile for the new A/B testing example. |
| examples/abTesting/package.json | Adds package metadata for A/B testing example. |
| examples/abTesting/asconfig.json | Adds AssemblyScript build targets for A/B testing example. |
| examples/abTesting/assembly/index.ts | Implements cookie-based A/B routing example. |
| examples/abTesting/README.md | Documents the A/B testing example. |
| examples/apiKey/pnpm-lock.yaml | Adds lockfile for the new API key example. |
| examples/apiKey/package.json | Adds package metadata for API key example. |
| examples/apiKey/asconfig.json | Adds AssemblyScript build targets for API key example. |
| examples/apiKey/assembly/index.ts | Implements API key validation example. |
| examples/apiKey/README.md | Documents the API key example. |
| examples/cacheControl/pnpm-lock.yaml | Adds lockfile for the new cache-control example. |
| examples/cacheControl/package.json | Adds package metadata for cache-control example. |
| examples/cacheControl/asconfig.json | Adds AssemblyScript build targets for cache-control example. |
| examples/cacheControl/assembly/index.ts | Implements content-type/status-based cache-control logic. |
| examples/cacheControl/README.md | Documents the cache-control example. |
| examples/cors/pnpm-lock.yaml | Adds lockfile for the new CORS example. |
| examples/cors/package.json | Adds package metadata for CORS example. |
| examples/cors/asconfig.json | Adds AssemblyScript build targets for CORS example. |
| examples/cors/assembly/index.ts | Implements CORS preflight + response headers logic. |
| examples/cors/README.md | Documents the CORS example. |
| examples/customErrorPages/pnpm-lock.yaml | Adds lockfile for the new custom error pages example. |
| examples/customErrorPages/package.json | Adds package metadata for custom error pages example. |
| examples/customErrorPages/asconfig.json | Adds AssemblyScript build targets for custom error pages example. |
| examples/customErrorPages/assembly/index.ts | Implements 4xx/5xx interception and HTML replacement. |
| examples/customErrorPages/README.md | Documents the custom error pages example. |
| examples/httpCall/pnpm-lock.yaml | Adds lockfile for the new HTTP call example. |
| examples/httpCall/package.json | Adds package metadata for HTTP call example. |
| examples/httpCall/asconfig.json | Adds AssemblyScript build targets for HTTP call example. |
| examples/httpCall/assembly/index.ts | Implements async outbound HTTP call example with callback logging. |
| examples/httpCall/README.md | Documents the HTTP call example. |
| examples/largeDictionary/pnpm-lock.yaml | Adds lockfile for the new large dictionary example. |
| examples/largeDictionary/package.json | Adds package metadata for large dictionary example. |
| examples/largeDictionary/asconfig.json | Adds AssemblyScript build targets for large dictionary example. |
| examples/largeDictionary/assembly/index.ts | Implements dictionary-based large env var read example. |
| examples/largeDictionary/README.md | Documents the large dictionary example. |
Files not reviewed (8)
- examples/abTesting/pnpm-lock.yaml: Language not supported
- examples/apiKey/pnpm-lock.yaml: Language not supported
- examples/cacheControl/pnpm-lock.yaml: Language not supported
- examples/cors/pnpm-lock.yaml: Language not supported
- examples/customErrorPages/pnpm-lock.yaml: Language not supported
- examples/httpCall/pnpm-lock.yaml: Language not supported
- examples/largeDictionary/pnpm-lock.yaml: Language not supported
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 124 out of 132 changed files in this pull request and generated 21 comments.
Files not reviewed (8)
- examples/abTesting/pnpm-lock.yaml: Language not supported
- examples/apiKey/pnpm-lock.yaml: Language not supported
- examples/cacheControl/pnpm-lock.yaml: Language not supported
- examples/cors/pnpm-lock.yaml: Language not supported
- examples/customErrorPages/pnpm-lock.yaml: Language not supported
- examples/httpCall/pnpm-lock.yaml: Language not supported
- examples/largeDictionary/pnpm-lock.yaml: Language not supported
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 134 out of 145 changed files in this pull request and generated 2 comments.
Files not reviewed (10)
- examples/body/pnpm-lock.yaml: Language not supported
- examples/geoBlock/pnpm-lock.yaml: Language not supported
- examples/geoRedirect/pnpm-lock.yaml: Language not supported
- examples/headers/pnpm-lock.yaml: Language not supported
- examples/jwt/pnpm-lock.yaml: Language not supported
- examples/kvStore/pnpm-lock.yaml: Language not supported
- examples/logTime/pnpm-lock.yaml: Language not supported
- examples/properties/pnpm-lock.yaml: Language not supported
- examples/variablesAndSecrets/pnpm-lock.yaml: Language not supported
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| onResponseHeaders(a: u32, end_of_stream: bool): FilterHeadersStatusValues { | ||
| if (this.variant === "") { | ||
| return FilterHeadersStatusValues.Continue; | ||
| } |
There was a problem hiding this comment.
this.variant is set in onRequestHeaders and then read in onResponseHeaders, but on FastEdge Context instances are not guaranteed to persist across different lifecycle hooks (hook state isolation). This likely means onResponseHeaders runs with a fresh Context where variant is still "", so the experiment cookie/header will never be set. Persist the assigned variant across hooks via set_property/get_property (or another cross-hook state mechanism) instead of an instance field.
| Each example is a standalone project. To build one: | ||
|
|
||
| ```sh | ||
| cd <example-name> |
There was a problem hiding this comment.
The usage snippet suggests cd <example-name>, but the examples live under examples/<name>/ in this repo. As written, following these instructions from the repository root will fail. Please clarify the command (e.g., cd examples/<example-name> or explicitly instruct to cd examples first).
| cd <example-name> | |
| cd examples/<example-name> |
No description provided.