ripple 0.2.215 → 0.3.0
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 +86 -0
- package/package.json +16 -7
- package/src/compiler/errors.js +1 -1
- package/src/compiler/identifier-utils.js +2 -0
- package/src/compiler/index.d.ts +2 -6
- package/src/compiler/phases/1-parse/index.js +171 -233
- package/src/compiler/phases/2-analyze/index.js +216 -16
- package/src/compiler/phases/2-analyze/prune.js +2 -2
- package/src/compiler/phases/3-transform/client/index.js +326 -94
- package/src/compiler/phases/3-transform/segments.js +43 -15
- package/src/compiler/phases/3-transform/server/index.js +71 -21
- package/src/compiler/scope.js +31 -12
- package/src/compiler/source-map-utils.js +4 -6
- package/src/compiler/types/acorn.d.ts +11 -0
- package/src/compiler/types/estree-jsx.d.ts +11 -0
- package/src/compiler/types/estree.d.ts +11 -0
- package/src/compiler/types/import.d.ts +32 -18
- package/src/compiler/types/index.d.ts +75 -23
- package/src/compiler/types/parse.d.ts +7 -10
- package/src/compiler/utils.js +48 -0
- package/src/runtime/array.js +53 -22
- package/src/runtime/date.js +15 -5
- package/src/runtime/index-client.js +41 -7
- package/src/runtime/index-server.js +7 -7
- package/src/runtime/internal/client/bindings.js +2 -2
- package/src/runtime/internal/client/blocks.js +40 -1
- package/src/runtime/internal/client/context.js +8 -0
- package/src/runtime/internal/client/for.js +3 -3
- package/src/runtime/internal/client/index.js +32 -5
- package/src/runtime/internal/client/render.js +20 -8
- package/src/runtime/internal/client/runtime.js +9 -7
- package/src/runtime/internal/client/template.js +1 -1
- package/src/runtime/internal/client/try.js +15 -22
- package/src/runtime/internal/client/utils.js +1 -1
- package/src/runtime/internal/server/context.js +8 -0
- package/src/runtime/internal/server/index.js +99 -6
- package/src/runtime/map.js +7 -7
- package/src/runtime/media-query.js +10 -1
- package/src/runtime/object.js +6 -6
- package/src/runtime/proxy.js +6 -6
- package/src/runtime/set.js +11 -11
- package/src/runtime/url-search-params.js +13 -2
- package/src/runtime/url.js +15 -5
- package/src/utils/builders.js +13 -3
- package/tests/client/array/array.copy-within.test.ripple +11 -11
- package/tests/client/array/array.derived.test.ripple +42 -42
- package/tests/client/array/array.iteration.test.ripple +12 -12
- package/tests/client/array/array.mutations.test.ripple +25 -25
- package/tests/client/array/array.static.test.ripple +103 -106
- package/tests/client/array/array.to-methods.test.ripple +8 -8
- package/tests/client/async-suspend.test.ripple +94 -0
- package/tests/client/basic/basic.attributes.test.ripple +31 -31
- package/tests/client/basic/basic.collections.test.ripple +7 -7
- package/tests/client/basic/basic.components.test.ripple +48 -10
- package/tests/client/basic/basic.errors.test.ripple +111 -30
- package/tests/client/basic/basic.events.test.ripple +11 -11
- package/tests/client/basic/basic.get-set.test.ripple +18 -18
- package/tests/client/basic/basic.reactivity.test.ripple +47 -42
- package/tests/client/basic/basic.rendering.test.ripple +7 -7
- package/tests/client/basic/basic.utilities.test.ripple +4 -4
- package/tests/client/boundaries.test.ripple +7 -7
- package/tests/client/compiler/__snapshots__/compiler.assignments.test.ripple.snap +2 -2
- package/tests/client/compiler/compiler.assignments.test.ripple +21 -21
- package/tests/client/compiler/compiler.basic.test.ripple +223 -82
- package/tests/client/compiler/compiler.tracked-access.test.ripple +8 -9
- package/tests/client/composite/composite.dynamic-components.test.ripple +8 -8
- package/tests/client/composite/composite.generics.test.ripple +4 -4
- package/tests/client/composite/composite.props.test.ripple +9 -9
- package/tests/client/composite/composite.reactivity.test.ripple +32 -26
- package/tests/client/composite/composite.render.test.ripple +13 -4
- package/tests/client/computed-properties.test.ripple +3 -3
- package/tests/client/context.test.ripple +3 -3
- package/tests/client/css/global-additional-cases.test.ripple +4 -4
- package/tests/client/css/style-identifier.test.ripple +49 -41
- package/tests/client/date.test.ripple +40 -40
- package/tests/client/dynamic-elements.test.ripple +165 -30
- package/tests/client/events.test.ripple +25 -25
- package/tests/client/for.test.ripple +76 -8
- package/tests/client/function-overload.test.ripple +0 -1
- package/tests/client/head.test.ripple +7 -7
- package/tests/client/html.test.ripple +2 -2
- package/tests/client/input-value.test.ripple +174 -176
- package/tests/client/map.test.ripple +21 -21
- package/tests/client/media-query.test.ripple +4 -4
- package/tests/client/object.test.ripple +12 -12
- package/tests/client/portal.test.ripple +4 -4
- package/tests/client/ref.test.ripple +5 -5
- package/tests/client/return.test.ripple +17 -17
- package/tests/client/set.test.ripple +16 -16
- package/tests/client/svg.test.ripple +6 -7
- package/tests/client/switch.test.ripple +10 -10
- package/tests/client/tracked-expression.test.ripple +1 -3
- package/tests/client/try.test.ripple +56 -4
- package/tests/client/url/url.derived.test.ripple +10 -9
- package/tests/client/url/url.parsing.test.ripple +10 -10
- package/tests/client/url/url.partial-removal.test.ripple +10 -10
- package/tests/client/url/url.reactivity.test.ripple +17 -17
- package/tests/client/url/url.serialization.test.ripple +4 -4
- package/tests/client/url-search-params/url-search-params.derived.test.ripple +11 -10
- package/tests/client/url-search-params/url-search-params.initialization.test.ripple +5 -7
- package/tests/client/url-search-params/url-search-params.iteration.test.ripple +13 -13
- package/tests/client/url-search-params/url-search-params.mutation.test.ripple +19 -19
- package/tests/client/url-search-params/url-search-params.retrieval.test.ripple +17 -17
- package/tests/client/url-search-params/url-search-params.serialization.test.ripple +5 -5
- package/tests/client/url-search-params/url-search-params.tracked-url.test.ripple +5 -5
- package/tests/hydration/compiled/client/events.js +8 -11
- package/tests/hydration/compiled/client/for.js +20 -23
- package/tests/hydration/compiled/client/head.js +17 -19
- package/tests/hydration/compiled/client/hmr.js +84 -0
- package/tests/hydration/compiled/client/html.js +1 -15
- package/tests/hydration/compiled/client/if-children.js +7 -9
- package/tests/hydration/compiled/client/if.js +5 -7
- package/tests/hydration/compiled/client/mixed-control-flow.js +3 -5
- package/tests/hydration/compiled/client/portal.js +1 -1
- package/tests/hydration/compiled/client/reactivity.js +9 -11
- package/tests/hydration/compiled/client/return.js +11 -13
- package/tests/hydration/compiled/client/switch.js +4 -6
- package/tests/hydration/compiled/server/basic.js +0 -1
- package/tests/hydration/compiled/server/composite.js +0 -3
- package/tests/hydration/compiled/server/events.js +8 -12
- package/tests/hydration/compiled/server/for.js +20 -23
- package/tests/hydration/compiled/server/head.js +17 -19
- package/tests/hydration/compiled/server/hmr.js +107 -0
- package/tests/hydration/compiled/server/html.js +1 -35
- package/tests/hydration/compiled/server/if-children.js +7 -11
- package/tests/hydration/compiled/server/if.js +5 -7
- package/tests/hydration/compiled/server/mixed-control-flow.js +3 -5
- package/tests/hydration/compiled/server/portal.js +1 -9
- package/tests/hydration/compiled/server/reactivity.js +9 -11
- package/tests/hydration/compiled/server/return.js +11 -13
- package/tests/hydration/compiled/server/switch.js +4 -6
- package/tests/hydration/components/events.ripple +8 -9
- package/tests/hydration/components/for.ripple +20 -21
- package/tests/hydration/components/head.ripple +6 -8
- package/tests/hydration/components/hmr.ripple +34 -0
- package/tests/hydration/components/html.ripple +1 -3
- package/tests/hydration/components/if-children.ripple +7 -8
- package/tests/hydration/components/if.ripple +5 -6
- package/tests/hydration/components/mixed-control-flow.ripple +4 -6
- package/tests/hydration/components/portal.ripple +1 -1
- package/tests/hydration/components/reactivity.ripple +9 -10
- package/tests/hydration/components/return.ripple +11 -12
- package/tests/hydration/components/switch.ripple +6 -8
- package/tests/hydration/hmr.test.js +74 -0
- package/tests/server/await.test.ripple +2 -2
- package/tests/server/basic.attributes.test.ripple +19 -21
- package/tests/server/basic.components.test.ripple +13 -7
- package/tests/server/basic.test.ripple +20 -21
- package/tests/server/compiler.test.ripple +5 -5
- package/tests/server/composite.props.test.ripple +6 -7
- package/tests/server/composite.test.ripple +4 -4
- package/tests/server/context.test.ripple +1 -3
- package/tests/server/dynamic-elements.test.ripple +24 -24
- package/tests/server/head.test.ripple +5 -7
- package/tests/server/style-identifier.test.ripple +16 -17
- package/types/index.d.ts +266 -62
- package/types/server.d.ts +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,91 @@
|
|
|
1
1
|
# ripple
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#779](https://github.com/Ripple-TS/ripple/pull/779)
|
|
8
|
+
[`74a10cc`](https://github.com/Ripple-TS/ripple/commit/74a10cc5701962cd7c72b144d59b35ecb76263a3)
|
|
9
|
+
Thanks [@leonidaz](https://github.com/leonidaz)! - Introduces #ripple namespace
|
|
10
|
+
for creating ripple reactive entities without imports, such as array, object,
|
|
11
|
+
map, set, date, url, urlSearchParams, mediaQuery. Adds track, untrack,
|
|
12
|
+
trackSplit, effect, context, server, style to the namespace. Deprecates #[] and
|
|
13
|
+
#{} in favor of #ripple[] and #ripple{}. Renames types and actual reactive
|
|
14
|
+
imports for TrackedX entities, such as TrackedArray, TrackedObject, etc. into
|
|
15
|
+
RippleArray, RippleObjec, etc.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#786](https://github.com/Ripple-TS/ripple/pull/786)
|
|
20
|
+
[`61271cb`](https://github.com/Ripple-TS/ripple/commit/61271cb1c4777f2ab9093c6c89a5ad771ec98b7d)
|
|
21
|
+
Thanks [@anubra266](https://github.com/anubra266)! - fix: preserve generic type
|
|
22
|
+
arguments in interface extends clauses for `compile_to_volar_mappings`
|
|
23
|
+
|
|
24
|
+
- [#772](https://github.com/Ripple-TS/ripple/pull/772)
|
|
25
|
+
[`21dd402`](https://github.com/Ripple-TS/ripple/commit/21dd4029d7e027a0706cb133b09530a722feb73d)
|
|
26
|
+
Thanks [@anubra266](https://github.com/anubra266)! - Fix ref handling for
|
|
27
|
+
dynamic elements with reactive spread props to avoid read-only/proxy symbol
|
|
28
|
+
errors and prevent unnecessary ref teardown/recreation.
|
|
29
|
+
|
|
30
|
+
- [#774](https://github.com/Ripple-TS/ripple/pull/774)
|
|
31
|
+
[`c2dbefe`](https://github.com/Ripple-TS/ripple/commit/c2dbefe5645c0c4f6e0ff4dc00d9c4de81616667)
|
|
32
|
+
Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - Fixes
|
|
33
|
+
language server type support for nested component call inside a parent
|
|
34
|
+
components that become props and should not be marked as unused by typescript
|
|
35
|
+
- Updated dependencies
|
|
36
|
+
[[`61271cb`](https://github.com/Ripple-TS/ripple/commit/61271cb1c4777f2ab9093c6c89a5ad771ec98b7d),
|
|
37
|
+
[`21dd402`](https://github.com/Ripple-TS/ripple/commit/21dd4029d7e027a0706cb133b09530a722feb73d),
|
|
38
|
+
[`c2dbefe`](https://github.com/Ripple-TS/ripple/commit/c2dbefe5645c0c4f6e0ff4dc00d9c4de81616667),
|
|
39
|
+
[`74a10cc`](https://github.com/Ripple-TS/ripple/commit/74a10cc5701962cd7c72b144d59b35ecb76263a3)]:
|
|
40
|
+
- ripple@0.3.0
|
|
41
|
+
|
|
42
|
+
## 0.2.216
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- [#757](https://github.com/Ripple-TS/ripple/pull/757)
|
|
47
|
+
[`9fb507d`](https://github.com/Ripple-TS/ripple/commit/9fb507d76af6fd6a5c636af1976d1e03d3e869ac)
|
|
48
|
+
Thanks [@leonidaz](https://github.com/leonidaz)! - fixes compiler error that was
|
|
49
|
+
generating async functions for call expressions inside if conditions when inside
|
|
50
|
+
async context
|
|
51
|
+
|
|
52
|
+
- [#751](https://github.com/Ripple-TS/ripple/pull/751)
|
|
53
|
+
[`e1de4bb`](https://github.com/Ripple-TS/ripple/commit/e1de4bb9df75342a693cda24d0999a423db05ec4)
|
|
54
|
+
Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - Fix
|
|
55
|
+
HMR "zoom" issue when a Ripple file is changed in the dev server.
|
|
56
|
+
|
|
57
|
+
When a layout component contained children with nested `if`/`for` blocks,
|
|
58
|
+
hydration would leave `hydrate_node` pointing deep inside the layout's root
|
|
59
|
+
element (e.g. a HYDRATION_END comment inside `<main>`). The `append()`
|
|
60
|
+
function's `parentNode === dom` check only handled direct children, so it missed
|
|
61
|
+
grandchild/deeper positions and incorrectly updated the branch block's `s.end`
|
|
62
|
+
to that deep internal node.
|
|
63
|
+
|
|
64
|
+
This caused two problems on HMR re-render:
|
|
65
|
+
1. `remove_block_dom(s.start, s.end)` removed wrong elements (the deep node was
|
|
66
|
+
treated as a sibling boundary, causing removal of unrelated content including
|
|
67
|
+
the root HYDRATION_END comment).
|
|
68
|
+
2. `target = hydrate_node` (set after the initial render) became `null` or
|
|
69
|
+
pointed outside the component's region, so new content was inserted at the
|
|
70
|
+
wrong DOM location — producing a layout that appeared "zoomed" because it
|
|
71
|
+
rendered outside its CSS container context.
|
|
72
|
+
|
|
73
|
+
The fix changes the `parentNode === dom` check to `dom.contains(hydrate_node)`,
|
|
74
|
+
consistent with the `anchor === dom` branch that already used `dom.contains()`.
|
|
75
|
+
This correctly resets `hydrate_node` to `dom`'s sibling level regardless of how
|
|
76
|
+
deeply nested it was inside `dom`.
|
|
77
|
+
|
|
78
|
+
- [#764](https://github.com/Ripple-TS/ripple/pull/764)
|
|
79
|
+
[`95ea864`](https://github.com/Ripple-TS/ripple/commit/95ea8645b2cb27e2610a4ace4c8fb238c92d441a)
|
|
80
|
+
Thanks [@leonidaz](https://github.com/leonidaz)! - Fixes syntax color
|
|
81
|
+
highlighting for `pending`
|
|
82
|
+
|
|
83
|
+
- Updated dependencies
|
|
84
|
+
[[`9fb507d`](https://github.com/Ripple-TS/ripple/commit/9fb507d76af6fd6a5c636af1976d1e03d3e869ac),
|
|
85
|
+
[`e1de4bb`](https://github.com/Ripple-TS/ripple/commit/e1de4bb9df75342a693cda24d0999a423db05ec4),
|
|
86
|
+
[`95ea864`](https://github.com/Ripple-TS/ripple/commit/95ea8645b2cb27e2610a4ace4c8fb238c92d441a)]:
|
|
87
|
+
- ripple@0.2.216
|
|
88
|
+
|
|
3
89
|
## 0.2.215
|
|
4
90
|
|
|
5
91
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Ripple is an elegant TypeScript UI framework",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Dominic Gannaway",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.3.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"module": "src/runtime/index-client.js",
|
|
9
9
|
"main": "src/runtime/index-client.js",
|
|
@@ -38,6 +38,15 @@
|
|
|
38
38
|
"require": "./src/compiler/index.js",
|
|
39
39
|
"default": "./src/compiler/index.js"
|
|
40
40
|
},
|
|
41
|
+
"./types/estree": {
|
|
42
|
+
"types": "./src/compiler/types/estree.d.ts"
|
|
43
|
+
},
|
|
44
|
+
"./types/estree-jsx": {
|
|
45
|
+
"types": "./src/compiler/types/estree-jsx.d.ts"
|
|
46
|
+
},
|
|
47
|
+
"./types/acorn": {
|
|
48
|
+
"types": "./src/compiler/types/acorn.d.ts"
|
|
49
|
+
},
|
|
41
50
|
"./compiler/internal/import": {
|
|
42
51
|
"types": "./src/compiler/types/import.d.ts"
|
|
43
52
|
},
|
|
@@ -78,24 +87,24 @@
|
|
|
78
87
|
"@sveltejs/acorn-typescript": "^1.0.9",
|
|
79
88
|
"acorn": "^8.15.0",
|
|
80
89
|
"clsx": "^2.1.1",
|
|
81
|
-
"devalue": "^5.3
|
|
90
|
+
"devalue": "^5.6.3",
|
|
82
91
|
"esm-env": "^1.2.2",
|
|
83
92
|
"esrap": "^2.1.0",
|
|
84
93
|
"is-reference": "^3.0.3",
|
|
85
94
|
"magic-string": "^0.30.18",
|
|
86
95
|
"muggle-string": "^0.4.1",
|
|
87
|
-
"zimmerframe": "^1.1.2"
|
|
96
|
+
"zimmerframe": "^1.1.2",
|
|
97
|
+
"@types/estree": "^1.0.8",
|
|
98
|
+
"@types/estree-jsx": "^1.0.5"
|
|
88
99
|
},
|
|
89
100
|
"devDependencies": {
|
|
90
|
-
"@types/estree": "^1.0.8",
|
|
91
|
-
"@types/estree-jsx": "^1.0.5",
|
|
92
101
|
"@types/node": "^24.3.0",
|
|
93
102
|
"@typescript-eslint/types": "^8.40.0",
|
|
94
|
-
"typescript": "^5.9.
|
|
103
|
+
"typescript": "^5.9.3",
|
|
95
104
|
"@volar/language-core": "~2.4.28",
|
|
96
105
|
"vscode-languageserver-types": "^3.17.5"
|
|
97
106
|
},
|
|
98
107
|
"peerDependencies": {
|
|
99
|
-
"ripple": "0.
|
|
108
|
+
"ripple": "0.3.0"
|
|
100
109
|
}
|
|
101
110
|
}
|
package/src/compiler/errors.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export const IDENTIFIER_OBFUSCATION_PREFIX = '_$_';
|
|
2
|
+
export const RIPPLE_NAMESPACE_IDENTIFIER =
|
|
3
|
+
IDENTIFIER_OBFUSCATION_PREFIX + encode_utf16_char('#') + 'ripple';
|
|
2
4
|
export const STYLE_IDENTIFIER = IDENTIFIER_OBFUSCATION_PREFIX + encode_utf16_char('#') + 'style';
|
|
3
5
|
export const SERVER_IDENTIFIER = IDENTIFIER_OBFUSCATION_PREFIX + encode_utf16_char('#') + 'server';
|
|
4
6
|
export const CSS_HASH_IDENTIFIER = IDENTIFIER_OBFUSCATION_PREFIX + 'hash';
|
package/src/compiler/index.d.ts
CHANGED
|
@@ -58,7 +58,6 @@ export interface PluginActionOverrides {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export interface CustomMappingData extends PluginActionOverrides {
|
|
61
|
-
generatedLengths: number[];
|
|
62
61
|
embeddedId?: string; // e.g. css regions: 'style_0', 'style_1', etc.
|
|
63
62
|
content?: string; // (e.g., css code)
|
|
64
63
|
}
|
|
@@ -67,12 +66,9 @@ export interface MappingData extends VolarCodeInformation {
|
|
|
67
66
|
customData: CustomMappingData;
|
|
68
67
|
}
|
|
69
68
|
|
|
70
|
-
export interface CodeMapping extends VolarMapping<MappingData> {
|
|
71
|
-
data: MappingData;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface CodeMappingWithAll extends CodeMapping {
|
|
69
|
+
export interface CodeMapping extends Omit<VolarMapping<MappingData>, 'generatedLengths'> {
|
|
75
70
|
generatedLengths: number[];
|
|
71
|
+
data: MappingData;
|
|
76
72
|
}
|
|
77
73
|
|
|
78
74
|
export interface VolarMappingsResult {
|