Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for Node 16 #7780

Merged
merged 6 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .changeset/afraid-dots-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
'@astrojs/cloudflare': major
'@astrojs/partytown': major
'@astrojs/tailwind': major
'@astrojs/netlify': major
'@astrojs/sitemap': major
'@astrojs/preact': major
'@astrojs/svelte': major
'@astrojs/vercel': major
'@astrojs/react': major
'@astrojs/solid-js': major
'@astrojs/deno': major
'@astrojs/node': major
'@astrojs/lit': major
'@astrojs/vue': major
'create-astro': major
'@astrojs/prism': major
'@astrojs/rss': major
'@astrojs/telemetry': major
'@astrojs/webapi': major
'astro': major
'@astrojs/turbolinks': minor
'@astrojs/alpinejs': minor
'@astrojs/prefetch': minor
'@astrojs/markdoc': minor
'@astrojs/underscore-redirects': minor
'@astrojs/image': minor
'@astrojs/mdx': minor
'@astrojs/internal-helpers': minor
---

Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/---01-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body:
Thank you for taking the time to file a bug report! Please fill out this form as completely as possible.

✅ I am using the **latest version of Astro** and all plugins.
✅ I am using a version of Node that supports ESM (`v14.18.0+`, or `v16.12.0+`)
✅ I am using a version of Node that Astro supports (`>=18.14.1`)
- type: input
id: astro-version
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"

- name: Install dependencies
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
strategy:
matrix:
OS: [ubuntu-latest, windows-latest]
NODE_VERSION: [16]
NODE_VERSION: [18]
fail-fast: true
steps:
# Disable crlf so all OS can share the same Turbo cache
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"

- name: Install dependencies
Expand All @@ -108,12 +108,12 @@ jobs:
strategy:
matrix:
OS: [ubuntu-latest]
NODE_VERSION: [16, 18]
NODE_VERSION: [18, 20]
include:
- os: macos-latest
NODE_VERSION: 16
NODE_VERSION: 18
- os: windows-latest
NODE_VERSION: 16
NODE_VERSION: 18
fail-fast: false
env:
NODE_VERSION: ${{ matrix.NODE_VERSION }}
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
strategy:
matrix:
OS: [ubuntu-latest, windows-latest]
NODE_VERSION: [16]
NODE_VERSION: [18]
fail-fast: false
env:
NODE_VERSION: ${{ matrix.NODE_VERSION }}
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:
strategy:
matrix:
OS: [ubuntu-latest, windows-latest]
NODE_VERSION: [16]
NODE_VERSION: [18]
env:
NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snapshot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
registry-url: "https://registry.npmjs.org"
cache: "pnpm"

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.19.0
18.14.1
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ We welcome contributions of any size and skill level. As an open source project,
### Prerequisites

```shell
node: "^>=16.12.0"
node: "^>=18.14.1"
pnpm: "^8.6.2"
# otherwise, your build will fail
```
Expand Down
4 changes: 2 additions & 2 deletions benchmark/packages/timer/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"include": ["src"],
"compilerOptions": {
"allowJs": true,
"module": "ES2020",
"module": "ES2022",
"outDir": "./dist",
"target": "ES2020"
"target": "ES2022"
}
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"packages/*"
],
"engines": {
"node": ">=16.12.0",
"node": ">=18.14.1",
"pnpm": ">=8.6.2"
},
"packageManager": "pnpm@8.6.2",
Expand Down Expand Up @@ -82,7 +82,7 @@
"@types/node": "^18.16.18",
"@typescript-eslint/eslint-plugin": "6.0.0",
"@typescript-eslint/parser": "6.0.0",
"esbuild": "^0.17.19",
"esbuild": "^0.18.16",
"eslint": "^8.43.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-no-only-tests": "^2.6.0",
Expand All @@ -93,6 +93,6 @@
"prettier-plugin-astro": "^0.10.0",
"tiny-glob": "^0.2.9",
"turbo": "^1.10.3",
"typescript": "~5.0.2"
"typescript": "~5.1.6"
}
}
4 changes: 2 additions & 2 deletions packages/astro-prism/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"homepage": "https://docs.astro.build/en/reference/api-reference/#prism-",
"main": "dist/index.js",
"scripts": {
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
"build": "astro-scripts build \"src/**/*.ts\" && tsc -p ./tsconfig.json",
"build:ci": "astro-scripts build \"src/**/*.ts\"",
"dev": "astro-scripts dev \"src/**/*.ts\""
},
Expand All @@ -39,6 +39,6 @@
"astro-scripts": "workspace:*"
},
"engines": {
"node": ">=16.12.0"
"node": ">=18.14.1"
}
}
2 changes: 1 addition & 1 deletion packages/astro-prism/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"include": ["src"],
"compilerOptions": {
"allowJs": true,
"target": "ES2021",
"target": "ES2022",
"module": "ES2022",
"outDir": "./dist"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/astro-rss/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
"target": "ES2021",
"target": "ES2022",
"strictNullChecks": true
}
}
4 changes: 2 additions & 2 deletions packages/astro/astro.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const CI_INSTRUCTIONS = {
};

// Hardcode supported Node.js version so we don't have to read differently in CJS & ESM.
const engines = '>=16.12.0';
const skipSemverCheckIfAbove = 16;
const engines = '>=18.14.1';
const skipSemverCheckIfAbove = 19;

/** `astro *` */
async function main() {
Expand Down
6 changes: 3 additions & 3 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@
"devalue": "^4.3.2",
"diff": "^5.1.0",
"es-module-lexer": "^1.3.0",
"esbuild": "^0.17.19",
"estree-walker": "3.0.0",
"esbuild": "^0.18.16",
"estree-walker": "^3.0.3",
"execa": "^6.1.0",
"fast-glob": "^3.2.12",
"github-slugger": "^2.0.0",
Expand Down Expand Up @@ -224,7 +224,7 @@
}
},
"engines": {
"node": ">=16.12.0",
"node": ">=18.14.1",
"npm": ">=6.14.0"
}
}
3 changes: 2 additions & 1 deletion packages/astro/src/core/build/plugins/plugin-analyzer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Node as ESTreeNode } from 'estree-walker';
import type { ModuleInfo, PluginContext } from 'rollup';
import type { Plugin as VitePlugin } from 'vite';
import type { PluginMetadata as AstroPluginMetadata } from '../../../vite-plugin-astro/types';
Expand Down Expand Up @@ -36,7 +37,7 @@ async function doesParentImportChild(

const imports: Array<ImportDeclaration> = [];
const exports: Array<ExportNamedDeclaration | ExportDefaultDeclaration> = [];
walk(parentInfo.ast, {
walk(parentInfo.ast as ESTreeNode, {
enter(node) {
if (node.type === 'ImportDeclaration') {
imports.push(node as ImportDeclaration);
Expand Down
3 changes: 2 additions & 1 deletion packages/astro/src/vite-plugin-astro-postprocess/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { parse } from 'acorn';
import type { Node as ESTreeNode } from 'estree-walker';
import { walk } from 'estree-walker';
import MagicString from 'magic-string';
import type { Plugin } from 'vite';
Expand Down Expand Up @@ -28,7 +29,7 @@ export default function astro(): Plugin {
sourceType: 'module',
});

walk(ast, {
walk(ast as ESTreeNode, {
enter(node: any) {
// Transform `Astro.glob("./pages/*.astro")` to `Astro.glob(import.meta.glob("./pages/*.astro"), () => "./pages/*.astro")`
// Also handle for `Astro2.glob()`
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"declarationDir": "./dist",
"module": "ES2022",
"outDir": "./dist",
"target": "ES2021",
"target": "ES2022",
"jsx": "preserve",
"types": ["@types/dom-view-transitions", "network-information-types"]
}
Expand Down
2 changes: 1 addition & 1 deletion packages/create-astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
"strip-json-comments": "^5.0.0"
},
"engines": {
"node": ">=16.12.0"
"node": ">=18.14.1"
}
}
2 changes: 1 addition & 1 deletion packages/create-astro/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"allowJs": true,
"emitDeclarationOnly": false,
"noEmit": true,
"target": "ES2021",
"target": "ES2022",
"module": "ES2022",
"outDir": "./dist",
"declarationDir": "./dist/types"
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/alpinejs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
"target": "ES2021"
"target": "ES2022"
}
}
2 changes: 1 addition & 1 deletion packages/integrations/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"dependencies": {
"@astrojs/underscore-redirects": "^0.2.0",
"@cloudflare/workers-types": "^4.20230518.0",
"esbuild": "^0.17.19",
"esbuild": "^0.18.16",
"tiny-glob": "^0.2.9"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/cloudflare/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
"target": "ES2021"
"target": "ES2022"
}
}
4 changes: 3 additions & 1 deletion packages/integrations/deno/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
"target": "ES2021"
"target": "ES2022",
// TODO: Due to the shim for Deno imports in `server.ts`, we can't use moduleResolution: 'bundler' or the types get very weird.
"moduleResolution": "Node"
}
}
2 changes: 1 addition & 1 deletion packages/integrations/image/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
"target": "ES2021",
"target": "ES2022",
"typeRoots": ["node_modules/@types", "node_modules/@netlify"]
}
}
2 changes: 1 addition & 1 deletion packages/integrations/lit/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
"target": "ES2021"
"target": "ES2022"
}
}
4 changes: 2 additions & 2 deletions packages/integrations/markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@astrojs/internal-helpers": "^0.1.0",
"@astrojs/prism": "^2.1.2",
"@markdoc/markdoc": "^0.3.0",
"esbuild": "^0.17.19",
"esbuild": "^0.18.16",
"github-slugger": "^2.0.0",
"gray-matter": "^4.0.3",
"kleur": "^4.1.5",
Expand All @@ -91,6 +91,6 @@
"vite": "^4.4.6"
},
"engines": {
"node": ">=16.12.0"
"node": ">=18.14.1"
}
}
Loading