You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGES.md
+15-12Lines changed: 15 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,17 @@ function f() {}
28
28
f.called=false;
29
29
```
30
30
31
+
## Declaration Emit
32
+
33
+
We've fundamentally rewritten core parts of the declaration emit *and* JavaScript parsing components.
34
+
As a result, declaration (`.d.ts`) emit based on `.js` input files has substantially changed behavior.
35
+
While it's still expected that supported tags (see below) are emitted with correct semantics in Corsa, it's a non-goal to exactly match Strada's output.
36
+
37
+
This also has effects on how `.d.ts` is emitted in the presence of errors, which tends to be more common in `.js` and JSDoc scenarios.
38
+
Declaration file generation isn't well-defined in the presence of errors (including those suppressed with `ts-ignore`/`ts-expect-error`), and you can expect Corsa and Strada to be quite different depending on the situation.
39
+
40
+
However, if you see **_incorrect_**`.d.ts` output from a `.js` file, **please file an issue**.
41
+
31
42
## JSDoc Tags and Types
32
43
33
44
| Name | Example | Substitute | Note |
@@ -123,18 +134,6 @@ function f(x) {
123
134
f(); // Still allowed
124
135
```
125
136
126
-
#### Strada's JS-specific rules for inferring type arguments no longer apply in Corsa.
127
-
128
-
Inferred type arguments may change. For example:
129
-
130
-
```js
131
-
/**@type{any}*/
132
-
var x = { a:1, b:2 };
133
-
var entries =Object.entries(x);
134
-
```
135
-
136
-
In Strada, `entries: Array<[string, any]>`. In Corsa it has type `Array<[string, unknown]>`, the same as in TypeScript.
137
-
138
137
#### Values are no longer resolved as types in JSDoc type positions.
Corsa does not permit CommonJS modules to mix assignments to the full `module.exports` with assignments to `module.exports.xxx` properties. A CommonJS module must either contain an assignment to `module.exports` or a series of assignments to `module.exports.xxx` properties, but not both.
0 commit comments