Skip to content

Commit 8571d70

Browse files
authored
docs(api): mark seven unread option fields @deprecated (#2731) (#2975)
Each of these is declared in a public type, settable by a caller, and read by nothing at runtime — no error, no warning, no effect. The JSDoc now says so plainly, and names the substitute where one exists. - SVGExportOptions.units (drawing-2d): export() never destructures it; the exporter emits no dimension annotations and always sizes the sheet in mm. - OpeningFilterOptions.keepBoundarySegments (drawing-2d): merged into the filter's options object, never consulted; tolerance alone governs how segments near an opening edge are treated. - DoorSymbolConfig.showThreshold (drawing-2d): no threshold-rendering code exists, so true and false produce identical geometry. - SnapOptions.snapRadius (renderer): documented as world units, but every proximity check reads screenSnapRadius (pixels). Set that instead. - SectionPlaneRenderOptions.flipped (renderer): the gizmo renderer never reads it. The GPU clip plane flips through separate state, so cutting behaviour is unaffected; only the gizmo option is inert. - RenderOptions.enableDepthTest (renderer): dead on both ends — the sole occurrence of the name is its own declaration. Depth comparison is fixed per pipeline at construction time. - StreamingOptions.onMetadataBootstrap (geometry): an unfinished stub. Its siblings onBatch, onColorUpdate, onComplete and onError are all dispatched by the bridge; this one never is. Deprecated rather than deleted, following the maintainer's lean on the issue: removing an optional field an embedder already passes turns a silent no-op into a TS compile error, which is a worse first contact with the problem than a warning that explains it. Removal stays a separate versioned decision, so no removal timeline is implied here. Two docs/guide/rendering.md snippets that advertised snapRadius as "10cm world units" and listed enableDepthTest under "Performance" are annotated to match. No export added, removed or renamed: check-api-surface.mjs is green against the unchanged snapshot, since it records exported names rather than members. Out of scope by the maintainer's split — each needs a behaviour decision, not a mechanical fix: the streaming batch ramp-up, GeometryQuality, and the scale-bar / north-arrow renderer divergence.
1 parent cc09ad8 commit 8571d70

9 files changed

Lines changed: 114 additions & 8 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
'@ifc-lite/drawing-2d': patch
3+
'@ifc-lite/renderer': patch
4+
'@ifc-lite/geometry': patch
5+
---
6+
7+
Seven public option fields that nothing reads are now marked `@deprecated`,
8+
with JSDoc that says what actually happens instead of what the old comment
9+
promised. No behaviour changes and no export is removed or renamed — the
10+
values were already ignored at runtime; only the type-level documentation
11+
changes, so editors now warn at the point a caller sets one.
12+
13+
- `SVGExportOptions.units` (`drawing-2d`) — `export()` never destructures it;
14+
the exporter emits no dimension annotations and always sizes the sheet in
15+
millimetres.
16+
- `OpeningFilterOptions.keepBoundarySegments` (`drawing-2d`) — merged into the
17+
filter's options object but never consulted; `tolerance` is the only field
18+
that governs how segments near an opening edge are treated.
19+
- `DoorSymbolConfig.showThreshold` (`drawing-2d`) — no threshold-rendering code
20+
exists, so `true` and `false` produce identical geometry.
21+
- `SnapOptions.snapRadius` (`renderer`) — documented as a world-units snap
22+
distance, but every proximity check reads `screenSnapRadius` (pixels).
23+
Snapping is screen-space and zoom-dependent; set `screenSnapRadius` instead.
24+
- `SectionPlaneRenderOptions.flipped` (`renderer`) — the gizmo renderer never
25+
reads it. The GPU clip plane flips correctly through separate state, so
26+
cutting behaviour is unaffected; only the gizmo option is inert.
27+
- `RenderOptions.enableDepthTest` (`renderer`) — dead on both ends: nothing
28+
sets it and nothing reads it. Depth comparison is fixed per pipeline at
29+
construction time and is not configurable through `RenderOptions`.
30+
- `StreamingOptions.onMetadataBootstrap` (`geometry`) — an unfinished stub. Its
31+
siblings `onBatch`, `onColorUpdate`, `onComplete` and `onError` are all
32+
dispatched by the bridge; this one never is, so a callback passed here is
33+
never called.
34+
35+
Deprecating rather than deleting is deliberate: removing an optional field an
36+
embedder already passes converts a silent no-op into a TypeScript compile
37+
error, which is a worse first contact with the problem than a deprecation
38+
warning that explains it. Removal is left as a separate, explicitly versioned
39+
decision. See issue #2731 for the full audit; the findings that carry a
40+
behaviour decision (the streaming batch ramp-up, `GeometryQuality`, and the
41+
scale-bar / north-arrow renderer divergence) are deliberately untouched here.

docs/guide/rendering.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ canvas.addEventListener('mousemove', (e) => {
266266
snapToVertices: true,
267267
snapToEdges: true,
268268
snapToFaces: true,
269-
snapRadius: 0.1, // 10cm world units
269+
snapRadius: 0.1, // deprecated: ignored, screenSnapRadius is what is read
270270
screenSnapRadius: 20 // 20 pixels
271271
}
272272
});
@@ -300,7 +300,7 @@ canvas.addEventListener('mousemove', (e) => {
300300
snapOptions: {
301301
snapToVertices: true,
302302
snapToEdges: true,
303-
snapRadius: 0.1,
303+
snapRadius: 0.1, // deprecated: ignored
304304
screenSnapRadius: 20
305305
}
306306
});
@@ -522,7 +522,7 @@ interface RenderOptions {
522522
clearColor?: [number, number, number, number];
523523

524524
// Performance
525-
enableDepthTest?: boolean;
525+
enableDepthTest?: boolean; // deprecated: declared but never read
526526
enableFrustumCulling?: boolean;
527527
spatialIndex?: SpatialIndex;
528528

packages/drawing-2d/src/openings/opening-filter.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,16 @@ import { projectTo2D, getProjectionAxes } from '../math.js';
2424
export interface OpeningFilterOptions {
2525
/** Tolerance for point-in-bounds testing (world units) */
2626
tolerance: number;
27-
/** Whether to keep segments at opening boundaries */
27+
/**
28+
* Declared but never read. The constructor merges it into `this.options`,
29+
* but no method consults it: boundary handling is governed entirely by
30+
* {@link tolerance}, which inflates the opening bounds in `pointInBounds`
31+
* so a larger tolerance drops slightly more of the segment near the edge.
32+
* Setting this to `false` does not make boundary segments disappear.
33+
* Slated for removal; see issue #2731.
34+
*
35+
* @deprecated Ignored by the filter — `tolerance` is what governs boundaries.
36+
*/
2837
keepBoundarySegments: boolean;
2938
}
3039

packages/drawing-2d/src/svg-exporter.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,15 @@ export interface SVGExportOptions {
5959
projectName?: string;
6060
/** Background color (default: white) */
6161
backgroundColor?: string;
62-
/** Units for dimension display */
62+
/**
63+
* Declared but never read. `export()` does not destructure `units` and no
64+
* other code path consults it, so setting it has no effect on the emitted
65+
* SVG. The exporter emits no dimension annotations at all, and the sheet
66+
* itself is always sized in millimetres (`width="…mm"`), so there is no
67+
* substitute option to reach for. Slated for removal; see issue #2731.
68+
*
69+
* @deprecated Ignored by the exporter — see above.
70+
*/
6371
units?: 'mm' | 'm';
6472
/** DXF reference underlays rendered beneath the drawing (issue #1782) */
6573
underlays?: SVGUnderlayOptions[];

packages/drawing-2d/src/symbols/door-symbol.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ export interface DoorSymbolConfig {
4444
swingAngle: number;
4545
/** Show door leaf line */
4646
showLeaf: boolean;
47-
/** Show threshold line */
47+
/**
48+
* Declared but never read. No threshold-rendering code exists anywhere in
49+
* the package, so this field cannot switch anything on: setting it to
50+
* `true` produces exactly the same geometry as leaving it at the default
51+
* `false`. There is no substitute option — a threshold line would have to
52+
* be drawn by the caller. Slated for removal; see issue #2731.
53+
*
54+
* @deprecated Ignored by the generator — no threshold is ever drawn.
55+
*/
4856
showThreshold: boolean;
4957
}
5058

packages/geometry/src/platform-bridge.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,17 @@ export interface GeometryProcessingResult {
113113
export interface StreamingOptions {
114114
/** Callback for each batch of meshes */
115115
onBatch?: (batch: GeometryBatch) => void;
116-
/** Callback for early metadata bootstrap when available */
116+
/**
117+
* Declared but never read. This is the only occurrence of the name in the
118+
* repository — no bridge implementation ever invokes it, so a callback
119+
* passed here is never called and no "early metadata bootstrap" is
120+
* delivered. Unlike its siblings ({@link onBatch}, {@link onColorUpdate},
121+
* {@link onComplete}, {@link onError}), which are all dispatched, this one
122+
* is an unfinished stub. There is no substitute callback; metadata must be
123+
* read from the completed result. Slated for removal; see issue #2731.
124+
*
125+
* @deprecated Never invoked — see above.
126+
*/
117127
onMetadataBootstrap?: (bootstrap: MetadataBootstrapPayload) => void;
118128
/** Callback for deferred color updates */
119129
onColorUpdate?: (updates: Map<number, [number, number, number, number]>) => void;

packages/renderer/src/section-plane.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,18 @@ export interface SectionPlaneRenderOptions {
1717
max: { x: number; y: number; z: number };
1818
};
1919
viewProj: Float32Array;
20-
flipped?: boolean; // If true, show the opposite side indicator
20+
/**
21+
* Declared but never read. `SectionPlaneRenderer.render()` never consults
22+
* it, so the gizmo quad looks identical either way — this field cannot
23+
* "show the opposite side indicator". Note that the actual GPU clip plane
24+
* is flipped correctly elsewhere (`scene-raycaster.ts` and `point-picker.ts`
25+
* read a `flipped` off their own section-plane state), so cutting behaviour
26+
* is unaffected; only this gizmo option is inert. Slated for removal; see
27+
* issue #2731.
28+
*
29+
* @deprecated Ignored by the gizmo renderer — see above.
30+
*/
31+
flipped?: boolean;
2132
isPreview?: boolean; // If true, render as preview (less opacity)
2233
min?: number; // Optional override for min range value
2334
max?: number; // Optional override for max range value

packages/renderer/src/snap-detector.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ export interface SnapOptions {
3333
snapToVertices: boolean;
3434
snapToEdges: boolean;
3535
snapToFaces: boolean;
36+
/**
37+
* Declared but never read. Documented as a world-units snap distance, but
38+
* every proximity check in `SnapDetector` uses {@link screenSnapRadius}
39+
* (pixels) instead — see the two call sites that pass `opts.screenSnapRadius`
40+
* into the candidate search. Snapping is therefore purely screen-space and
41+
* zoom-dependent; changing this value has no effect. Set
42+
* {@link screenSnapRadius} instead. Slated for removal; see issue #2731.
43+
*
44+
* @deprecated Ignored — `screenSnapRadius` is the value that is read.
45+
*/
3646
snapRadius: number; // In world units
3747
screenSnapRadius: number; // In pixels
3848
/**

packages/renderer/src/types.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,15 @@ export interface RenderOptions {
204204
* look exactly. See {@link import('./environment.js').LightingEnvironment}.
205205
*/
206206
environment?: import('./environment.js').LightingEnvironment;
207+
/**
208+
* Declared but never read. This is the only occurrence of the name in the
209+
* package: nothing sets it and nothing consults it, so it is dead on both
210+
* ends. Depth testing is decided per pipeline at construction time and is
211+
* not configurable through `RenderOptions`; there is no substitute field.
212+
* Slated for removal; see issue #2731.
213+
*
214+
* @deprecated Ignored by the renderer — see above.
215+
*/
207216
enableDepthTest?: boolean;
208217
enableFrustumCulling?: boolean;
209218
spatialIndex?: import('@ifc-lite/spatial').SpatialIndex;

0 commit comments

Comments
 (0)