dart-tech-index 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 smartyu1993
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # dart-tech-index
2
+
3
+ A reference **skill** for ZCode / Claude that indexes Dart language features, core libraries (`dart:*`), and official tooling (analyzer / pub / devtools / dart format / FFI / JS interop / compiler) — indexed by Dart version, and **only the Stable ones**.
4
+
5
+ > **IRON LAW** of this skill: never list Experimental / Preview features as "ready-to-use" to the user. A capability is included in `versions/*.md` if and only if it is Stable in that version — works out of the box, no `--enable-experiment` flag.
6
+
7
+ Covers **Dart 3.0 through 3.12**.
8
+
9
+ ---
10
+
11
+ ## What this skill is for
12
+
13
+ Trigger it whenever a user is starting or working in a Dart or Flutter project and asks any version-specific question:
14
+
15
+ - "I'm on Dart 3.7, can I use wildcard variables?"
16
+ - "What's new in Dart 3.10?"
17
+ - "Which version added extension types?"
18
+ - "I'm on Dart 3.3 — list every language feature I can use."
19
+ - "How do dot shorthands work? Which Dart version do I need?"
20
+
21
+ It triggers eagerly on any version-specific Dart question — even casual mentions like *"I'm on 3.7, can I use wildcard variables?"*.
22
+
23
+ ## Dart-specific modeling
24
+
25
+ Two things make Dart different from Kotlin/Java, and this skill models both:
26
+
27
+ 1. **Versioned vs unversioned changes.** Versioned features require raising `environment.sdk` lower bound in `pubspec.yaml` (e.g. dot shorthands need `sdk: ^3.10`). Unversioned changes apply to all code after SDK upgrade regardless of lower bound (e.g. 3.0 sound null safety). Every language entry in the data tables is tagged accordingly, and the skill always tells users the `environment.sdk` requirement for versioned features.
28
+ 2. **Empty minors.** Not every Dart minor adds language features (3.1 / 3.5 / 3.9 / 3.11 are "empty" at the language level), but they may still ship tooling/library changes. Each minor gets a file for structural consistency.
29
+
30
+ ## Design principles
31
+
32
+ 1. **Only Stable is indexed.** A capability's "home-version" is the version where it became Stable — not where it was first introduced as Experimental/Preview.
33
+ 2. **Cancelled features are tracked too.** Macros (preview in 3.4, cancelled in 3.7) are flagged so the skill never recommends them.
34
+ 3. **Partial-Stable is explicitly annotated.** When a feature is mostly Stable but has preview subsets (e.g. JS interop model Stable in 3.5 while JNIgen/FFIgen remain preview), the exception is called out — never just labeled "Stable".
35
+ 4. **No `package:` ecosystem.** Only `dart:*` core libraries, the language, and official toolchains. Third-party pub packages (`package:flutter`, `package:riverpod`, etc.) evolve independently of the SDK version.
36
+
37
+ ## Layout
38
+
39
+ ```
40
+ SKILL.md # Query workflow + Iron Law + self-check
41
+ versions/ # One file per Dart minor
42
+ 3.0.md ... 3.12.md
43
+ references/
44
+ deprecation-and-evolution.md # Deprecation map + Experimental→Stable tracker + versioned column
45
+ maintenance.md # Maintainer guide (writing/updating files, standard section structure)
46
+ ```
47
+
48
+ ## Install — and you're done
49
+
50
+ This package is a **skill** (a markdown reference bundle), not a runtime library. Installing it copies the skill directly into your project's `.claude/skills/` directory, so it's immediately usable — no manual copy step.
51
+
52
+ ```bash
53
+ npm install dart-tech-index
54
+ ```
55
+
56
+ What happens on install:
57
+ 1. npm drops the package into `node_modules/dart-tech-index/`.
58
+ 2. The `postinstall` hook runs `init.js`, which copies `SKILL.md` + `versions/` + `references/` into **`<project>/.claude/skills/dart-tech-index/`**.
59
+ 3. Reload your agent — the skill is now available.
60
+
61
+ The installer is **idempotent**: re-running it (or upgrading the package) overwrites in place, so `npm update dart-tech-index` keeps the skill current.
62
+
63
+ ### Manual / `npx` invocation
64
+
65
+ If `postinstall` was skipped (e.g. `--ignore-scripts`, or pnpm/Yarn quirks), install the skill manually:
66
+
67
+ ```bash
68
+ npx dart-tech-index # copies into ./.claude/skills/
69
+ # or
70
+ node ./node_modules/dart-tech-index/init.js
71
+ ```
72
+
73
+ ### Notes
74
+
75
+ - **Project root resolution**: the installer uses `INIT_CWD` (set by npm to the directory where `npm install` was invoked), falling back to `npm_config_local_prefix`, then `process.cwd()`. So `npm install dart-tech-index` from your project root always lands the skill in that project's `.claude/skills/`.
76
+ - **No README/LICENSE/package.json in the skill dir** — only the actual skill payload (`SKILL.md`, `versions/`, `references/`). Keeps the skills folder clean.
77
+
78
+ ## Data sources
79
+
80
+ Each `versions/X.Y.md` cites its source URL at the top:
81
+
82
+ - Dart release announcements: `https://dart.dev/blog/<slug>`
83
+ - Language evolution reference: `https://dart.dev/guides/language/evolution`
84
+ - Dart 3 migration guide: `https://dart.dev/dart-3-migration-guide`
85
+
86
+ ## License
87
+
88
+ [MIT](./LICENSE) © smartyu1993
package/SKILL.md ADDED
@@ -0,0 +1,163 @@
1
+ ---
2
+ name: dart-tech-index
3
+ description: Lookup what Dart language features, core libraries, and tooling (analyzer/pub/devtools/FFI/JS interop) are available AND stable for a given Dart version. Use whenever the user is starting or working in a Dart or Flutter project and asks "what can I use in Dart X.Y", "is Z available in version X.Y", "which version added feature Z", "what's new in Dart X.Y", or wants to know the configuration needed to use a Dart feature. Covers Dart from 3.0 to the latest indexed version. Trigger eagerly on any version-specific Dart question — even casual mentions like "I'm on 3.7, can I use wildcard variables?".
4
+ allowed-tools: Read, Grep, Glob
5
+ ---
6
+
7
+ # Dart 技术索引
8
+
9
+ > **IRON LAW**:永远不要把 Experimental / Preview 特性当作"开箱即用"列给用户。
10
+ > 一项能力被收录进 `versions/*.md` 当且仅当它在那个版本已 Stable——开箱即用、无需实验性 flag。
11
+ > 如果不确定某特性是否 Stable,**先查** `references/deprecation-and-evolution.md` 的"实验性 → Stable 转正追踪表"。
12
+ > 用户在版本 X 看到的每一项,都意味着"X 版本下能直接用"。
13
+ > **若某能力主体 Stable 但含实验性子集,必须显式标注例外**,不能简单标"Stable"(见 Step 4 的 Partial Stable 标注规则)。
14
+
15
+ ## 何时触发本 skill
16
+
17
+ 只要用户的提问里出现"具体 Dart 版本"+"想用什么 / 能用什么"的语义,就应当触发。典型问法:
18
+
19
+ - "我用 Dart 3.7,能不能用 wildcard variables?"
20
+ - "Dart 3.10 有什么新特性?"
21
+ - "extension types 哪个版本加的?"
22
+ - "我是 Dart 3.3,给我列一下这个版本能用的全部语言特性"
23
+ - "dot shorthand 怎么用?需要哪个 Dart 版本?"
24
+
25
+ ## 收录范围(重要边界)
26
+
27
+ **只收录 Dart 语言 / 核心库(`dart:*`)/ 官方工具链(analyzer / pub / devtools / dart format / FFI / JS interop / 编译器)** 中已 Stable 的能力。
28
+
29
+ **不收录**:
30
+ - `package:` 生态(pub.dev 上的第三方包)。这些版本独立于 Dart SDK 演进,遇到相关问题应说明"这是 pub 包的能力,请查对应包的版本页"。
31
+ - IDE 改进、纯文档变更、纯内部重构(除非影响兼容性)。
32
+
33
+ ## Dart 版本机制(关键差异,必读)
34
+
35
+ Dart 与 Kotlin/Java 的版本模型不同,**必须理解以下两点才能正确查询**:
36
+
37
+ 1. **每个 minor(3.0, 3.1, 3.2, ...)都可能引入新语言特性,但不保证每个 minor 都有**——部分 minor 在语言层面是"空版本"(无新语法),但仍可能有工具/库变化。是否为空版本以 `dart.dev/guides/language/evolution` 为准,各版本文件顶部会明确声明。
38
+ 2. **patch 版本(如 3.7.1)只修 bug,不引入语言特性**。查询时一律归并到对应 minor。
39
+ 3. **改动分为 versioned 与 unversioned 两类**:
40
+ - **Versioned changes**:要用该特性,必须在 `pubspec.yaml` 把 `environment.sdk` 下界设到该版本。例:用 dot shorthand 需 `sdk: ^3.10.0`。
41
+ - **Unversioned changes**:升级 SDK 后对所有代码生效,与 `environment.sdk` 下界无关(例:3.0 的 sound null safety、3.9 的 null-safety 默认假设)。
42
+
43
+ > 给用户答版本依赖时,versioned 特性必须说明 `environment.sdk` 下界要求;unversioned 特性只需说明"升级 SDK 后即生效"。
44
+
45
+ ## 数据布局
46
+
47
+ ```
48
+ versions/ 每个 minor 一个文件,命名 X.Y.md(当前已收录 3.0 ~ 3.12,新增版本时更新此行)
49
+ references/
50
+ deprecation-and-evolution.md # 弃用/替换关系 + 实验→Stable 转正追踪表 + 各能力首次 Stable 版本表
51
+ maintenance.md # 维护者指南(写文件、状态图例、决策流、标准章节结构)
52
+ ```
53
+
54
+ **每个版本文件只列出"该 minor 相对前一 minor 新增的、且为 Stable / GA"的能力**。要让"截至某版本可用的全部能力"成立,需要把目标版本**及更早版本**的文件**累加阅读**,并参照 `references/deprecation-and-evolution.md` **剔除已被弃用 / 被取代的部分**。
55
+
56
+ ## 查找规则(按这个顺序执行)
57
+
58
+ ### 步骤 1:解析用户的版本号
59
+
60
+ - 用户给的可能是 `3.7`、`3.7.0`、`3.7.2`、`dart 3.7`,统一规范化为 **minor 版本**:`3.7` / `3.7.0` / `3.7.1` / `3.7.2` → **3.7**(patch 版本归并到 minor)。
61
+ - 用户给 `3` 或 "Dart 3" → 视作 **3.0**(最早版本,按需进一步澄清)。
62
+
63
+ ### 步骤 2:判断用户问的是"能用什么"还是"这个版本新加了什么"
64
+
65
+ | 用户意图 | 处理方式 |
66
+ |---|---|
67
+ | "在 X 版本能用什么 / 能不能用 Z" | **累加视图**:读 X 及更早的全部版本文件,再剔除弃用项 |
68
+ | "X 版本新增了什么 / What's new in X" | **增量视图**:只读 `versions/X.md` 一个文件 |
69
+ | 不确定 / 模糊 | 默认走**累加视图**(这是开发时的主要诉求) |
70
+
71
+ > 关于"能用 Z 吗"的回答边界:如果 Z 在用户版本里仍是实验性,直接答 **"不能用(开箱即用层面)"**,并说明它转正的版本。**不需要教用户怎么开实验性 flag**——本 skill 的立场是不鼓励使用实验性特性。
72
+
73
+ ### 步骤 3:执行查找
74
+
75
+ **累加视图**(最常见):
76
+
77
+ 1. 读 `versions/X.md` 以及 X 之前的所有版本文件
78
+ 2. 读 `references/deprecation-and-evolution.md`
79
+ 3. 合并:把所有版本里的特性拼起来;如果某特性在 X 之后被标记为弃用 / 取代,**从结果里剔除旧形式,只保留新形式**
80
+ 4. 对每条特性标注:来源版本号、状态(Stable)、所需配置(`environment.sdk` 下界 / pubspec 配置)
81
+
82
+ **增量视图**:
83
+
84
+ 1. 只读 `versions/X.md`
85
+ 2. 直接列出该 minor 相对前一 minor 的新增内容
86
+
87
+ **反向查询**("Z 哪个版本加的 / Z 怎么用"):
88
+
89
+ 1. 在 `versions/*.md` 里 grep 关键字 Z
90
+ 2. 找到最早**转 Stable** 的版本(不是首次实验性引入的版本)
91
+ 3. 如有 versioned 依赖,给出 `environment.sdk` 下界要求;**不**给实验性 flag 说明
92
+
93
+ ### 步骤 4:格式化输出
94
+
95
+ 回答用户时按下面的结构:
96
+
97
+ ```
98
+ ## Dart <版本> — <视图类型:可用能力 / 新增特性>
99
+
100
+ ### 语言特性
101
+ - <特性名>(<来源版本>,Stable)— <一句话说明>(来源:announcing-dart-3-X)
102
+ - 配置:`environment.sdk: ^<版本>`(仅 versioned 特性需要)
103
+
104
+ ### 核心库
105
+ - ...
106
+
107
+ ### 工具链 / 平台
108
+ - ...
109
+
110
+ ### 已弃用,新代码不要用(仅当用户在累加视图中可能踩坑时给出)
111
+ - ...
112
+ ```
113
+
114
+ 引用格式示例:
115
+ - `Records`(3.0,Stable)— 聚合多值为单一返回值(来源:announcing-dart-3)
116
+ - `Extension types`(3.3,Stable)— 零成本包装类型,`environment.sdk: ^3.3.0`(来源:new-in-dart-3-3)
117
+
118
+ **Partial Stable 标注示例**(规则见 Iron Law):
119
+ - `JS interop 模型`(3.5,Stable — `dart:js_interop` + `package:web` 已 Stable,但 JNIgen/FFIgen 仍 preview)
120
+
121
+ 只在用户实际可能会踩到时才列"已弃用"段,避免信息过载。
122
+
123
+ > 类别归组参考 `references/deprecation-and-evolution.md` 的"各能力首次 Stable 版本"表的"类别"列:**语言** → "语言特性"段;**核心库** → "核心库"段;**工具链/平台** → "工具链 / 平台"段。
124
+
125
+ ### 步骤 5:交付前自检 ⚠️ REQUIRED
126
+
127
+ 输出前逐条核对:
128
+ - [ ] 累加视图下,是否读完了目标版本及更早的**全部** `versions/*.md`?
129
+ - [ ] 是否对照了 `references/deprecation-and-evolution.md` 剔除弃用项?
130
+ - [ ] 列出的每一项是否都是 Stable(无实验性 flag)?
131
+ - [ ] 每项是否标注了来源版本号?
132
+ - [ ] 涉及的内容是否限定在 Dart 语言 / `dart:*` / 官方工具链(没有混入 `package:` 生态)?
133
+ - [ ] **Partial Stable 检查**:是否有主体 Stable 但含实验子集的能力?如有,是否显式标注了例外?
134
+ - [ ] **versioned vs unversioned**:列出的语言特性如果是 versioned,是否标注了 `environment.sdk` 下界要求?
135
+ - [ ] **反向查询特有**:返回的是特性"转 Stable 的版本",不是"首次实验性引入的版本"?(例:答 `extension types` 应是 3.3)
136
+
137
+ 如有任何一项答"No",重做对应步骤。
138
+
139
+ ## 关键约定
140
+
141
+ 1. **只收录 Stable / GA**。Experimental / Preview 一律**不进入** `versions/*.md`。一项能力的归属版本 = 它转正的那个版本。
142
+ 2. **同一能力若存在新旧两种形式**(如 `dart:html` vs `package:web`),只把新形式列在被查询版本的可用清单里,把旧形式放进 `references/deprecation-and-evolution.md`。
143
+ 3. **patch 版本(如 3.7.1)不单独建文件**。它们沿用相同 minor 的版本文件(3.7)。
144
+ 4. **minor 版本一律建文件**,即使该 minor 在语言层面是"空版本"(如 3.1/3.5/3.9/3.11)——因为它们可能有工具/库变化,且文件存在能保持结构一致、便于累加视图遍历。
145
+ 5. **数据来源 URL 必须在每个版本文件顶部标注**。优先用 `dart.dev/blog/<slug>`(release announcement),语言特性以 `dart.dev/guides/language/evolution` 交叉校验。
146
+ 6. **收录范围只含 Dart 语言 / `dart:*` / 官方工具链**。`package:` 生态版本独立于 Dart SDK 演进,不在本 skill 范围。
147
+ 7. **versioned vs unversioned 必须区分**:versioned 语言特性在文件里标注 `environment.sdk: ^X.Y.0`;unversioned 改动标注"升级 SDK 即生效,与 sdk 下界无关"。
148
+ 8. **版本文件的 Stable 正文段里出现 "experimental / preview / experimental flag / `--enable-experiment`" 字样,视为可疑信号**——很可能是该条目本不该收录,或需要按 partial-Stable 规则标注例外。写/校对版本文件时的完整清单见 `references/maintenance.md`。
149
+
150
+ ## Anti-patterns(不要做)
151
+
152
+ - ❌ 把 Experimental / Preview 特性列为"可用",哪怕它在用户版本里存在
153
+ - ❌ 教用户用 `--enable-experiment=xxx` 开启实验特性(本 skill 立场:不鼓励)
154
+ - ❌ 把 `package:` 生态包(如 `package:flutter`、`package:riverpod`)的版本混入 Dart SDK 版本判断
155
+ - ❌ 在没确认用户版本号时就开始答题(先问)
156
+ - ❌ 把 patch 版本(如 3.7.1)当成独立 minor 对待
157
+ - ❌ 把特性"首次实验性引入的版本"当作它的归属版本(要用"转 Stable 的版本")
158
+ - ❌ 对 versioned 特性不告知 `environment.sdk` 下界要求就答"能用"
159
+ - ❌ 推荐已 cancelled 的实验特性(如 macros,3.7 已叫停)
160
+
161
+ ## 维护
162
+
163
+ 新增版本文件、追踪实验特性转正等维护流程,见 `references/maintenance.md`。
package/init.js ADDED
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ /**
5
+ * dart-tech-index — skill installer
6
+ *
7
+ * Copies the skill assets (SKILL.md + versions/ + references/) from this
8
+ * package into `<projectRoot>/.claude/skills/dart-tech-index/`, so the
9
+ * skill is immediately usable by ZCode / Claude agents reading from that
10
+ * skills directory.
11
+ *
12
+ * Triggered in two ways:
13
+ * 1. Automatically via the npm `postinstall` script (run `npm install dart-tech-index`).
14
+ * 2. Manually via the `bin` entry: `npx dart-tech-index` or `node ./node_modules/dart-tech-index/init.js`.
15
+ *
16
+ * Project root resolution order:
17
+ * - INIT_CWD (set by npm to the dir where `npm install` was invoked)
18
+ * - npm_config_local_prefix (npm's own anchor for the install root)
19
+ * - process.cwd() (fallback for `npx`/direct invocation)
20
+ *
21
+ * The install is idempotent — re-running overwrites in place, which is the
22
+ * desired behavior for upgrades.
23
+ */
24
+
25
+ const fs = require('fs');
26
+ const path = require('path');
27
+
28
+ const pkgRoot = __dirname;
29
+ const projectRoot =
30
+ process.env.INIT_CWD ||
31
+ process.env.npm_config_local_prefix ||
32
+ process.cwd();
33
+ const target = path.join(projectRoot, '.claude', 'skills', 'dart-tech-index');
34
+
35
+ // Only the skill payload is copied — not README/LICENSE/package.json,
36
+ // which don't belong in a skills directory.
37
+ const ASSETS = ['SKILL.md', 'versions', 'references'];
38
+
39
+ function copyRecursive(src, dest) {
40
+ const stat = fs.statSync(src);
41
+ if (stat.isDirectory()) {
42
+ fs.mkdirSync(dest, { recursive: true });
43
+ for (const entry of fs.readdirSync(src)) {
44
+ copyRecursive(path.join(src, entry), path.join(dest, entry));
45
+ }
46
+ } else {
47
+ fs.mkdirSync(path.dirname(dest), { recursive: true });
48
+ fs.copyFileSync(src, dest);
49
+ }
50
+ }
51
+
52
+ function main() {
53
+ // Guard: if SKILL.md isn't present, fail loudly rather than silently
54
+ // installing an empty skill directory.
55
+ if (!fs.existsSync(path.join(pkgRoot, 'SKILL.md'))) {
56
+ console.error('dart-tech-index: SKILL.md not found in package — aborting install.');
57
+ process.exit(1);
58
+ }
59
+
60
+ fs.mkdirSync(target, { recursive: true });
61
+ for (const asset of ASSETS) {
62
+ const src = path.join(pkgRoot, asset);
63
+ if (fs.existsSync(src)) {
64
+ copyRecursive(src, path.join(target, asset));
65
+ }
66
+ }
67
+
68
+ console.log(`dart-tech-index: skill installed → ${target}`);
69
+ console.log('dart-tech-index: reload your agent to start using it.');
70
+ }
71
+
72
+ main();
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "dart-tech-index",
3
+ "version": "0.1.0",
4
+ "description": "A ZCode/Claude skill that indexes Dart language features, core libraries, and tooling (analyzer/pub/devtools/FFI/JS interop) by Dart version — only Stable, never Experimental/Preview. Covers Dart 3.0 through 3.12. Install-and-use: copies itself into .claude/skills on install.",
5
+ "keywords": [
6
+ "dart",
7
+ "dart-version",
8
+ "dart-sdk",
9
+ "whats-new",
10
+ "language-features",
11
+ "dart-3",
12
+ "flutter",
13
+ "versioned",
14
+ "stable",
15
+ "reference",
16
+ "skill",
17
+ "claude-skill",
18
+ "zcode-skill",
19
+ "agent-skill",
20
+ "llm"
21
+ ],
22
+ "license": "MIT",
23
+ "author": "smartyu1993",
24
+ "homepage": "https://www.npmjs.com/package/dart-tech-index",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": ""
28
+ },
29
+ "bin": {
30
+ "dart-tech-index": "./init.js"
31
+ },
32
+ "scripts": {
33
+ "postinstall": "node ./init.js"
34
+ },
35
+ "files": [
36
+ "SKILL.md",
37
+ "versions/",
38
+ "references/",
39
+ "init.js",
40
+ "README.md",
41
+ "LICENSE"
42
+ ],
43
+ "main": "SKILL.md",
44
+ "zcode": {
45
+ "type": "skill",
46
+ "skill": "dart-tech-index"
47
+ }
48
+ }
@@ -0,0 +1,88 @@
1
+ # Dart 特性演化、弃用与实验性追踪
2
+
3
+ - **数据来源**: 汇总自 `dart.dev/blog/<slug>` 各版本公告 + `dart.dev/guides/language/evolution` + `dart.dev/dart-3-migration-guide`
4
+ - **用途**:
5
+ - 查询时:判断某特性在某版本是否能"开箱即用",并据此剔除弃用项
6
+ - 维护时:知道哪项实验特性转正时该补进哪个 `versions/*.md`(维护流程见 `maintenance.md`)
7
+
8
+ > **收录原则**:`versions/*.md` 只收录 Stable。本文档的"实验性 → Stable 转正追踪表"列出**尚未收录**的实验特性。
9
+
10
+ ## 一、重大版本节点
11
+
12
+ | 时期 | 状态 |
13
+ |---|---|
14
+ | Dart 2.x 及以前 | 不在本 skill 范围(收录从 3.0 起) |
15
+ | **Dart 3.0**(2023-05)| 里程碑:强制 100% sound null safety;删除 2.12 之前语言版本支持。Records / Patterns / Class modifiers / Switch expressions / If-case 全部 Stable |
16
+ | Dart 3.x 后续 minor | 每 minor 按需引入新语言特性(versioned)或行为变更(unversioned) |
17
+
18
+ ## 二、弃用 / 替换关系(已 Stable 的能力之间的新旧形式)
19
+
20
+ | 旧形式 | 新形式 | 切换版本 | 备注 |
21
+ |---|---|---|---|
22
+ | `dart:html` / `dart:js` / `dart:js_util` / `package:js` | `dart:js_interop` + `package:web` | **3.3 引入 / 3.5 Stable** | 3.5 起旧 JS interop 库进入弃用路线,新代码用 `dart:js_interop` + `package:web` |
23
+ | 可选命名参数默认值分隔符 `:` | `=` | **3.0** | 3.0 起用 `:` 是编译错误(例:`{int x = 0}` 而非 `{int x: 0}`) |
24
+ | 不带 `mixin` 修饰符的 class 当 mixin 用 | `mixin class` 修饰符 | **3.0** | 3.0 起普通 class 不能再当 mixin 用 |
25
+ | `continue` 指向任意 label | 只能指向 loop / switch member label | **3.0** | 3.0 起其它情况是编译错误 |
26
+ | pre-2.12 语言版本(混合 null safety / unsound) | 100% sound null safety | **3.0** | 3.0 SDK 删除 2.12 之前语言版本支持 |
27
+ | `package:lints` 2.x | `package:lints` 3.0 | **3.2** | core 集新增 6 条 lint,recommended 集新增 2 条 |
28
+ | 旧 macros 路线(`@JsonCodable()` 等) | **已 cancelled**(无替代,回退到手写 / codegen 包) | **3.7 叫停** | 3.4 preview,3.7 正式宣告停止 |
29
+
30
+ ## 三、新代码不应再用的特性(即使能编译)
31
+
32
+ - ❌ `dart:html` / `dart:js` / `dart:js_util` / `package:js`(→ `dart:js_interop` + `package:web`,3.5+)
33
+ - ❌ 命名参数默认值用 `:`(→ `=`,3.0+)
34
+ - ❌ 普通 class 当 mixin(→ `mixin class`,3.0+)
35
+ - ❌ `continue` 指向非 loop / 非 switch label(3.0+ 编译错误)
36
+ - ❌ 依赖 pre-2.12 语言版本(3.0 SDK 已删除支持)
37
+ - ❌ 任何 macros 相关代码(3.7 已叫停,不会稳定)
38
+
39
+ ## 四、各能力首次 Stable 版本(已收录进 versions/*.md 的)
40
+
41
+ > 类别:**语言** = 语言特性;**核心库** = `dart:*` 库;**工具链/平台** = analyzer/pub/devtools/format/FFI/JS interop/编译器等。
42
+
43
+ | 能力 | 类别 | Stable 版本 | versioned? |
44
+ |---|---|---|---|
45
+ | Patterns(匹配与解构) | 语言 | 3.0 | versioned(sdk: ^3.0) |
46
+ | Records(聚合类型) | 语言 | 3.0 | versioned(sdk: ^3.0) |
47
+ | Class modifiers(`base`/`final`/`interface`/`mixin class`/`sealed`) | 语言 | 3.0 | versioned(sdk: ^3.0) |
48
+ | Switch expressions | 语言 | 3.0 | versioned(sdk: ^3.0) |
49
+ | If-case clauses | 语言 | 3.0 | versioned(sdk: ^3.0) |
50
+ | 100% sound null safety | 语言 | 3.0 | unversioned(升级 SDK 即强制) |
51
+ | Private final field promotion | 语言 | 3.2 | versioned(sdk: ^3.2) |
52
+ | Extension types | 语言 | 3.3 | versioned(sdk: ^3.3) |
53
+ | `dart:js_interop` 库 + `package:web` | 核心库 / 工具链 | 3.3(3.5 整体 Stable) | unversioned |
54
+ | Flutter Web WasmGC 稳定 | 工具链/平台 | 3.4 | unversioned |
55
+ | Digit separators | 语言 | 3.6 | versioned(sdk: ^3.6) |
56
+ | Pub workspaces(monorepo) | 工具链/平台 | 3.6 | versioned(sdk: ^3.6) |
57
+ | Wildcard variables(`_` 非绑定占位符) | 语言 | 3.7 | versioned(sdk: ^3.7) |
58
+ | Dart format "tall" 样式 | 工具链/平台 | 3.7 | unversioned |
59
+ | Null-aware elements(`?expr` 集合元素) | 语言 | 3.8 | versioned(sdk: ^3.8) |
60
+ | 跨平台交叉编译(`dart compile exe --target-os`) | 工具链/平台 | 3.8 | unversioned |
61
+ | Dart MCP Server(stable channel) | 工具链/平台 | 3.9 | unversioned |
62
+ | Dot shorthands(`.foo` 上下文推断) | 语言 | 3.10 | versioned(sdk: ^3.10) |
63
+ | Analyzer plugin system | 工具链/平台 | 3.10 | unversioned |
64
+ | Pub workspaces glob(`workspace: - pkg/*`) | 工具链/平台 | 3.11 | versioned(sdk: ^3.11) |
65
+ | Private named parameters | 语言 | 3.12 | versioned(sdk: ^3.12) |
66
+ | Agentic Hot Reload | 工具链/平台 | 3.12 | unversioned |
67
+
68
+ ## 五、🎯 实验性 → Stable 转正追踪表(**尚未收录**进 versions/*.md)
69
+
70
+ > 这些特性在 Dart 历史上**以 experimental / preview 形式存在**,但截至最新已收录版本(3.12)**仍未转正或仅部分转正**。它们**不会出现在任何 `versions/*.md` 正文段**。
71
+ >
72
+ > 当其中某项在版本 N 正式 Stable 后:
73
+ > 1. 把它从这张表移除(或调整描述为"仅余 X 部分实验性")
74
+ > 2. 写入 `versions/N.md`
75
+ > 3. 同时加入上方"各能力首次 Stable 版本"表
76
+
77
+ | 特性 | 首次引入版本 | 当前状态(截至 3.12) | 转正条件 / 备注 |
78
+ |---|---|---|---|
79
+ | **Primary constructors** | 3.12(experimental preview) | experimental(`--enable-experiment=primary-constructors`) | 转 Stable 后写入对应版本文件 |
80
+ | **Macros** | 3.4(preview) | **已 cancelled**(3.7 叫停) | **不会再转正**,新代码不要依赖;用 codegen 包替代 |
81
+ | **JNIgen**(Java/Kotlin 互操作) | 3.5(preview) | preview(性能改进、支持 Java 异常和 Kotlin 顶级函数) | 转 Stable 后写入;旧 C-based 绑定已停用 |
82
+ | **FFIgen**(Objective-C 互操作) | 3.5(preview) | preview(支持 protocols、NSString 等) | 转 Stable 后写入 |
83
+ | **Genkit Dart**(full-stack AI 应用框架) | 3.12(preview) | preview | 转 Stable 后写入 |
84
+ | **Cloud Functions for Firebase(Dart)** | 3.12(preview) | preview | 转 Stable 后写入 |
85
+
86
+ ## 六、状态判定与决策流
87
+
88
+ 见 `maintenance.md` 的"状态标记图例"与"判断是否收录的决策流"。本文件不再重复,避免维护时多处同步。
@@ -0,0 +1,72 @@
1
+ # 维护者指南
2
+
3
+ 本文件面向**维护 skill 数据的人**(不是查询时的模型)。SKILL.md 只保留了查询必需的规则,写文件、状态判定、转正流程等维护细节集中在这里。
4
+
5
+ ## 一、收录原则(写文件时遵守)
6
+
7
+ **只收录 Stable / GA**。Experimental / Preview 一律不进入 `versions/*.md`。
8
+
9
+ 一项能力的归属版本 = **它转 Stable 的那个版本**,不是它首次出现的实验性版本。当某项实验性特性在版本 N 正式 Stable 后,才把它写入 `versions/N.md`。
10
+
11
+ 这是用户决定"开发时能不能直接用"的唯一依据——用户用 X 版本时,文件里列出的每一项都应当**开箱即用、无需 `--enable-experiment` 实验性 flag**。
12
+
13
+ ## 二、状态标记图例
14
+
15
+ - **Stable / GA**:可直接使用,无需实验性 flag → **可收录进 versions/*.md**
16
+ - **Experimental**:需 `--enable-experiment=xxx` flag → **不收录**,进 `deprecation-and-evolution.md` 的追踪表
17
+ - **Preview**:官方放出但明确未稳定,可能调整或取消 → **不收录**,进追踪表
18
+ - **Cancelled**:曾 preview 但已被官方叫停 → **不收录**,在追踪表标注"已 cancelled"以防误推荐
19
+
20
+ ## 三、判断"是否收录"的决策流
21
+
22
+ ```
23
+ 某项能力出现
24
+
25
+ ├─ 在该版本是 Stable / GA 吗?
26
+ │ ├─ 是 → 写入 versions/X.md
27
+ │ └─ 否(Experimental/Preview/Cancelled)→ 不收录,写入追踪表
28
+
29
+ └─ 用户用它需要 --enable-experiment 或 preview flag 吗?
30
+ ├─ 不需要 → 可收录
31
+ └─ 需要 → 不收录
32
+ ```
33
+
34
+ ## 四、写版本文件的清单
35
+
36
+ 每当 Dart 发布新的 **minor 版本**(如 3.13):
37
+
38
+ 1. 在 `versions/` 新增 `3.13.md`,顶部写明发布日期与数据来源 URL(`https://dart.dev/blog/<slug>`)。
39
+ 2. 抓取官方 release announcement 博文,**只提取 Stable 条目**写入正文。语言特性以 `dart.dev/guides/language/evolution` 交叉校验。
40
+ 3. 把本版本仍为 experimental / preview 的特性写入"不收录(实验性 / preview,转正后再写)"段,注明预期转正版本或指向追踪表。
41
+ 4. 如果本版本没有新的实验性特性,也要写"不收录"段并标注"无",保持结构一致。
42
+ 5. 如果某项历史实验特性在**本版本转正**:从 `deprecation-and-evolution.md` 的追踪表移除,写入本文件;同时把它加入"各能力首次 Stable 版本"表。
43
+ 6. **自查 1(开箱即用)**:"这文件正文段里所有条目,用户**不**需要任何 `--enable-experiment` flag 就能直接用吗?" 如果不是,那一条不该出现在正文段。
44
+ 7. **自查 2(新 Stable vs 渐进改进)**:"正文段的每一条,是否都是**在本版本首次 Stable 的能力**,而不是对已 Stable 能力的渐进改进?" 如果只是"改进已 Stable 的能力"(如某版本对早已 Stable 的 patterns 加边缘支持),不应单独作为一条 Stable 条目列出。处理方式:并入汇总条目并明确写"自 X.Y 起 Stable,本版本补充…",或精简掉。
45
+ 8. **自查 3(章节结构一致)**:使用下面这套标准二级标题,按需出现的留下,无内容的省略。**不要**为单个版本自创二级标题。
46
+ 9. **自查 4(versioned vs unversioned)**:每条语言特性必须判定是 versioned 还是 unversioned。versioned 的标注 `environment.sdk: ^X.Y.0`;unversioned 的标注"升级 SDK 即生效"。
47
+
48
+ ### 标准章节结构
49
+
50
+ ```
51
+ ## 语言特性 (Language) # 该版本新转 Stable 的语言能力(versioned 标注 sdk 下界);unversioned 语言行为变更也放这里(标注"升级 SDK 即生效")
52
+ ## 核心库 (Core libraries) # 该版本新转 Stable 的 dart:* 库 API
53
+ ## 工具链 / 平台 # 旗下三级标题:### Analyzer / ### Pub / ### DevTools / ### Dart format / ### FFI / ### JS interop / ### 编译器 / ### Web / ### MCP
54
+ ## 破坏性变更 # 仅在有破坏性变更时出现
55
+ ## 不收录(实验性 / preview,转正后再写)
56
+ ```
57
+
58
+ > 工具能力统一放在 `## 工具链 / 平台` 下作为三级标题。`## 破坏性变更` 是允许的特殊段,仅在有破坏性变更时使用(3.0 这种大版本尤其重要)。
59
+ >
60
+ > `## 语言特性` 段可含 **unversioned 的语言行为变更**(如 3.9 的 null-safety 默认假设)——这类变更本质仍是"语言层面"的事,归在语言特性段合理,但必须标注"升级 SDK 即生效,与 `environment.sdk` 下界无关"以区别于 versioned 特性。
61
+
62
+ ## 五、弃用 / 替换关系维护
63
+
64
+ 新旧形式替换(如 `dart:html` → `package:web`)更新到 `deprecation-and-evolution.md` 的"弃用 / 替换关系"表,保持单一来源。在累加视图中,**只把新形式列在被查询版本的可用清单里**。
65
+
66
+ ## 六、定期校对(参考型 skill 最易随时间失效)
67
+
68
+ - **每发布新的 minor 版本**(约每季度),抓取对应 `dart.dev/blog/<slug>`,更新 `versions/<新版本>.md`。
69
+ - **每年至少一次**校对最新 1~2 个版本文件的发布日期与特性清单,对照官方 blog / evolution 页面核对。
70
+ - 校对时优先关注"上一版还在追踪表里的实验特性"是否已转正——这是最容易遗漏的更新路径。
71
+ - 特别留意 **cancelled 特性**(如 macros):一旦官方叫停,立即在追踪表标注,避免向用户推荐。
72
+ - 注意官方页面迁移:`dart.dev/guides/language/evolution` 已标 deprecated,未来可能完全移除,届时需改用 `github.com/dart-lang/sdk/CHANGELOG.md` 作为语言特性的交叉校验源。
@@ -0,0 +1,78 @@
1
+ # Dart 3.0
2
+
3
+ - **发布日期**: 2023-05-10
4
+ - **数据来源**: https://dart.dev/blog/announcing-dart-3 + https://dart.dev/dart-3-migration-guide + https://dart.dev/guides/language/evolution
5
+ - **类型**: 重大版本(Major)
6
+
7
+ > **里程碑**:Dart 3。强制 100% sound null safety;引入 Patterns / Records / Class modifiers / Switch expressions / If-case 五大 Stable 语言特性。本文件列出 3.0 **新转 Stable** 的能力。
8
+
9
+ ## 语言特性 (Language)
10
+
11
+ ### Patterns — Stable(versioned,`environment.sdk: ^3.0`)
12
+ 全新的语法类别,用于匹配与解构值。包含:
13
+ - **逻辑运算符 patterns**:`&&`、`||`
14
+ - **关系 patterns**:`==`、`!=`、`<`、`>`、`<=`、`>=`
15
+ - **cast pattern**:`foo as int`
16
+ - **null-check pattern**:`case int? x`(匹配非 null int 并绑定 x;为 null 时不匹配,不抛异常)
17
+ - **null-assert pattern**:`case int! x`(匹配非 null int 并绑定 x;为 null 时抛异常)
18
+ - **constant patterns**:字面量、枚举值等
19
+
20
+ ```dart
21
+ switch (shape) {
22
+ case Square(area: final a): print('square, area $a');
23
+ case Circle(radius: final r): print('circle, radius $r');
24
+ }
25
+ ```
26
+
27
+ ### Records — Stable(versioned,`environment.sdk: ^3.0`)
28
+ 聚合多个不同类型值为单一返回值的类型,无需声明类。
29
+
30
+ ```dart
31
+ (String, int) userInfo() => ('Alice', 42); // positional record
32
+ ({String name, int age}) mkPerson() => (name: 'Bob', age: 30); // named record
33
+ ```
34
+
35
+ ### Class modifiers — Stable(versioned,`environment.sdk: ^3.0`)
36
+ 控制类 / mixin / 接口的使用方式:
37
+ - `base class`:禁止被 `implements`,只允许 `extends`
38
+ - `interface class`:禁止被 `extends`,只允许 `implements`
39
+ - `final class`:禁止 `extends` 和 `implements`
40
+ - `sealed class`:同库外的子类必须在同一库声明,配合 switch 穷尽性检查
41
+ - `mixin class`:可同时作为 class 和 mixin 使用
42
+ - `base mixin` / `mixin interface` 等
43
+
44
+ ### Switch expressions — Stable(versioned,`environment.sdk: ^3.0`)
45
+ 可用于表达式位置的多路分支:
46
+ ```dart
47
+ final desc = switch (color) {
48
+ Color.red => 'red',
49
+ Color.green => 'green',
50
+ Color.blue => 'blue',
51
+ };
52
+ ```
53
+
54
+ ### If-case clauses — Stable(versioned,`environment.sdk: ^3.0`)
55
+ 把值与 pattern 匹配的新的条件构造:
56
+ ```dart
57
+ if (pair case (int x, int y)) print('two ints: $x, $y');
58
+ ```
59
+
60
+ ### 100% sound null safety — Stable(unversioned,升级 SDK 即强制)
61
+ Dart 3 强制启用 sound null safety;**SDK 删除了对 2.12 之前语言版本的支持**。所有代码必须在 null-safe 下编译,无法关闭。
62
+
63
+ ## 工具链 / 平台
64
+
65
+ ### Web
66
+ - WasmGC 路线启动(实验性,3.4 才稳定)
67
+
68
+ ## 破坏性变更
69
+
70
+ - ❌ **没有 `mixin class` 修饰符的 class 声明不能再被当作 mixin使用**(需显式 `mixin class`)
71
+ - ❌ **可选命名参数默认值前的分隔符从 `:` 改为 `=`**(用 `:` 现为编译错误)
72
+ - ❌ **`continue` 指向非 loop / 非 switch member 的 label 现为编译错误**
73
+ - ❌ **删除对 pre-2.12 语言版本的支持**(unsound null safety 不再可用)
74
+ - 多个 core library API 被移除或加上 `extends`/`implements` 限制(详见 dart-3-migration-guide)
75
+
76
+ ## 不收录(实验性 / preview,转正后再写)
77
+
78
+ 无(3.0 引入的语言特性均直接 Stable;WasmGC 当时实验性,3.4 转 Stable 后已收录进 `versions/3.4.md`)。
@@ -0,0 +1,15 @@
1
+ # Dart 3.1
2
+
3
+ - **发布日期**: 2023-08-16
4
+ - **数据来源**: https://dart.dev/blog/dart-3-1-a-retrospective-on-functional-style-programming-in-dart-3
5
+ - **类型**: Incremental release
6
+
7
+ > **说明**:3.1 在**语言层面是空版本**——evolution 页明确写明 "Dart 3.1 added no new features and made no changes to the language"。本文件只列工具/库的 Stable 增量。
8
+
9
+ ## 工具链 / 平台
10
+
11
+ 本版本无新的 Stable 工具链能力(仅有 SDK 常规 bug 修复与 core library API 调整,详见 changelog)。同期 Flutter 3.13 发布。
12
+
13
+ ## 不收录(实验性 / preview,转正后再写)
14
+
15
+ 无。
@@ -0,0 +1,38 @@
1
+ # Dart 3.10
2
+
3
+ - **发布日期**: 2025-11-12
4
+ - **数据来源**: https://dart.dev/blog/announcing-dart-3-10 + https://dart.dev/guides/language/evolution
5
+ - **类型**: Incremental release(含 1 项新语言特性)
6
+
7
+ ## 语言特性 (Language)
8
+
9
+ ### Dot shorthands — Stable(versioned,`environment.sdk: ^3.10`)
10
+ 当上下文类型可推断时,可省略显式类型名,写作 `.foo`。可用于:
11
+ - **enum 值**:`Status currentStatus = .running;`
12
+ - **静态成员**:`int port = .parse('8080');`(即 `int.parse('8080')`)
13
+ - **构造函数**:`Point origin = .origin();`(即 `Point.origin()`)
14
+
15
+ ```dart
16
+ enum Status { idle, running, stopped }
17
+ Status s = .running; // 推断为 Status.running
18
+ List<int> nums = [.parse('1'), .parse('2')]; // 推断为 int.parse
19
+ ```
20
+
21
+ ## 核心库 (Core libraries)
22
+
23
+ ### 注解
24
+ - 新增更细粒度的 deprecation 注解(`@Deprecated` 的细化版本)
25
+
26
+ ## 工具链 / 平台
27
+
28
+ ### Analyzer
29
+ - **Analyzer plugin system**(Stable):可在 `analysis_options.yaml` 注册自定义静态分析规则
30
+
31
+ ### Pub
32
+ - **Build hooks**(Stable):native 构建钩子
33
+ - profile "Likes" tab 搜索
34
+ - 可禁用手动 publishing(仅 verified publishers)
35
+
36
+ ## 不收录(实验性 / preview,转正后再写)
37
+
38
+ 无。
@@ -0,0 +1,23 @@
1
+ # Dart 3.11
2
+
3
+ - **发布日期**: 2026-02-11
4
+ - **数据来源**: https://dart.dev/blog/announcing-dart-3-11 + https://dart.dev/guides/language/evolution
5
+ - **类型**: Incremental release(语言层面无新特性)
6
+
7
+ > **说明**:3.11 在**语言层面是空版本**(evolution 页未列出新特性)。本文件只列工具/库的 Stable 增量。
8
+
9
+ ## 工具链 / 平台
10
+
11
+ ### MCP
12
+ - Dart MCP Server 新增 `read_package_uris` 工具
13
+
14
+ ### Analyzer
15
+ - Analysis server:fine-grained dependencies、缓存 plugin entry points、提升 dot shorthands 的 completion/quick-fix
16
+
17
+ ### Pub
18
+ - **workspaces 支持 glob**:`workspace: - pkg/*`(versioned,需 `environment.sdk: ^3.11`;workspaces 主体自 3.6 起 Stable,3.11 新增 glob 语法)—— 子包路径可用 glob 批量声明
19
+ - 新增 `dart pub cache gc` 清理缓存
20
+
21
+ ## 不收录(实验性 / preview,转正后再写)
22
+
23
+ 无。
@@ -0,0 +1,27 @@
1
+ # Dart 3.12
2
+
3
+ - **发布日期**: 2026-05-18(博客发布 2026-05-20)
4
+ - **数据来源**: https://dart.dev/blog/announcing-dart-3-12 + https://dart.dev/guides/language/evolution
5
+ - **类型**: Incremental release(含 1 项新语言特性 + AI 工具链里程碑)
6
+
7
+ ## 语言特性 (Language)
8
+
9
+ ### Private named parameters — Stable(versioned,`environment.sdk: ^3.12`)
10
+ 私有字段的命名初始化形式参数,编译器自动去掉前导 `_` 作为调用方的公开名:
11
+ ```dart
12
+ class Person {
13
+ final String _name;
14
+ Person({required this._name}); // 调用方写 Person(name: 'Alice')
15
+ }
16
+ ```
17
+
18
+ ## 工具链 / 平台
19
+
20
+ ### DevTools
21
+ - **Agentic Hot Reload**:与 AI agent 协作的热重载
22
+
23
+ ## 不收录(实验性 / preview,转正后再写)
24
+
25
+ - **Primary constructors**(experimental)—— `class Point(final int x, final int y);`,需 `--enable-experiment=primary-constructors`。转 Stable 后写入对应版本文件。
26
+ - **Genkit Dart**(preview)
27
+ - **Cloud Functions for Firebase(Dart)**(preview)
@@ -0,0 +1,31 @@
1
+ # Dart 3.2
2
+
3
+ - **发布日期**: 2023-11-15
4
+ - **数据来源**: https://dart.dev/blog/announcing-dart-3-2 + https://dart.dev/guides/language/evolution
5
+ - **类型**: Incremental release(含 1 项新语言特性)
6
+
7
+ ## 语言特性 (Language)
8
+
9
+ ### Private final field promotion — Stable(versioned,`environment.sdk: ^3.2`)
10
+ type promotion 从局部变量/参数扩展到 **private final 字段**。编译器能在 null 检查后自动把 `field?.value` 里的 field 提升为非空,无需手动 `final x = _field!`。
11
+
12
+ > 仅适用于 private + final 字段(public 字段会被外部子类覆盖,不能提升)。
13
+
14
+ 同时修复了 if-case 抛异常时 type promotion 的不一致行为。
15
+
16
+ ## 核心库 (Core libraries)
17
+
18
+ ### `package:lints`(官方维护的事实标准 lint 集)
19
+ - **`package:lints` 3.0**:core 集新增 6 条 lint,recommended 集新增 2 条
20
+
21
+ ## 工具链 / 平台
22
+
23
+ ### FFI
24
+ - 新增 `NativeCallable.isolateLocal` 构造器(Stable)
25
+
26
+ ### DevTools
27
+ - 支持 extensions
28
+
29
+ ## 不收录(实验性 / preview,转正后再写)
30
+
31
+ - Web/Wasm 路线图相关特性 —— 当时仍 preview,3.4 WasmGC 转 Stable 后已收录进 `versions/3.4.md`
@@ -0,0 +1,34 @@
1
+ # Dart 3.3
2
+
3
+ - **发布日期**: 2024-02-15
4
+ - **数据来源**: https://dart.dev/blog/new-in-dart-3-3-extension-types-javascript-interop-and-more + https://dart.dev/guides/language/evolution
5
+ - **类型**: Incremental release(含 1 项新语言特性 + 重要 interop 模型)
6
+
7
+ ## 语言特性 (Language)
8
+
9
+ ### Extension types — Stable(versioned,`environment.sdk: ^3.3`)
10
+ 零成本包装类型,编译时擦除为基础类型(无运行时开销),用于类型安全互操作和领域建模:
11
+ ```dart
12
+ extension type Meters(int value) {
13
+ Meters operator +(Meters other) => Meters(value + other.value);
14
+ }
15
+ extension type EmailAddress(String value) implements String { /* ... */ }
16
+ ```
17
+
18
+ ## 核心库 (Core libraries)
19
+
20
+ ### JS interop
21
+ - 推出全新 **`dart:js_interop`** 库(基于 extension types 的 JS 类型表示)
22
+ - 推出 **`package:web`**(替代 `dart:html` / `dart:svg` / `dart:webgl` 等内置浏览器库)
23
+ - 这些为编译到 WebAssembly 铺路
24
+
25
+ > JS interop 整体 Stable 是在 3.5;3.3 是引入版本。3.3 用户已可直接用 `dart:js_interop` + `package:web`。
26
+
27
+ ## 工具链 / 平台
28
+
29
+ ### Web
30
+ - 为 WebAssembly (WasmGC) 编译铺路(3.4 才稳定)
31
+
32
+ ## 不收录(实验性 / preview,转正后再写)
33
+
34
+ 无(3.3 的语言特性直接 Stable;JS interop 新模型已可用)。
@@ -0,0 +1,23 @@
1
+ # Dart 3.4
2
+
3
+ - **发布日期**: 2024-05-14
4
+ - **数据来源**: https://dart.dev/blog/announcing-dart-3-4 + https://dart.dev/guides/language/evolution
5
+ - **类型**: Incremental release(语言层面无 versioned 新特性)
6
+
7
+ > **说明**:3.4 在语言层面**无新的 versioned 改动**,仅有 unversioned 的 type analysis 改进。但 Web/Wasm 里程碑在本版本达成。
8
+
9
+ ## 语言特性 (Language)
10
+
11
+ ### Unversioned type analysis 改进(升级 SDK 即生效,与 `environment.sdk` 下界无关)
12
+ - 改进 conditional expressions、if-null expressions/assignments、switch expressions 的类型分析
13
+ - 对齐 cast patterns 的 pattern context type schema
14
+ - 让 `...?`(null-aware spread)对 map/set 字面量的 type schema 也为 nullable,与 list 字面量行为一致
15
+
16
+ ## 工具链 / 平台
17
+
18
+ ### Web
19
+ - **Flutter Web 的 WebAssembly (WasmGC) 完整支持稳定**(与 Flutter 3.22 一起)—— Dart/Flutter Web 应用可编译为 WasmGC,享受性能与体积优势
20
+
21
+ ## 不收录(实验性 / preview,转正后再写)
22
+
23
+ - **Macros**(`@JsonCodable()` 等宏做 JSON 序列化)—— 3.4 首次 preview,**3.7 已叫停 cancelled**。详见 `references/deprecation-and-evolution.md` 第二节与第五节。
@@ -0,0 +1,34 @@
1
+ # Dart 3.5
2
+
3
+ - **发布日期**: 2024-08-06
4
+ - **数据来源**: https://dart.dev/blog/announcing-dart-3-5-and-an-update-on-the-dart-roadmap + https://dart.dev/guides/language/evolution
5
+ - **类型**: Incremental release(语言层面无 versioned 新特性,但 JS interop 模型整体 Stable)
6
+
7
+ > **说明**:3.5 在语言层面**无新的 versioned 改动**,仅有 unversioned 的 type inference 上下文微调。但 JS interop 模型在本版本整体 graduate 到 Stable。
8
+
9
+ ## 语言特性 (Language)
10
+
11
+ ### Unversioned type inference 上下文微调(升级 SDK 即生效)
12
+ - `await` 表达式上下文为 `dynamic` 时,操作数上下文改为 `FutureOr<_>`
13
+ - `e1 ?? e2` 整体上下文为 `dynamic` 时,`e2` 的上下文改为 `e1` 的静态类型
14
+
15
+ ## 核心库 (Core libraries)
16
+
17
+ ### JS interop
18
+ - **JS interop 模型 graduate 到 Stable / v1.0**
19
+ - **`package:web` 更新到 1.0**
20
+ - 计划弃用旧 interop 库:`dart:html` / `dart:js` / `dart:js_util` / `package:js`
21
+
22
+ ### FFI
23
+ - 支持从 Dart `TypedData` 直接传 pointer 到 FFI(避免拷贝)
24
+ - 新增 lint 验证 JS interop 用法
25
+
26
+ ## 工具链 / 平台
27
+
28
+ ### Pub
29
+ - pub.dev:topics 标签改进
30
+
31
+ ## 不收录(实验性 / preview,转正后再写)
32
+
33
+ - **JNIgen**(Java/Kotlin 互操作)—— preview(性能改进、支持 Java 异常和 Kotlin 顶级函数;旧 C-based 绑定已停用)
34
+ - **FFIgen**(Objective-C 互操作)—— preview(支持 protocols、NSString 等)
@@ -0,0 +1,24 @@
1
+ # Dart 3.6
2
+
3
+ - **发布日期**: 2024-12-11
4
+ - **数据来源**: https://dart.dev/blog/announcing-dart-3-6 + https://dart.dev/guides/language/evolution
5
+ - **类型**: Incremental release(含 1 项新语言特性 + 重要 pub 能力)
6
+
7
+ ## 语言特性 (Language)
8
+
9
+ ### Digit separators — Stable(versioned,`environment.sdk: ^3.6`)
10
+ 数字字面量中可用下划线分组,提升可读性:
11
+ ```dart
12
+ const oneQuadrillion = 1__000_000__000_000__000_000;
13
+ const masked = 0x4000_0000_0000_0000;
14
+ ```
15
+
16
+ ## 工具链 / 平台
17
+
18
+ ### Pub
19
+ - **Pub workspaces(monorepo 支持)**:根 pubspec 加 `workspace:` 字段声明子包路径,子包共享 `.dart_tool` 与版本解析(Stable,versioned,所有 workspace 包需 `environment.sdk: ^3.6.0`)
20
+ - **Pub download counts** 替代 popularity score
21
+
22
+ ## 不收录(实验性 / preview,转正后再写)
23
+
24
+ 无。
@@ -0,0 +1,35 @@
1
+ # Dart 3.7
2
+
3
+ - **发布日期**: 2025-02-12
4
+ - **数据来源**: https://dart.dev/blog/announcing-dart-3-7 + https://dart.dev/guides/language/evolution
5
+ - **类型**: Incremental release(含 1 项新语言特性 + formatter 大改版)
6
+
7
+ ## 语言特性 (Language)
8
+
9
+ ### Wildcard variables — Stable(versioned,`environment.sdk: ^3.7`)
10
+ 名为 `_` 的局部变量/参数变为**非绑定占位符**,可多次声明而不冲突:
11
+ ```dart
12
+ // 多个 _ 不再冲突
13
+ Foo(_, this._, super._, void _()) {}
14
+
15
+ void process(Map<String, int> map) {
16
+ for (final (_, value) in map.entries) print(value); // 忽略 key
17
+ }
18
+ ```
19
+
20
+ > 注意:此前 `_` 是合法标识符(会绑定变量),3.7 起变为 wildcard。**这与旧代码有兼容性影响**:库中名为 `_` 的 API 在 3.7+ 无法被引用。
21
+
22
+ ## 工具链 / 平台
23
+
24
+ ### Dart format
25
+ - **Dart formatter 大改版**:新 "tall" 样式,`dart format` 与 language version 绑定(升级到 3.7 后会按 tall 样式格式化)
26
+
27
+ ### Analyzer
28
+ - 新增 quick fixes / lints
29
+
30
+ ### Pub
31
+ - pub.dev 多项改进
32
+
33
+ ## 不收录(实验性 / preview,转正后再写)
34
+
35
+ - **Macros 已 cancelled** —— 3.4 preview,**3.7 正式宣告停止**(详见 `dart.dev/blog/an-update-on-dart-macros-data-serialization`)。新代码不要依赖,用 codegen 包替代。见 `references/deprecation-and-evolution.md` 第二节。
@@ -0,0 +1,36 @@
1
+ # Dart 3.8
2
+
3
+ - **发布日期**: 2025-05-20
4
+ - **数据来源**: https://dart.dev/blog/announcing-dart-3-8 + https://dart.dev/guides/language/evolution
5
+ - **类型**: Incremental release(含 1 项新语言特性 + 编译器交叉编译)
6
+
7
+ ## 语言特性 (Language)
8
+
9
+ ### Null-aware elements — Stable(versioned,`environment.sdk: ^3.8`)
10
+ 集合字面量中前缀 `?` 表示"非 null 才插入":
11
+ ```dart
12
+ [?promotableNullableValue, ?nullable.value]
13
+ // 等价于手动 if-null 处理,但更简洁
14
+ ```
15
+
16
+ 适用于 list / set / map 字面量。
17
+
18
+ ## 核心库 (Core libraries)
19
+
20
+ ### 文档注释
21
+ - **Doc imports**:在 doc comment 中通过新语法引用未 import 的外部元素
22
+
23
+ ## 工具链 / 平台
24
+
25
+ ### Dart format
26
+ - **Dart format 重写**:沿用 3.7 的 tall 样式并修复反馈,自动决定 trailing comma
27
+
28
+ ### 编译器
29
+ - **跨平台交叉编译**(Stable):`dart compile exe --target-os=linux --target-arch=arm64` 可从 Windows/macOS 交叉编译 Linux 二进制
30
+
31
+ ### Pub
32
+ - pub.dev:新的 trending packages 发现
33
+
34
+ ## 不收录(实验性 / preview,转正后再写)
35
+
36
+ - FFIgen / JNIgen 早期体验计划(仍 preview)
@@ -0,0 +1,32 @@
1
+ # Dart 3.9
2
+
3
+ - **发布日期**: 2025-08-14
4
+ - **数据来源**: https://dart.dev/blog/announcing-dart-3-9 + https://dart.dev/guides/language/evolution
5
+ - **类型**: Incremental release(语言层面无 versioned 新特性,但有重要 unversioned 行为变更)
6
+
7
+ > **说明**:3.9 在语言层面**无新的 versioned 改动**,但有几项重要的 unversioned 行为变更,以及 MCP Server / CLI 性能里程碑。
8
+
9
+ ## 语言特性 (Language)
10
+
11
+ ### Unversioned type-system 行为变更(升级 SDK 即生效,与 `environment.sdk` 下界无关)
12
+ - **Null safety 默认假设**:计算 type promotion / reachability / definite assignment 时默认假设 null safety,可能产生更多 `dead_code` 警告
13
+
14
+ ## 工具链 / 平台
15
+
16
+ ### MCP
17
+ - **Dart and Flutter MCP Server** 进入 stable channel(桥接 Gemini CLI / Cursor / Copilot)
18
+
19
+ ### Analyzer
20
+ - **Analysis server AOT 预编译**:改用 AOT 预编译 snapshot,`dart analyze` 提速约 50%
21
+
22
+ ### Pub
23
+ - **Pub 现在尊重 `flutter:` 上界约束**:root package 的 `environment.flutter` 上界从 3.9 起在 version-solving 时生效(这是 pub 工具行为,非 Flutter 框架能力)
24
+ - git 依赖可按 `tag_pattern` + version constraint 进行 version-solving
25
+
26
+ ## 破坏性变更
27
+
28
+ - 修复 DDC 的一处 soundness 问题(getter 返回 `dynamic`/`Function` 时缺少运行时检查)—— 此前依赖此行为的代码可能行为变化
29
+
30
+ ## 不收录(实验性 / preview,转正后再写)
31
+
32
+ 无。