rip-lang 3.13.32 → 3.13.34

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 CHANGED
@@ -9,7 +9,7 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-3.13.32-blue.svg" alt="Version"></a>
12
+ <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-3.13.34-blue.svg" alt="Version"></a>
13
13
  <a href="#zero-dependencies"><img src="https://img.shields.io/badge/dependencies-ZERO-brightgreen.svg" alt="Dependencies"></a>
14
14
  <a href="#"><img src="https://img.shields.io/badge/tests-1%2C300%2F1%2C300-brightgreen.svg" alt="Tests"></a>
15
15
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
package/bin/rip CHANGED
@@ -42,7 +42,7 @@ Options:
42
42
  -v, --version Show version number
43
43
 
44
44
  Subcommands:
45
- rip serve [flags] [app] Start server (watches *.rip, HTTPS, mDNS)
45
+ rip server [flags] [app] Start server (watches *.rip, HTTPS, mDNS)
46
46
  rip check [dir] Type-check all .rip files in directory
47
47
 
48
48
  Serve flags:
@@ -56,9 +56,9 @@ Examples:
56
56
  rip # Interactive REPL (terminal)
57
57
  rip script.rip # Execute script directly
58
58
  rip script.rip arg1 arg2 # Execute with arguments
59
- rip serve # Serve ./index.rip (watches *.rip)
60
- rip serve http # Serve HTTP-only
61
- rip serve myapp # Serve with mDNS name
59
+ rip server # Serve ./index.rip (watches *.rip)
60
+ rip server http # Serve HTTP-only
61
+ rip server myapp # Serve with mDNS name
62
62
  rip -c example.rip # Compile and show JavaScript
63
63
  rip -o output.js example.rip # Compile and save to file
64
64
  rip -s example.rip # Show ONLY s-expressions
@@ -128,7 +128,7 @@ async function main() {
128
128
  process.exit(exitCode);
129
129
  }
130
130
 
131
- if (args[0] === 'serve') {
131
+ if (args[0] === 'server') {
132
132
  let serverPath;
133
133
  try {
134
134
  serverPath = fileURLToPath(import.meta.resolve('@rip-lang/server/server'));
package/docs/RIP-LANG.md CHANGED
@@ -1278,7 +1278,7 @@ bun add @rip-lang/csv # CSV parser + writer
1278
1278
 
1279
1279
  ## @rip-lang/server — Web Framework & Production Server
1280
1280
 
1281
- Sinatra-style routing with `@` context magic and built-in validators. Run with `rip serve` for multi-worker production deployment with hot reload, HTTPS, and mDNS.
1281
+ Sinatra-style routing with `@` context magic and built-in validators. Run with `rip server` for multi-worker production deployment with hot reload, HTTPS, and mDNS.
1282
1282
 
1283
1283
  ```coffee
1284
1284
  import { get, post, use, read, start, notFound } from '@rip-lang/server'
@@ -1315,10 +1315,10 @@ start port: 3000
1315
1315
  ### Serving
1316
1316
 
1317
1317
  ```bash
1318
- rip serve # Start (uses ./index.rip)
1319
- rip serve --static # No watching, no hot reload (production)
1320
- rip serve myapp # Named (accessible at myapp.local)
1321
- rip serve http:3000 # HTTP on specific port
1318
+ rip server # Start (uses ./index.rip)
1319
+ rip server --static # No watching, no hot reload (production)
1320
+ rip server myapp # Named (accessible at myapp.local)
1321
+ rip server http:3000 # HTTP on specific port
1322
1322
  ```
1323
1323
 
1324
1324
  ### read() Validators
package/docs/dist/rip.js CHANGED
@@ -3801,23 +3801,36 @@ Expecting ${expected.join(", ")}, got '${this.tokenNames[symbol] || symbol}'`;
3801
3801
  tag = "div";
3802
3802
  return { tag, classes, id };
3803
3803
  };
3804
+ const _str = (s) => typeof s === "string" ? s : s instanceof String ? s.valueOf() : null;
3805
+ const _transferMeta = (from, to) => {
3806
+ if (!(from instanceof String))
3807
+ return to;
3808
+ const s = new String(to);
3809
+ if (from.predicate)
3810
+ s.predicate = true;
3811
+ if (from.await)
3812
+ s.await = true;
3813
+ return s.predicate || s.await ? s : to;
3814
+ };
3804
3815
  proto.transformComponentMembers = function(sexpr) {
3805
3816
  const self = this._self;
3806
3817
  if (!Array.isArray(sexpr)) {
3807
- if (typeof sexpr === "string" && this.reactiveMembers && this.reactiveMembers.has(sexpr)) {
3808
- return [".", [".", self, sexpr], "value"];
3818
+ const sv = _str(sexpr);
3819
+ if (sv && this.reactiveMembers && this.reactiveMembers.has(sv)) {
3820
+ return [".", [".", self, sv], _transferMeta(sexpr, "value")];
3809
3821
  }
3810
- if (typeof sexpr === "string" && this.componentMembers && this.componentMembers.has(sexpr)) {
3811
- return [".", self, sexpr];
3822
+ if (sv && this.componentMembers && this.componentMembers.has(sv)) {
3823
+ return [".", self, _transferMeta(sexpr, sv)];
3812
3824
  }
3813
3825
  return sexpr;
3814
3826
  }
3815
- if (sexpr[0] === "." && sexpr[1] === "this" && typeof sexpr[2] === "string") {
3816
- const memberName = sexpr[2];
3827
+ if (sexpr[0] === "." && sexpr[1] === "this" && _str(sexpr[2]) != null) {
3828
+ const prop = sexpr[2];
3829
+ const memberName = _str(prop);
3817
3830
  if (this.reactiveMembers && this.reactiveMembers.has(memberName)) {
3818
- return [".", [".", self, memberName], "value"];
3831
+ return [".", [".", self, memberName], _transferMeta(prop, "value")];
3819
3832
  }
3820
- return this._factoryMode ? [".", self, sexpr[2]] : sexpr;
3833
+ return this._factoryMode ? [".", self, prop] : sexpr;
3821
3834
  }
3822
3835
  if (sexpr[0] === "." || sexpr[0] === "?.") {
3823
3836
  return [sexpr[0], this.transformComponentMembers(sexpr[1]), sexpr[2]];
@@ -3937,7 +3950,7 @@ Expecting ${expected.join(", ")}, got '${this.tokenNames[symbol] || symbol}'`;
3937
3950
  lines.push(isPublic ? ` this.${name} = __state(props.__bind_${name}__ ?? props.${name} ?? ${val});` : ` this.${name} = __state(${val});`);
3938
3951
  }
3939
3952
  for (const { name, expr } of derivedVars) {
3940
- if (this.is(expr, "block") && expr.length > 2) {
3953
+ if (this.is(expr, "block")) {
3941
3954
  const transformed = this.transformComponentMembers(expr);
3942
3955
  const body2 = this.generateFunctionBody(transformed);
3943
3956
  lines.push(` this.${name} = __computed(() => ${body2});`);
@@ -3949,7 +3962,7 @@ Expecting ${expected.join(", ")}, got '${this.tokenNames[symbol] || symbol}'`;
3949
3962
  for (const effect of effects) {
3950
3963
  const effectBody = effect[2];
3951
3964
  const isAsync = this.containsAwait(effectBody) ? "async " : "";
3952
- if (this.is(effectBody, "block") && effectBody.length > 2) {
3965
+ if (this.is(effectBody, "block")) {
3953
3966
  const transformed = this.transformComponentMembers(effectBody);
3954
3967
  const body2 = this.generateFunctionBody(transformed, [], true);
3955
3968
  lines.push(` __effect(${isAsync}() => ${body2});`);
@@ -4113,6 +4126,12 @@ ${blockFactoriesCode}return ${lines.join(`
4113
4126
  this._pushEffect(`${textVar2}.data = ${this._self}.${str}.value;`);
4114
4127
  return textVar2;
4115
4128
  }
4129
+ if (str === "slot" && this.componentMembers) {
4130
+ const s = this._self;
4131
+ const slotVar = this.newElementVar("slot");
4132
+ this._createLines.push(`${slotVar} = ${s}.children instanceof Node ? ${s}.children : (${s}.children != null ? document.createTextNode(String(${s}.children)) : document.createComment(''));`);
4133
+ return slotVar;
4134
+ }
4116
4135
  const [tagStr, idStr] = str.split("#");
4117
4136
  const elVar = this.newElementVar();
4118
4137
  const actualTag = tagStr || "div";
@@ -4439,7 +4458,11 @@ ${blockFactoriesCode}return ${lines.join(`
4439
4458
  this._createLines.push(`if (${valueCode}) ${elVar}.setAttribute('${key}', '');`);
4440
4459
  }
4441
4460
  } else if (this.hasReactiveDeps(value)) {
4442
- this._pushEffect(`${elVar}.setAttribute('${key}', ${valueCode});`);
4461
+ if (Array.isArray(value) && value[0] === "presence") {
4462
+ this._pushEffect(`{ const __v = ${valueCode}; __v == null ? ${elVar}.removeAttribute('${key}') : ${elVar}.setAttribute('${key}', __v); }`);
4463
+ } else {
4464
+ this._pushEffect(`${elVar}.setAttribute('${key}', ${valueCode});`);
4465
+ }
4443
4466
  } else {
4444
4467
  this._createLines.push(`${elVar}.setAttribute('${key}', ${valueCode});`);
4445
4468
  }
@@ -8594,7 +8617,7 @@ globalThis.zip ??= (...a) => a[0].map((_, i) => a.map(b => b[i]));
8594
8617
  }
8595
8618
  // src/browser.js
8596
8619
  var VERSION = "3.13.32";
8597
- var BUILD_DATE = "2026-02-26@09:33:18GMT";
8620
+ var BUILD_DATE = "2026-02-26@17:50:29GMT";
8598
8621
  if (typeof globalThis !== "undefined") {
8599
8622
  if (!globalThis.__rip)
8600
8623
  new Function(getReactiveRuntime())();