rip-lang 3.13.11 → 3.13.13

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.3-blue.svg" alt="Version"></a>
12
+ <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-3.13.13-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%2C251%2F1%2C251-brightgreen.svg" alt="Tests"></a>
15
15
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
@@ -286,12 +286,12 @@ Rip's reactivity is framework-agnostic — use it with React, Vue, Svelte, or va
286
286
 
287
287
  ## Rip UI
288
288
 
289
- Load `rip-ui.min.js` (~53KB Brotli) — the Rip compiler and pre-compiled UI framework in one file. Components are `.rip` source files, compiled on demand, rendered with fine-grained reactivity. No build step. No bundler.
289
+ Load `rip.min.js` (~54KB Brotli) — the Rip compiler and UI framework in one file. Components are `.rip` source files, compiled on demand, rendered with fine-grained reactivity. No build step. No bundler.
290
290
 
291
291
  ```html
292
- <script type="module" src="rip-ui.min.js"></script>
292
+ <script defer src="rip.min.js" data-mount="Home"></script>
293
293
 
294
- <script type="text/rip" data-name="index">
294
+ <script type="text/rip">
295
295
  export Home = component
296
296
  @count := 0
297
297
  render
@@ -302,7 +302,43 @@ export Home = component
302
302
  </script>
303
303
  ```
304
304
 
305
- That's it. The runtime auto-detects inline `data-name` components, compiles them, and launches the app with hash routing no bootstrap script needed. Two keywords (`component` and `render`) are all the language adds. Everything else (`:=` state, `~=` computed, methods, lifecycle) is standard Rip.
305
+ That's it. All `<script type="text/rip">` tags share scope — `export` makes names visible across tags. `data-mount` mounts the named component after all scripts execute. Two keywords (`component` and `render`) are all the language adds. Everything else (`:=` state, `~=` computed, methods, lifecycle) is standard Rip.
306
+
307
+ **Loading patterns:**
308
+
309
+ ```html
310
+ <!-- Inline components + declarative mount -->
311
+ <script defer src="rip.min.js" data-mount="App"></script>
312
+ <script type="text/rip">export App = component ...</script>
313
+
314
+ <!-- Mount from code instead of data-mount -->
315
+ <script defer src="rip.min.js"></script>
316
+ <script type="text/rip">export App = component ...</script>
317
+ <script type="text/rip">App.mount '#app'</script>
318
+
319
+ <!-- External .rip files via data-src -->
320
+ <script defer src="rip.min.js" data-mount="App" data-src="
321
+ components/header.rip
322
+ components/footer.rip
323
+ app.rip
324
+ "></script>
325
+
326
+ <!-- External .rip files via separate tags -->
327
+ <script defer src="rip.min.js" data-mount="App"></script>
328
+ <script type="text/rip" src="components/header.rip"></script>
329
+ <script type="text/rip" src="app.rip"></script>
330
+
331
+ <!-- Server mode with full app lifecycle (router, stash, hot reload) -->
332
+ <script defer src="/rip/rip.min.js" data-launch="bundle"></script>
333
+
334
+ <!-- Server mode with stash persistence (sessionStorage) -->
335
+ <script defer src="/rip/rip.min.js" data-launch="bundle" data-persist></script>
336
+
337
+ <!-- Server mode with localStorage persistence -->
338
+ <script defer src="/rip/rip.min.js" data-launch="bundle" data-persist="local"></script>
339
+ ```
340
+
341
+ Every component has a static `mount(target)` method — `App.mount '#app'` is shorthand for `App.new().mount('#app')`. Target defaults to `'body'`.
306
342
 
307
343
  The UI framework is built into rip-lang: file-based router, reactive stash, component store, and renderer. **[Try the demo](https://shreeve.github.io/rip-lang/demo.html)** — a complete app in one HTML file.
308
344
 
@@ -329,7 +365,7 @@ Smaller codebase, modern output, built-in reactivity.
329
365
  Run Rip directly in the browser — inline scripts and the console REPL both support `await` via the `!` operator:
330
366
 
331
367
  ```html
332
- <script type="module" src="rip-ui.min.js"></script>
368
+ <script defer src="rip.min.js"></script>
333
369
  <script type="text/rip">
334
370
  res = fetch! 'https://api.example.com/data'
335
371
  data = res.json!
@@ -429,7 +465,7 @@ rip -t file.rip # Tokens
429
465
  rip -s file.rip # S-expressions
430
466
  bun run test # 1251 tests
431
467
  bun run parser # Rebuild parser
432
- bun run browser # Build browser bundle
468
+ bun run build # Build browser bundle
433
469
  ```
434
470
 
435
471
  ---
package/docs/charts.html CHANGED
@@ -8,7 +8,7 @@
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
9
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
10
10
  <script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1/dist/echarts.min.js"></script>
11
- <script type="module" src="dist/rip.min.js"></script>
11
+ <script defer src="dist/rip.min.js" data-mount="Dashboard"></script>
12
12
  <style>
13
13
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
14
14
  body {
@@ -65,7 +65,7 @@ h1 { font-size: 24px; font-weight: 600; color: #060606; margin-bottom: 4px; }
65
65
 
66
66
  <!-- ===== KpiCard ===== -->
67
67
 
68
- <script type="text/rip" data-name="kpi-card">
68
+ <script type="text/rip">
69
69
  export KpiCard = component
70
70
  @label := ''
71
71
  @value := ''
@@ -99,7 +99,7 @@ export KpiCard = component
99
99
 
100
100
  <!-- ===== ChartCard ===== -->
101
101
 
102
- <script type="text/rip" data-name="chart-card">
102
+ <script type="text/rip">
103
103
  export ChartCard = component
104
104
  @title := ''
105
105
  @subtitle := ''
@@ -116,7 +116,7 @@ export ChartCard = component
116
116
 
117
117
  <!-- ===== Dashboard ===== -->
118
118
 
119
- <script type="text/rip" data-name="index">
119
+ <script type="text/rip">
120
120
  export Dashboard = component
121
121
 
122
122
  # ── ECharts theme (evidence.dev) ──
@@ -859,7 +859,7 @@ export Dashboard = component
859
859
 
860
860
  render
861
861
  h1 "ACME Corp Dashboard"
862
- p class: 'subtitle', "FY 2026 SaaS Metrics \u2014 styled with the evidence.dev ECharts theme"
862
+ p class: 'subtitle', "FY 2026 SaaS Metrics - styled with the evidence.dev ECharts theme"
863
863
 
864
864
  .kpi-row
865
865
  for kpi in kpis
@@ -872,7 +872,7 @@ export Dashboard = component
872
872
  ChartCard title: 'Monthly Revenue', subtitle: 'Total recurring revenue by month', chartId: 'line'
873
873
  ChartCard title: 'Revenue by Product', subtitle: 'Stacked area breakdown across product lines', chartId: 'area'
874
874
  ChartCard title: 'Quarterly Revenue', subtitle: 'Quarter-over-quarter comparison', chartId: 'bar'
875
- ChartCard title: 'Revenue by Product \u00d7 Quarter', subtitle: 'Stacked bar with product breakdown', chartId: 'stackedBar'
875
+ ChartCard title: 'Revenue by Product × Quarter', subtitle: 'Stacked bar with product breakdown', chartId: 'stackedBar'
876
876
  ChartCard title: 'Revenue & Margin', subtitle: 'Revenue bars with gross margin % line overlay', chartId: 'combo'
877
877
  ChartCard title: 'Revenue & Growth Rate', subtitle: 'Dual-axis: revenue (left) and YoY growth (right)', chartId: 'multiAxis'
878
878
  ChartCard title: 'Customers by Segment', subtitle: 'Distribution across customer tiers', chartId: 'pie'
package/docs/demo.html CHANGED
@@ -8,7 +8,7 @@
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
9
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
10
10
  <script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1/dist/echarts.min.js"></script>
11
- <script type="module" src="dist/rip.min.js"></script>
11
+ <script defer src="dist/rip.min.js" data-mount="Dashboard"></script>
12
12
  <style>
13
13
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
14
14
  body {
@@ -65,7 +65,7 @@ h1 { font-size: 24px; font-weight: 600; color: #060606; margin-bottom: 4px; }
65
65
 
66
66
  <!-- ===== KpiCard ===== -->
67
67
 
68
- <script type="text/rip" data-name="kpi-card">
68
+ <script type="text/rip">
69
69
  export KpiCard = component
70
70
  @label := ''
71
71
  @value := ''
@@ -99,7 +99,7 @@ export KpiCard = component
99
99
 
100
100
  <!-- ===== ChartCard ===== -->
101
101
 
102
- <script type="text/rip" data-name="chart-card">
102
+ <script type="text/rip">
103
103
  export ChartCard = component
104
104
  @title := ''
105
105
  @subtitle := ''
@@ -116,7 +116,7 @@ export ChartCard = component
116
116
 
117
117
  <!-- ===== Dashboard ===== -->
118
118
 
119
- <script type="text/rip" data-name="index">
119
+ <script type="text/rip">
120
120
  export Dashboard = component
121
121
 
122
122
  # ── ECharts theme (evidence.dev) ──
@@ -923,7 +923,7 @@ export Dashboard = component
923
923
  return '' if p.seriesName is 'Error'
924
924
  d = cholesterolWithStd.find(-> it[0] is p.value[0])
925
925
  return "Age #{p.value[0]}<br>Avg: #{p.value[1]} mg/dL" unless d and d[2] > 0
926
- "Age #{d[0]}<br>Avg: #{d[1]} mg/dL<br>\u00b1#{d[2]} std dev"
926
+ "Age #{d[0]}<br>Avg: #{d[1]} mg/dL<br>±#{d[2]} std dev"
927
927
  legend: { show: false }
928
928
  series: [
929
929
  { type: 'custom', name: 'Error', data: cholesterolWithStd, renderItem: errorBarRenderer, z: 1 }
@@ -949,7 +949,7 @@ export Dashboard = component
949
949
 
950
950
  render
951
951
  h1 "ACME Corp Dashboard"
952
- p class: 'subtitle', "FY 2026 SaaS Metrics \u2014 styled with the evidence.dev ECharts theme"
952
+ p class: 'subtitle', "FY 2026 SaaS Metrics - styled with the evidence.dev ECharts theme"
953
953
 
954
954
  .kpi-row
955
955
  for kpi in kpis
@@ -962,7 +962,7 @@ export Dashboard = component
962
962
  ChartCard title: 'Monthly Revenue', subtitle: 'Total recurring revenue by month', chartId: 'line'
963
963
  ChartCard title: 'Revenue by Product', subtitle: 'Stacked area breakdown across product lines', chartId: 'area'
964
964
  ChartCard title: 'Quarterly Revenue', subtitle: 'Quarter-over-quarter comparison', chartId: 'bar'
965
- ChartCard title: 'Revenue by Product \u00d7 Quarter', subtitle: 'Stacked bar with product breakdown', chartId: 'stackedBar'
965
+ ChartCard title: 'Revenue by Product × Quarter', subtitle: 'Stacked bar with product breakdown', chartId: 'stackedBar'
966
966
  ChartCard title: 'Revenue & Margin', subtitle: 'Revenue bars with gross margin % line overlay', chartId: 'combo'
967
967
  ChartCard title: 'Revenue & Growth Rate', subtitle: 'Dual-axis: revenue (left) and YoY growth (right)', chartId: 'multiAxis'
968
968
  ChartCard title: 'Customers by Segment', subtitle: 'Distribution across customer tiers', chartId: 'pie'
@@ -1009,7 +1009,7 @@ export Dashboard = component
1009
1009
  p class: 'section', "Clinical"
1010
1010
  .grid
1011
1011
  ChartCard title: 'Hemoglobin A1c Distribution' , subtitle: 'Population distribution of A1c results (green: normal, yellow: pre-diabetic, red: diabetic)', chartId: 'a1c', wide: true
1012
- ChartCard title: 'Cholesterol by Age (\u00b11\u03c3)', subtitle: 'Average total cholesterol with standard deviation band and trend line', chartId: 'cholesterolBand', wide: true
1012
+ ChartCard title: 'Cholesterol by Age (±1σ)', subtitle: 'Average total cholesterol with standard deviation band and trend line', chartId: 'cholesterolBand', wide: true
1013
1013
  ChartCard title: 'Total Cholesterol by Age' , subtitle: 'Average total cholesterol vs patient age with trend line', chartId: 'cholesterol'
1014
1014
  </script>
1015
1015