@abide/abide 0.34.0 → 0.34.1
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/lib/ui/compile/compileShadow.ts +11 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# abide
|
|
2
2
|
|
|
3
|
+
## 0.34.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`fcaf01b`](https://github.com/briancray/abide/commit/fcaf01bf160e300258568a0614f6b3cbef11e585) - project linked as a writable let in the typecheck shadow ([`cc9f3aa`](https://github.com/briancray/abide/commit/cc9f3aa0573be03318cbd8c8e389035fc6683408))
|
|
8
|
+
|
|
3
9
|
## 0.34.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -280,14 +280,21 @@ function scopeLineFor(
|
|
|
280
280
|
const typeNode = call.typeArguments?.[0]
|
|
281
281
|
const annotation = typeNode === undefined ? '' : `: ${verbatim(typeNode)}`
|
|
282
282
|
const fn = call.arguments[0]
|
|
283
|
+
/* `linked` is a writable `State<T>` at runtime (it reseeds AND accepts `.value =`
|
|
284
|
+
writes), so project it as `let`; `computed` is genuinely read-only, so `const`. */
|
|
285
|
+
const keyword = callee === 'linked' ? 'let' : 'const'
|
|
286
|
+
/* binding-name map offset = past the keyword + space (`let ` = 4, `const ` = 6) */
|
|
287
|
+
const keywordOffset = keyword.length + 1
|
|
283
288
|
if (fn === undefined) {
|
|
284
|
-
|
|
285
|
-
|
|
289
|
+
return {
|
|
290
|
+
text: `${keyword} ${name} = undefined;`,
|
|
291
|
+
segments: [span(declaration.name, keywordOffset)],
|
|
292
|
+
}
|
|
286
293
|
}
|
|
287
|
-
const prefix =
|
|
294
|
+
const prefix = `${keyword} ${name}${annotation} = (`
|
|
288
295
|
return {
|
|
289
296
|
text: `${prefix}${verbatim(fn)})();`,
|
|
290
|
-
segments: [span(declaration.name,
|
|
297
|
+
segments: [span(declaration.name, keywordOffset), span(fn, prefix.length)],
|
|
291
298
|
}
|
|
292
299
|
}
|
|
293
300
|
/* prop<T>('key'): Props field `key[?]: T`, scope binding read from props. */
|