octane 0.1.17 → 0.1.19
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/README.md +7 -5
- package/dist/compiler/compile-renderer-boundaries.js +1 -0
- package/dist/compiler/compile-universal.js +4 -1
- package/dist/compiler/compile.js +1833 -269
- package/dist/compiler/hook-deps.js +58 -2
- package/dist/compiler/index.js +4 -1
- package/dist/compiler/slot-hooks.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -0
- package/dist/runtime.d.ts +55 -2
- package/dist/runtime.js +722 -31
- package/dist/runtime.server.d.ts +17 -0
- package/dist/runtime.server.js +240 -18
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +10 -0
- package/dist/universal-core.d.ts +10 -0
- package/dist/universal-core.js +146 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -9,11 +9,13 @@ Octane is a fast, JavaScript UI framework, and the successor to
|
|
|
9
9
|
already know, a compiler that keeps the runtime small and fast, no rules of
|
|
10
10
|
hooks, and no hand-maintained dependency arrays in the common case. Omit a hook's
|
|
11
11
|
dependency list and the compiler derives it from the closure; explicit arrays
|
|
12
|
-
retain React semantics, while `null` means every render.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
`
|
|
12
|
+
retain React semantics, while `null` means every render. Built-in hook calls
|
|
13
|
+
retain this inference inside compiler-processed custom hooks, including those in
|
|
14
|
+
plain `.ts`/`.js` modules. Inferring a dependency argument at a call to a custom
|
|
15
|
+
wrapper is narrower: the wrapper must be locally declared in a fully compiled
|
|
16
|
+
`.tsrx`/`.tsx` module and transparently forward its callback and final dependency
|
|
17
|
+
parameter to a supported hook. This package ships both the runtime and compiler,
|
|
18
|
+
with the compiler exposed at `octane/compiler`.
|
|
17
19
|
|
|
18
20
|
For the full story, see the
|
|
19
21
|
[main README](https://github.com/octanejs/octane#readme).
|
|
@@ -31,6 +31,7 @@ const UNIVERSAL_RUNTIME_IMPORTS = new Set([
|
|
|
31
31
|
'useImperativeHandle',
|
|
32
32
|
'useInsertionEffect',
|
|
33
33
|
'useLayoutEffect',
|
|
34
|
+
'useLinkedState',
|
|
34
35
|
'useMemo',
|
|
35
36
|
'useOptimistic',
|
|
36
37
|
'useReducer',
|
|
@@ -657,7 +658,7 @@ function createLexicalAnalysis(ast) {
|
|
|
657
658
|
return;
|
|
658
659
|
}
|
|
659
660
|
if (node.type === 'TSModuleDeclaration') {
|
|
660
|
-
if (node.declare === true || node.
|
|
661
|
+
if (node.declare === true || node.kind === 'global') {
|
|
661
662
|
if (node.id) declarePattern(node.id, null);
|
|
662
663
|
return;
|
|
663
664
|
}
|
|
@@ -3021,6 +3022,7 @@ function emitComponentAst(shape, state) {
|
|
|
3021
3022
|
|
|
3022
3023
|
export const UNIVERSAL_COMPILER_RUNTIME_IMPORTS = new Set([
|
|
3023
3024
|
...UNIVERSAL_RUNTIME_IMPORTS,
|
|
3025
|
+
'__useLinkedStateWithGetter',
|
|
3024
3026
|
'__useReducerWithGetter',
|
|
3025
3027
|
'__useStateWithGetter',
|
|
3026
3028
|
'hookSlots',
|
|
@@ -3386,6 +3388,7 @@ export function lowerUniversalRendererRegionAst(
|
|
|
3386
3388
|
Object.fromEntries(
|
|
3387
3389
|
[
|
|
3388
3390
|
'__useStateWithGetter',
|
|
3391
|
+
'__useLinkedStateWithGetter',
|
|
3389
3392
|
'__useReducerWithGetter',
|
|
3390
3393
|
'useMemo',
|
|
3391
3394
|
'useBatch',
|