Skip to content

Commit e4eee73

Browse files
authored
feat(maintenance): drop support for Node.js 16.x (#2717)
1 parent 4ec3dcd commit e4eee73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+142
-242
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ body:
6969
options:
7070
- 20.x
7171
- 18.x
72-
- 16.x
7372
validations:
7473
required: true
7574
- type: dropdown

.github/actions/cached-node-modules/action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ outputs:
1414
runs:
1515
using: "composite"
1616
steps:
17-
- name: Install npm
18-
# We need to keep this npm version until we drop Node.js 16 support because Node.js 16 doesn't support npm 10
19-
run: npm i -g npm@next-9
20-
shell: bash
2117
- name: Cache node modules
2218
id: cache-node-modules
2319
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0

.github/workflows/reusable-run-linting-check-and-unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
NODE_ENV: dev
1414
strategy:
1515
matrix:
16-
version: [16, 18, 20]
16+
version: [18, 20]
1717
fail-fast: false
1818
steps:
1919
- name: Checkout code

.github/workflows/run-e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
packages/parameters,
3333
packages/idempotency,
3434
]
35-
version: [16, 18, 20]
35+
version: [18, 20]
3636
arch: [x86_64, arm64]
3737
fail-fast: false
3838
steps:

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ You can use Powertools for AWS Lambda (TypeScript) by installing it with your fa
250250

251251
[Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html){target="_blank"} is a `.zip` file archive that can contain additional code, pre-packaged dependencies, data, or configuration files. We compile and optimize [all dependencies](#install) to achieve an optimal build.
252252

253-
You can use the Lambda Layer both with CommonJS and ESM (ECMAScript modules) for Node.js 18.x and newer runtimes. **If you are using the managed Node.js 16.x runtime and cannot upgrade, you should use the CommonJS version only**.
253+
You can use the Lambda Layer both with CommonJS and ESM (ECMAScript modules) for Node.js 18.x and newer runtimes.
254254

255255
??? note "Click to expand and copy any regional Lambda Layer ARN"
256256
| Region | Layer ARN |

docs/overrides/main.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
{% endblock %}
99

1010
{% block announce %}
11-
Starting from July 1, 2024 we will end support for Node.js 16. Learn more <a
12-
href="https://github.com/aws-powertools/powertools-lambda-typescript/issues/2223" target="_blank">here</a>.
11+
On September 1st, 2024 v1 of Powertools for AWS Lambda (TypeScript) <a
12+
href="https://github.com/aws-powertools/powertools-lambda-typescript/issues/2224" target="_blank">will reach
13+
End-of-Life</a>. We recommend you to <a href="https://docs.powertools.aws.dev/lambda/typescript/latest/upgrade/"
14+
target="_blank">upgrade to v2</a>.
1315
{% endblock %}

docs/upgrade.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ V2 is focused on official support for ESM (ECMAScript modules). We've made other
3131

3232
Before you start, we suggest making a copy of your current working project or create a new git branch.
3333

34-
1. Upgrade Node.js to v16 or higher, Node.js v20 is recommended.
34+
1. Upgrade Node.js to v18 or higher, Node.js v20 is recommended.
3535
2. Ensure that you have the latest Powertools for AWS Lambda (TypeScript) version via [Lambda Layer](./index.md#lambda-layer) or npm.
3636
3. Review the following sections to confirm whether they apply to your codebase.
3737

layers/src/canary-stack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class CanaryStack extends Stack {
4141
'../tests/e2e/layerPublisher.class.test.functionCode.ts'
4242
),
4343
handler: 'handler',
44-
runtime: Runtime.NODEJS_16_X,
44+
runtime: Runtime.NODEJS_18_X,
4545
functionName: `canary-${suffix}`,
4646
timeout: Duration.seconds(30),
4747
bundling: {

layers/src/layer-publisher-stack.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ export class LayerPublisherStack extends Stack {
3636
this.lambdaLayerVersion = new LayerVersion(this, 'LambdaPowertoolsLayer', {
3737
layerVersionName: props?.layerName,
3838
description: `Powertools for AWS Lambda (TypeScript) version ${powertoolsPackageVersion}`,
39-
compatibleRuntimes: [
40-
Runtime.NODEJS_16_X,
41-
Runtime.NODEJS_18_X,
42-
Runtime.NODEJS_20_X,
43-
],
39+
compatibleRuntimes: [Runtime.NODEJS_18_X, Runtime.NODEJS_20_X],
4440
license: 'MIT-0',
4541
// This is needed because the following regions do not support the compatibleArchitectures property #1400
4642
// ...(![ 'eu-south-2', 'eu-central-2', 'ap-southeast-4' ].includes(Stack.of(this).region) ? { compatibleArchitectures: [Architecture.X86_64] } : {}),
@@ -105,7 +101,7 @@ export class LayerPublisherStack extends Stack {
105101
'node_modules/@aws-sdk/**/README.md ',
106102
];
107103
const buildCommands: string[] = [];
108-
// We need these modules because they are not included in the nodejs16x runtimes
104+
// We install these to get the latest version of the packages
109105
const modulesToInstall: string[] = [
110106
'@aws-sdk/client-dynamodb',
111107
'@aws-sdk/util-dynamodb',

layers/tests/e2e/layerPublisher.test.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
TestInvocationLogs,
1212
invokeFunctionOnce,
1313
generateTestUniqueName,
14-
getRuntimeKey,
1514
} from '@aws-lambda-powertools/testing-utils';
1615
import { TestNodejsFunction } from '@aws-lambda-powertools/testing-utils/resources/lambda';
1716
import {
@@ -48,13 +47,7 @@ describe(`Layers E2E tests`, () => {
4847
},
4948
});
5049

51-
/**
52-
* Node.js 16.x does not support importing ESM modules from Lambda Layers reliably.
53-
*
54-
* The feature is available in Node.js 18.x and later.
55-
* @see https://aws.amazon.com/blogs/compute/node-js-18-x-runtime-now-available-in-aws-lambda/
56-
*/
57-
const cases = getRuntimeKey() === 'nodejs16x' ? ['CJS'] : ['CJS', 'ESM'];
50+
const cases = ['CJS', 'ESM'];
5851
const invocationLogsMap: Map<(typeof cases)[number], TestInvocationLogs> =
5952
new Map();
6053

0 commit comments

Comments
 (0)