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.
Files changed (66) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/package.json +5 -30
  3. package/src/runtime/array.js +38 -38
  4. package/src/runtime/create-subscriber.js +2 -2
  5. package/src/runtime/internal/client/bindings.js +4 -6
  6. package/src/runtime/internal/client/events.js +8 -3
  7. package/src/runtime/internal/client/hmr.js +5 -17
  8. package/src/runtime/internal/client/runtime.js +1 -0
  9. package/src/runtime/internal/server/blocks.js +7 -9
  10. package/src/runtime/internal/server/index.js +14 -22
  11. package/src/runtime/media-query.js +34 -33
  12. package/src/runtime/object.js +7 -10
  13. package/src/runtime/proxy.js +2 -3
  14. package/src/runtime/reactive-value.js +23 -21
  15. package/src/utils/ast.js +1 -1
  16. package/src/utils/attributes.js +43 -0
  17. package/src/utils/builders.js +2 -2
  18. package/tests/client/basic/basic.errors.test.rsrx +1 -1
  19. package/tests/client/basic/basic.styling.test.rsrx +1 -1
  20. package/tests/client/compiler/compiler.assignments.test.rsrx +1 -1
  21. package/tests/client/compiler/compiler.attributes.test.rsrx +1 -1
  22. package/tests/client/compiler/compiler.basic.test.rsrx +13 -13
  23. package/tests/client/compiler/compiler.tracked-access.test.rsrx +1 -1
  24. package/tests/client/compiler/compiler.try-in-function.test.rsrx +1 -1
  25. package/tests/client/compiler/compiler.typescript.test.rsrx +1 -1
  26. package/tests/client/css/global-additional-cases.test.rsrx +1 -1
  27. package/tests/client/css/global-advanced-selectors.test.rsrx +1 -1
  28. package/tests/client/css/global-at-rules.test.rsrx +1 -1
  29. package/tests/client/css/global-basic.test.rsrx +1 -1
  30. package/tests/client/css/global-classes-ids.test.rsrx +1 -1
  31. package/tests/client/css/global-combinators.test.rsrx +1 -1
  32. package/tests/client/css/global-complex-nesting.test.rsrx +1 -1
  33. package/tests/client/css/global-edge-cases.test.rsrx +1 -1
  34. package/tests/client/css/global-keyframes.test.rsrx +1 -1
  35. package/tests/client/css/global-nested.test.rsrx +1 -1
  36. package/tests/client/css/global-pseudo.test.rsrx +1 -1
  37. package/tests/client/css/global-scoping.test.rsrx +1 -1
  38. package/tests/client/css/style-identifier.test.rsrx +1 -1
  39. package/tests/client/return.test.rsrx +1 -1
  40. package/tests/hydration/build-components.js +1 -1
  41. package/tests/server/style-identifier.test.rsrx +1 -1
  42. package/tests/setup-server.js +1 -1
  43. package/tests/utils/compiler-compat-config.test.js +1 -1
  44. package/src/compiler/comment-utils.js +0 -91
  45. package/src/compiler/errors.js +0 -77
  46. package/src/compiler/identifier-utils.js +0 -80
  47. package/src/compiler/index.d.ts +0 -127
  48. package/src/compiler/index.js +0 -89
  49. package/src/compiler/phases/1-parse/index.js +0 -3007
  50. package/src/compiler/phases/1-parse/style.js +0 -704
  51. package/src/compiler/phases/2-analyze/css-analyze.js +0 -160
  52. package/src/compiler/phases/2-analyze/index.js +0 -2208
  53. package/src/compiler/phases/2-analyze/prune.js +0 -1131
  54. package/src/compiler/phases/2-analyze/validation.js +0 -168
  55. package/src/compiler/phases/3-transform/client/index.js +0 -5264
  56. package/src/compiler/phases/3-transform/segments.js +0 -2125
  57. package/src/compiler/phases/3-transform/server/index.js +0 -1749
  58. package/src/compiler/phases/3-transform/stylesheet.js +0 -545
  59. package/src/compiler/scope.js +0 -476
  60. package/src/compiler/source-map-utils.js +0 -358
  61. package/src/compiler/types/acorn.d.ts +0 -11
  62. package/src/compiler/types/estree-jsx.d.ts +0 -11
  63. package/src/compiler/types/estree.d.ts +0 -11
  64. package/src/compiler/types/index.d.ts +0 -1411
  65. package/src/compiler/types/parse.d.ts +0 -1723
  66. package/src/compiler/utils.js +0 -1258
@@ -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
- }