Skip to content

Commit 7c484e8

Browse files
authored
fix(build)!: Rename plugin that wrapps requests with AsyncLocalStorage (#2062)
1 parent ab2f66a commit 7c484e8

20 files changed

Lines changed: 51 additions & 51 deletions

docs/implementation-plans/debugger-breakpoints-investigation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ The seven Cedar-specific transforms:
9090

9191
| Plugin | What It Does |
9292
| ------------------------- | ------------------------------------------------------ |
93-
| `context-wrapping` | Wraps exported handlers with async context isolation |
93+
| `handler-als-wrapping` | Wraps exported handlers with async context isolation |
9494
| `directory-named-import` | Rewrites import paths for directory-named modules |
9595
| `import-dir` | Expands glob imports into individual namespace imports |
9696
| `job-path-injector` | Injects path/name into `.createJob()` calls |

packages/babel-config/src/api.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
} from './common.js'
1717
import pluginCedarGqlormInject from './plugins/babel-plugin-cedar-gqlorm-inject.js'
1818
import pluginCedarGraphqlOptionsExtract from './plugins/babel-plugin-cedar-graphql-options-extract.js'
19-
import pluginRedwoodContextWrapping from './plugins/babel-plugin-redwood-context-wrapping.js'
19+
import handlerAlsWrappingPlugin from './plugins/babel-plugin-handler-als-wrapping.js'
2020
import pluginRedwoodDirectoryNamedImport from './plugins/babel-plugin-redwood-directory-named-import.js'
2121
import pluginRedwoodImportDir from './plugins/babel-plugin-redwood-import-dir.js'
2222
import pluginRedwoodJobPathInjector from './plugins/babel-plugin-redwood-job-path-injector.js'
@@ -174,20 +174,20 @@ export const getApiSideBabelOverrides = ({
174174
} = {}) => {
175175
const overrides = [
176176
// Extract graphql options from the graphql function
177-
// NOTE: this must come before the context wrapping
177+
// NOTE: this must come before the handler-als-wrapping
178178
{
179179
// match */api/src/functions/graphql.js|ts
180180
test: /.+api(?:[\\|/])src(?:[\\|/])functions(?:[\\|/])graphql\.(?:js|ts)$/,
181181
plugins: [pluginCedarGraphqlOptionsExtract, pluginCedarGqlormInject],
182182
},
183-
// Apply context wrapping to all functions (Jest only; Vite uses
184-
// cedarContextWrappingPlugin instead)
183+
// Apply handler ALS wrapping to all functions (Jest only; Vite uses
184+
// handlerAlsWrappingPlugin instead)
185185
forJest && {
186186
// match */api/src/functions/*.js|ts
187187
test: /.+api(?:[\\|/])src(?:[\\|/])functions(?:[\\|/]).+.(?:js|ts)$/,
188188
plugins: [
189189
[
190-
pluginRedwoodContextWrapping,
190+
handlerAlsWrappingPlugin,
191191
{
192192
projectIsEsm,
193193
},

packages/babel-config/src/plugins/__tests__/__fixtures__/context-wrapping/auth/code.js renamed to packages/babel-config/src/plugins/__tests__/__fixtures__/handler-als-wrapping/auth/code.js

File renamed without changes.

packages/babel-config/src/plugins/__tests__/__fixtures__/context-wrapping/auth/output.js renamed to packages/babel-config/src/plugins/__tests__/__fixtures__/handler-als-wrapping/auth/output.js

File renamed without changes.

packages/babel-config/src/plugins/__tests__/__fixtures__/context-wrapping/custom/code.js renamed to packages/babel-config/src/plugins/__tests__/__fixtures__/handler-als-wrapping/custom/code.js

File renamed without changes.

packages/babel-config/src/plugins/__tests__/__fixtures__/context-wrapping/custom/output.js renamed to packages/babel-config/src/plugins/__tests__/__fixtures__/handler-als-wrapping/custom/output.js

File renamed without changes.

packages/babel-config/src/plugins/__tests__/__fixtures__/context-wrapping/graphql/code.js renamed to packages/babel-config/src/plugins/__tests__/__fixtures__/handler-als-wrapping/graphql/code.js

File renamed without changes.

packages/babel-config/src/plugins/__tests__/__fixtures__/context-wrapping/graphql/output.js renamed to packages/babel-config/src/plugins/__tests__/__fixtures__/handler-als-wrapping/graphql/output.js

File renamed without changes.

packages/babel-config/src/plugins/__tests__/babel-plugin-redwood-context-wrapping.sourcemaps.test.ts renamed to packages/babel-config/src/plugins/__tests__/babel-plugin-handler-als-wrapping.sourcemaps.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { describe, it, expect } from 'vitest'
88

99
import gqlormInjectPlugin from '../babel-plugin-cedar-gqlorm-inject'
1010
import graphqlOptionsExtractPlugin from '../babel-plugin-cedar-graphql-options-extract'
11-
import plugin from '../babel-plugin-redwood-context-wrapping'
11+
import plugin from '../babel-plugin-handler-als-wrapping'
1212

1313
const simpleHandlerInput = [
1414
'',
@@ -172,7 +172,7 @@ function assertMapsToSource(
172172
expect(original.line).toBe(expectedLine)
173173
}
174174

175-
describe('babel-plugin-redwood-context-wrapping source maps', () => {
175+
describe('babel-plugin-handler-als-wrapping source maps', () => {
176176
it('produces a source map with the expected structure', () => {
177177
const { code, map } = getCodeAndMap(
178178
runBabelTransform(simpleHandlerInput, 'graphql.ts'),
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import path from 'path'
2+
3+
import pluginTester from 'babel-plugin-tester'
4+
5+
import handlerAlsWrappingPlugin from '../babel-plugin-handler-als-wrapping.js'
6+
7+
pluginTester({
8+
plugin: handlerAlsWrappingPlugin,
9+
pluginName: 'babel-plugin-handler-als-wrapping',
10+
fixtures: path.join(__dirname, '__fixtures__/handler-als-wrapping'),
11+
})

0 commit comments

Comments
 (0)