ripple 0.3.13 → 0.3.14
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 +21 -0
- package/package.json +5 -30
- package/src/runtime/array.js +38 -38
- package/src/runtime/create-subscriber.js +2 -2
- package/src/runtime/internal/client/bindings.js +4 -6
- package/src/runtime/internal/client/events.js +8 -3
- package/src/runtime/internal/client/hmr.js +5 -17
- package/src/runtime/internal/client/runtime.js +1 -0
- package/src/runtime/internal/server/blocks.js +7 -9
- package/src/runtime/internal/server/index.js +14 -22
- package/src/runtime/media-query.js +34 -33
- package/src/runtime/object.js +7 -10
- package/src/runtime/proxy.js +2 -3
- package/src/runtime/reactive-value.js +23 -21
- package/src/utils/ast.js +1 -1
- package/src/utils/attributes.js +43 -0
- package/src/utils/builders.js +2 -2
- package/tests/client/basic/basic.errors.test.rsrx +1 -1
- package/tests/client/basic/basic.styling.test.rsrx +1 -1
- package/tests/client/compiler/compiler.assignments.test.rsrx +1 -1
- package/tests/client/compiler/compiler.attributes.test.rsrx +1 -1
- package/tests/client/compiler/compiler.basic.test.rsrx +13 -13
- package/tests/client/compiler/compiler.tracked-access.test.rsrx +1 -1
- package/tests/client/compiler/compiler.try-in-function.test.rsrx +1 -1
- package/tests/client/compiler/compiler.typescript.test.rsrx +1 -1
- package/tests/client/css/global-additional-cases.test.rsrx +1 -1
- package/tests/client/css/global-advanced-selectors.test.rsrx +1 -1
- package/tests/client/css/global-at-rules.test.rsrx +1 -1
- package/tests/client/css/global-basic.test.rsrx +1 -1
- package/tests/client/css/global-classes-ids.test.rsrx +1 -1
- package/tests/client/css/global-combinators.test.rsrx +1 -1
- package/tests/client/css/global-complex-nesting.test.rsrx +1 -1
- package/tests/client/css/global-edge-cases.test.rsrx +1 -1
- package/tests/client/css/global-keyframes.test.rsrx +1 -1
- package/tests/client/css/global-nested.test.rsrx +1 -1
- package/tests/client/css/global-pseudo.test.rsrx +1 -1
- package/tests/client/css/global-scoping.test.rsrx +1 -1
- package/tests/client/css/style-identifier.test.rsrx +1 -1
- package/tests/client/return.test.rsrx +1 -1
- package/tests/hydration/build-components.js +1 -1
- package/tests/server/style-identifier.test.rsrx +1 -1
- package/tests/setup-server.js +1 -1
- package/tests/utils/compiler-compat-config.test.js +1 -1
- package/src/compiler/comment-utils.js +0 -91
- package/src/compiler/errors.js +0 -77
- package/src/compiler/identifier-utils.js +0 -80
- package/src/compiler/index.d.ts +0 -127
- package/src/compiler/index.js +0 -89
- package/src/compiler/phases/1-parse/index.js +0 -3007
- package/src/compiler/phases/1-parse/style.js +0 -704
- package/src/compiler/phases/2-analyze/css-analyze.js +0 -160
- package/src/compiler/phases/2-analyze/index.js +0 -2208
- package/src/compiler/phases/2-analyze/prune.js +0 -1131
- package/src/compiler/phases/2-analyze/validation.js +0 -168
- package/src/compiler/phases/3-transform/client/index.js +0 -5264
- package/src/compiler/phases/3-transform/segments.js +0 -2125
- package/src/compiler/phases/3-transform/server/index.js +0 -1749
- package/src/compiler/phases/3-transform/stylesheet.js +0 -545
- package/src/compiler/scope.js +0 -476
- package/src/compiler/source-map-utils.js +0 -358
- package/src/compiler/types/acorn.d.ts +0 -11
- package/src/compiler/types/estree-jsx.d.ts +0 -11
- package/src/compiler/types/estree.d.ts +0 -11
- package/src/compiler/types/index.d.ts +0 -1411
- package/src/compiler/types/parse.d.ts +0 -1723
- package/src/compiler/utils.js +0 -1258
package/src/compiler/index.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/** @import * as AST from 'estree' */
|
|
2
|
-
|
|
3
|
-
import { parse as parse_module } from './phases/1-parse/index.js';
|
|
4
|
-
import { analyze } from './phases/2-analyze/index.js';
|
|
5
|
-
import { transform_client } from './phases/3-transform/client/index.js';
|
|
6
|
-
import { transform_server } from './phases/3-transform/server/index.js';
|
|
7
|
-
import { convert_source_map_to_mappings } from './phases/3-transform/segments.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Parse Ripple source code to ESTree AST
|
|
11
|
-
* @param {string} source
|
|
12
|
-
* @returns {AST.Program}
|
|
13
|
-
*/
|
|
14
|
-
export function parse(source) {
|
|
15
|
-
return parse_module(source, undefined, undefined);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Compile Ripple source code to JS/CSS output
|
|
20
|
-
* @param {string} source
|
|
21
|
-
* @param {string} filename
|
|
22
|
-
* @param {CompileOptions} [options]
|
|
23
|
-
* @returns {object}
|
|
24
|
-
*/
|
|
25
|
-
export function compile(source, filename, options = {}) {
|
|
26
|
-
const ast = parse_module(source, filename, undefined);
|
|
27
|
-
const analysis = analyze(ast, filename, options);
|
|
28
|
-
const result =
|
|
29
|
-
options.mode === 'server'
|
|
30
|
-
? transform_server(
|
|
31
|
-
filename,
|
|
32
|
-
source,
|
|
33
|
-
analysis,
|
|
34
|
-
options?.minify_css ?? false,
|
|
35
|
-
options?.dev ?? false,
|
|
36
|
-
)
|
|
37
|
-
: transform_client(
|
|
38
|
-
filename,
|
|
39
|
-
source,
|
|
40
|
-
analysis,
|
|
41
|
-
false,
|
|
42
|
-
options?.minify_css ?? false,
|
|
43
|
-
options?.hmr ?? false,
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/** @import { PostProcessingChanges, LineOffsets } from './phases/3-transform/client/index.js' */
|
|
50
|
-
/** @import { VolarMappingsResult, VolarCompileOptions, CompileOptions, RippleCompileError } from 'ripple/compiler' */
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Compile Ripple component to Volar virtual code with TypeScript mappings
|
|
54
|
-
* @param {string} source
|
|
55
|
-
* @param {string} filename
|
|
56
|
-
* @param {VolarCompileOptions} [options] - Compiler options
|
|
57
|
-
* @returns {VolarMappingsResult} Volar mappings object
|
|
58
|
-
*/
|
|
59
|
-
export function compile_to_volar_mappings(source, filename, options = {}) {
|
|
60
|
-
const errors = /** @type {RippleCompileError[]} */ ([]);
|
|
61
|
-
const comments = /** @type {AST.CommentWithLocation[]} */ ([]);
|
|
62
|
-
const ast = parse_module(source, filename, { ...options, errors, comments });
|
|
63
|
-
const analysis = analyze(ast, filename, {
|
|
64
|
-
to_ts: true,
|
|
65
|
-
loose: !!options?.loose,
|
|
66
|
-
errors,
|
|
67
|
-
comments,
|
|
68
|
-
});
|
|
69
|
-
const transformed = transform_client(
|
|
70
|
-
filename,
|
|
71
|
-
source,
|
|
72
|
-
analysis,
|
|
73
|
-
true,
|
|
74
|
-
options?.minify_css ?? false,
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
return {
|
|
78
|
-
...convert_source_map_to_mappings(
|
|
79
|
-
transformed.ast,
|
|
80
|
-
ast,
|
|
81
|
-
source,
|
|
82
|
-
transformed.js.code,
|
|
83
|
-
transformed.js.map,
|
|
84
|
-
/** @type {PostProcessingChanges} */ (transformed.js.post_processing_changes),
|
|
85
|
-
/** @type {LineOffsets} */ (transformed.js.line_offsets),
|
|
86
|
-
),
|
|
87
|
-
errors: transformed.errors,
|
|
88
|
-
};
|
|
89
|
-
}
|