|
1 | 1 | # Change Log |
2 | 2 |
|
3 | | -## 3.0.0-beta.1 |
4 | | - |
5 | | -### Minor Changes |
6 | | - |
7 | | -- [`af62247`](https://github.com/antvis/L7/commit/af622479123a01437e6d498bf4b06402f99de57f) Thanks [@lzxue](https://github.com/lzxue)! - refactor(core): add EncodeStyleKind type for encode-style channels (stage-3 3.3) |
8 | | - |
9 | | - P4 阶段 3 第二刀(3.3,core 侧,minor)。 |
10 | | - |
11 | | - 新增 `export type EncodeStyleKind = 'shader' | 'data'` |
12 | | - (`services/layer/ILayerService.ts`),标样式属性参与数据映射的通道: |
13 | | - |
14 | | - - `'shader'`:shader 端 uniform 注入(历史 `enableShaderEncodeStyles`) |
15 | | - - `'data'`:数据层数据映射(历史 `enableDataEncodeStyles`) |
16 | | - |
17 | | - `ILayer.enableShaderEncodeStyles` / `enableDataEncodeStyles` 公开数组契约 |
18 | | - **保留不变**(外部 `layer.enableShaderEncodeStyles` 读取维持数组),补 JSDoc |
19 | | - 指明其为「公开数组 getter 桥接,内部单一真源 `encodeStyles: Map`」。 |
20 | | - |
21 | | - 配套 layers 侧声明同步见 `refactor-layers-encode-styles-converge` changeset。 |
22 | | - 验证:core eslint 0 error、prettier 通过、core father build 98 files。 |
23 | | - |
24 | | -- [`15c19a3`](https://github.com/antvis/L7/commit/15c19a3a0b297cac02533dccb8b11f00a374e047) Thanks [@lzxue](https://github.com/lzxue)! - refactor(core): type encodeStyleAttribute via IEncodedStyleMap (stage-3 3.2) |
25 | | - |
26 | | - P4 阶段 3 第一刀(3.2,core 侧 typing 子集,minor)。 |
27 | | - |
28 | | - PLAN 3.2 列举四项替 `any`:经审 `sourceOption`/`shapeOption`/`defaultSourceConfig` |
29 | | - 已在历史阶段各自定型为 `ISourceOption`/`IShapeOption`/`IDefaultSourceConfig` |
30 | | - (PLAN 草拟时未及同步),故本轮仅收编真正剩余的 `encodeStyleAttribute: |
31 | | -Record<string, any>` 缺口。 |
32 | | - |
33 | | - 新增(`services/layer/ILayerService.ts`,minor 依据): |
34 | | - |
35 | | - - `export interface IEncodedStyleValue` — 单条数据映射样式值,对齐 |
36 | | - `updateStyleAttribute` 的 `field`/`values` 形参(值键名历史为 `value` |
37 | | - 单数);`field?: StyleAttributeField`、`value?: StyleAttributeOption`, |
38 | | - 保留 `[key: string]: any` 索引签名兼容历史透传的额外字段(非破坏性收窄)。 |
39 | | - - `export type IEncodedStyleMap = Record<string, IEncodedStyleValue>`。 |
40 | | - |
41 | | - `ILayer.encodeStyleAttribute: Record<string, any>` → `IEncodedStyleMap`。 |
42 | | - |
43 | | - **向后兼容**:`any`→具名类型是收窄但非破坏——写入侧 `encodeStyle(options: {[k]:any})` |
44 | | - 的 `options[key]`(`any`)仍可赋值 `IEncodedStyleValue`;读取侧 `getDynamicStyleInject` |
45 | | - 形参 `Record<string, any>` 接受 `IEncodedStyleMap`。 |
46 | | - |
47 | | - 配套 layers 侧声明同步见 `refactor-layers-encoded-style-map` changeset。 |
48 | | - `getScale(name)` 泛型化归后续 scale delegate 专属刀(3.2 剩余子项),本刀聚焦 |
49 | | - `encodeStyleAttribute` 缺口。 |
50 | | - |
51 | | - 验证:core eslint 0 error、prettier 通过、core father build 98 files(d.ts 类型检查)。 |
52 | | - |
53 | | -- [`8ce2a7a`](https://github.com/antvis/L7/commit/8ce2a7aeb0cba7d82f405d3ae38bf80154efabfc) Thanks [@lzxue](https://github.com/lzxue)! - refactor(core): genericize ILayer.getScale with IStyleScale default (stage-3 3.2) |
54 | | - |
55 | | - P4 阶段 3 第二刀收尾(3.2,core 侧,minor)。 |
56 | | - |
57 | | - `ILayer.getScale(name: string): any` → |
58 | | - `getScale<T = IStyleScale>(name: string): T`(`ILayerService.ts`)。 |
59 | | - 默认 `IStyleScale` 为该返回路径的实际语义结构 |
60 | | - (`scale`/`field`/`type`/`option`,见 `IStyleAttributeService`), |
61 | | - 比 `any` 严格且对未指定 `T` 的调用方保持类型安全;调用方可显式 opt-in |
62 | | - 泛型。底层 `styleAttributeService.getLayerAttributeScale(name)` 仍返 |
63 | | - `any`(scaler 结构未具名,归后续 scale service 专属刀),经 `as T` |
64 | | - 透传不引入类型错误。 |
65 | | - |
66 | | - 运行时零行为变化,仅类型面收紧。配套 layers 侧实现同步见 |
67 | | - `refactor-layers-getscale-generic` changeset。 |
68 | | - |
69 | | - 验证:core eslint 0 error、prettier 通过、core father build 98 files |
70 | | - (d.ts 生成、类型检查通过)。 |
71 | | - |
72 | | -- [`a642560`](https://github.com/antvis/L7/commit/a64256031aead81f30d6c4cea6ab78d3d365f14a) Thanks [@lzxue](https://github.com/lzxue)! - refactor(core): add optional metadata to ILayerPlugin (stage-2 2.2) |
73 | | - |
74 | | - P4 阶段 2 第二刀(2.2,跨包 core 侧,minor)。 |
75 | | - |
76 | | - 给 `ILayerPlugin` 接口(`services/layer/ILayerService.ts`)补三个可选元数据字段, |
77 | | - 为 `LayerPluginRegistry`(2.1)的声明式排序与按名替换提供契约基础: |
78 | | - |
79 | | - - `name?: string` — 插件名(kebab-case,唯一标识符)。供 `LayerPluginRegistry.replace(name, plugin)` / `getByName(name)` 按名索引,亦便于调试日志与 `addPlugin` 顺序观测。 |
80 | | - - `order?: number` — 声明式排序优先级(升序)。`LayerPluginRegistry.sortByOrder()` 据此稳定排序;缺省视 `Infinity` 兜底,相同 order(含均为 undefined)保持插入序。 |
81 | | - - `initStage?: 'init' | 'afterInit'` — 初始化阶段标记。当前 14 内置插件均为 `'init'`,字段为未来按阶段分流的 registry 改造预留(2.2 仅声明,不改 apply 时序)。 |
82 | | - |
83 | | - **向后兼容**:三字段均为可选,既有 `implements ILayerPlugin` 类不声明元数据也编译通过。 |
84 | | - 配套 layers 侧改动见 `refactor-layers-p4-stage2-plugin-metadata` changeset。 |
85 | | - |
86 | | - 验证:core eslint 0 error、prettier 通过、core father build 98 files(含 declaration d.ts 真实类型检查)。 |
87 | | - |
88 | | -- [`fa33b9d`](https://github.com/antvis/L7/commit/fa33b9dbd9efd52dda38c741e8e7f47951167086) Thanks [@lzxue](https://github.com/lzxue)! - refactor(core): tighten IBaseTileLayer + make ILayer.tileLayer optional (stage-5 5.1) |
89 | | - |
90 | | - P4 阶段 5 第一刀(5.1,core 侧,minor)。 |
91 | | - |
92 | | - `ILayer.tileLayer` 原声明为非可选 `IBaseTileLayer`,但运行时 |
93 | | - 对非瓦片图层始终为 `undefined`(`Scene.initTileLayer` 仅在 |
94 | | - `source.isTile` 时赋值;mock 一律传 `undefined`)。非可选契约被 |
95 | | - 实现侧 `any | undefined` 长期掩盖。本刀将其改为 |
96 | | - `tileLayer: IBaseTileLayer | undefined`,使接口如实反映「瓦片图层 |
97 | | - 才有、其余为 undefined」的语义。 |
98 | | - |
99 | | - 同时向 `IBaseTileLayer` 补 `reload(): void` —— `BaseTileLayer` 已 |
100 | | - 实现该方法且 `BaseLayer.onSourceUpdate` 经 `this.tileLayer.reload()` |
101 | | - 外部调用,属公共能力,补入接口使其成为正式契约(additive,非破坏)。 |
102 | | - |
103 | | - 下游实现侧(`@antv/l7-layers` `BaseLayer.tileLayer`)由 `any` 对齐 |
104 | | - 为 `IBaseTileLayer | undefined`,见 `refactor-layers-tilelayer-type` |
105 | | - changeset。 |
106 | | - |
107 | | - 运行时零行为变化,仅类型面收紧/修正。所有 `.tileLayer` 消费点均经 |
108 | | - 真值守护或可选链(`LayerPickService` / `BaseLayer.render|destroy| |
109 | | -onSourceUpdate` / `Tile.getMaskLayer` / `DataSourcePlugin` / |
110 | | - `LayerMaskPlugin`),可选化不引入新空指针面。 |
111 | | - |
112 | | - 验证:core eslint 0 error、prettier 通过、core father build 98 |
113 | | - files(d.ts OK)。layers + scene father build 均通过(279 / 66 |
114 | | - files),非 GL jest 子集 25 suites / 158 passed 与基线一致。 |
115 | | - |
116 | | -### Patch Changes |
117 | | - |
118 | | -- [`c9e995d`](https://github.com/antvis/L7/commit/c9e995d57d82122ccee496966cad582fa3ae61ae) Thanks [@lzxue](https://github.com/lzxue)! - refactor(layers,core): BaseLayer stage-0 抽内联字面量类型为命名接口(0.4) |
119 | | - |
120 | | - P4 阶段 0 第三刀(0.4,零行为/零 API 变更,纯类型 DRY)。`BaseLayer.ts` 的 |
121 | | - `defaultSourceConfig`/`sourceOption`/`shapeOption` 此前以内联字面量类型声明, |
122 | | - 且同样的字面量在 `core/src/services/layer/ILayerService.ts` 的 `ILayer` 接口里 |
123 | | - 重复声明一次(散落字面量)。本轮在 `IDataState` 旁新增三个命名接口统一引用: |
124 | | - |
125 | | - - `IDefaultSourceConfig { data: any[]; options: ISourceCFG | undefined }` |
126 | | - - `ISourceOption { data: any; options?: ISourceCFG }` |
127 | | - - `IShapeOption { field: any; values: any }` |
128 | | - |
129 | | - `ILayer` 接口与 `BaseLayer` 字段声明均改为引用命名接口(形状完全一致)。 |
130 | | - `dataState` 此前已使用 `IDataState`,本轮无需改动。精确保留 `shape()` / |
131 | | - `source()` 运行时赋值点的可赋值性(`any` 字段双向兼容)。 |
132 | | - |
133 | | - 验证:eslint 0 error、prettier 通过、core father build(98 files,含 declaration)、 |
134 | | - layers father build(271 files,含 declaration d.ts 类型检查)、jest 40 suites / 191 passed。 |
135 | | - |
136 | | -- Updated dependencies [[`d45cb50`](https://github.com/antvis/L7/commit/d45cb50516a57be2b63237385050a9716901211f)]: |
137 | | - - @antv/l7-utils@3.0.0-beta.1 |
138 | | - |
139 | 3 | ## 2.30.0-beta.0 |
140 | 4 |
|
141 | 5 | ### Patch Changes |
|
0 commit comments