ripple 0.3.2 → 0.3.3

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # ripple
2
2
 
3
+ ## 0.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#804](https://github.com/Ripple-TS/ripple/pull/804)
8
+ [`cd1073f`](https://github.com/Ripple-TS/ripple/commit/cd1073f7cc8085c8b200ada4faf77b2c35b10c6c)
9
+ Thanks [@leonidaz](https://github.com/leonidaz)! - Editor support for
10
+ #ripple.server
11
+
12
+ - Updated dependencies
13
+ [[`cd1073f`](https://github.com/Ripple-TS/ripple/commit/cd1073f7cc8085c8b200ada4faf77b2c35b10c6c)]:
14
+ - ripple@0.3.3
15
+
3
16
  ## 0.3.2
4
17
 
5
18
  ### 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.3.2",
6
+ "version": "0.3.3",
7
7
  "type": "module",
8
8
  "module": "src/runtime/index-client.js",
9
9
  "main": "src/runtime/index-client.js",
@@ -105,6 +105,6 @@
105
105
  "vscode-languageserver-types": "^3.17.5"
106
106
  },
107
107
  "peerDependencies": {
108
- "ripple": "0.3.2"
108
+ "ripple": "0.3.3"
109
109
  }
110
110
  }
@@ -2,7 +2,12 @@ export const IDENTIFIER_OBFUSCATION_PREFIX = '_$_';
2
2
  export const RIPPLE_NAMESPACE_IDENTIFIER =
3
3
  IDENTIFIER_OBFUSCATION_PREFIX + encode_utf16_char('#') + 'ripple';
4
4
  export const STYLE_IDENTIFIER = IDENTIFIER_OBFUSCATION_PREFIX + encode_utf16_char('#') + 'style';
5
- export const SERVER_IDENTIFIER = IDENTIFIER_OBFUSCATION_PREFIX + encode_utf16_char('#') + 'server';
5
+ export const SERVER_IDENTIFIER =
6
+ IDENTIFIER_OBFUSCATION_PREFIX +
7
+ encode_utf16_char('#') +
8
+ 'ripple' +
9
+ encode_utf16_char('.') +
10
+ 'server';
6
11
  export const CSS_HASH_IDENTIFIER = IDENTIFIER_OBFUSCATION_PREFIX + 'hash';
7
12
 
8
13
  const DECODE_UTF16_REGEX = /_u([0-9a-fA-F]{4})_/g;
@@ -541,9 +541,9 @@ const visitors = {
541
541
  },
542
542
 
543
543
  ServerIdentifier(node, context) {
544
- const id = b.id(SERVER_IDENTIFIER);
544
+ const id = b.id(SERVER_IDENTIFIER, /** @type {AST.NodeWithLocation} */ (node));
545
545
  id.metadata.source_name = '#ripple.server';
546
- return { ...node, ...id };
546
+ return id;
547
547
  },
548
548
 
549
549
  StyleIdentifier(node, context) {
@@ -2716,8 +2716,10 @@ const visitors = {
2716
2716
  );
2717
2717
  value.loc = node.loc;
2718
2718
 
2719
- const server_identifier = b.id(SERVER_IDENTIFIER);
2720
- server_identifier.loc = node.loc;
2719
+ const server_identifier = b.id(
2720
+ SERVER_IDENTIFIER,
2721
+ slice_loc_info(/** @type {AST.NodeWithLocation} */ (node), 0, '#ripple.server'.length),
2722
+ );
2721
2723
  // Add source_name to properly map longer generated back to '#ripple.server'
2722
2724
  server_identifier.metadata.source_name = '#ripple.server';
2723
2725
 
@@ -422,22 +422,6 @@ export function convert_source_map_to_mappings(
422
422
  loc: node.loc,
423
423
  metadata: {},
424
424
  };
425
-
426
- if (node.metadata.source_name === '#ripple') {
427
- // Suppress the private-identifier parse diagnostic while the user is
428
- // still typing a namespace access like `#ripple.` for completions.
429
- token.metadata.suppressedDiagnostics = [18016];
430
- }
431
-
432
- if (
433
- node.metadata.source_name === '#ripple.server' ||
434
- node.metadata.source_name === '#ripple.style'
435
- ) {
436
- // Let TextMate own the coloring for these namespace forms.
437
- // Their dedicated AST nodes otherwise cause semantic tokens to repaint
438
- // the full '#ripple.server' / '#ripple.style' span after TS attaches.
439
- token.mappingData = { ...mapping_data, semantic: false };
440
- }
441
425
  } else {
442
426
  token = {
443
427
  source: node.name,
@@ -445,12 +429,6 @@ export function convert_source_map_to_mappings(
445
429
  loc: node.loc,
446
430
  metadata: {},
447
431
  };
448
- if (node.name === '#ripple') {
449
- // Suppress the private-identifier parse diagnostic while the user is
450
- // still typing a namespace access like `#ripple.` for completions.
451
- token.metadata.suppressedDiagnostics = [18016];
452
- }
453
- // No transformation - source and generated names are the same
454
432
  }
455
433
 
456
434
  if (node.metadata?.is_component) {
@@ -519,8 +519,7 @@ export component App() {
519
519
  });
520
520
 
521
521
  it('parses bare #ripple in loose mode for autocomplete recovery', () => {
522
- const source = `
523
- export component App() {
522
+ const source = `export component App() {
524
523
  #ripple
525
524
  }
526
525
  `;
@@ -536,6 +535,6 @@ export component App() {
536
535
  mapping.lengths[0] === '#ripple'.length,
537
536
  );
538
537
 
539
- expect(mapping?.data.customData.suppressedDiagnostics).toContain(18016);
538
+ expect(mapping).toBeDefined();
540
539
  });
541
540
  });
package/types/index.d.ts CHANGED
@@ -545,6 +545,8 @@ export function bindFiles<V extends FileList>(
545
545
  setter?: SetFunction<V>,
546
546
  ): (node: HTMLInputElement) => void;
547
547
 
548
+ type ServerBlock = {};
549
+
548
550
  export interface RippleNamespace {
549
551
  array: RippleArrayCallable;
550
552
  object: RippleObjectCallable;
@@ -559,7 +561,8 @@ export interface RippleNamespace {
559
561
  untrack: typeof untrack;
560
562
  track: typeof track;
561
563
  trackSplit: typeof trackSplit;
562
- style: Record<string, string>; // Placeholder for style-related runtime class names (e.g., #ripple.style.someClass)
564
+ style: Record<string, string>;
565
+ server: ServerBlock;
563
566
  }
564
567
 
565
568
  export declare const ripple_namespace: RippleNamespace;