rip-lang 3.13.67 → 3.13.69

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rip-lang",
3
- "version": "3.13.67",
3
+ "version": "3.13.69",
4
4
  "description": "A modern language that compiles to JavaScript",
5
5
  "type": "module",
6
6
  "main": "src/compiler.js",
package/src/browser.js CHANGED
@@ -14,7 +14,7 @@ export const BUILD_DATE = "0000-00-00@00:00:00GMT";
14
14
  import { compile, compileToJS, formatSExpr, getReactiveRuntime, getComponentRuntime } from './compiler.js';
15
15
 
16
16
  // Eagerly register Rip's reactive and component runtimes on globalThis so that
17
- // framework code (app.rip) and browser-compiled scripts can use them directly
17
+ // framework code (ui.rip) and browser-compiled scripts can use them directly
18
18
  if (typeof globalThis !== 'undefined') {
19
19
  if (!globalThis.__rip) new Function(getReactiveRuntime())();
20
20
  if (!globalThis.__ripComponent) new Function(getComponentRuntime())();
@@ -108,7 +108,7 @@ async function processRipScripts() {
108
108
  // Step 5: data-launch triggers launch() for server mode
109
109
  const cfg = document.querySelector('script[data-launch]');
110
110
  if (cfg && !globalThis.__ripLaunched) {
111
- const ui = importRip.modules?.['app.rip'];
111
+ const ui = importRip.modules?.['ui.rip'];
112
112
  if (ui?.launch) {
113
113
  const url = cfg.getAttribute('data-launch') || '';
114
114
  const hash = cfg.getAttribute('data-hash');
@@ -126,10 +126,10 @@ export { processRipScripts };
126
126
  /**
127
127
  * Import a .rip file as an ES module
128
128
  * Fetches the URL, compiles Rip→JS, dynamically imports via Blob URL
129
- * Usage: const { launch } = await importRip('/app.rip')
129
+ * Usage: const { launch } = await importRip('/ui.rip')
130
130
  *
131
131
  * Pre-compiled modules can be registered on importRip.modules to skip fetching.
132
- * The browser bundle uses this to embed app.rip without a server round-trip.
132
+ * The browser bundle uses this to embed ui.rip without a server round-trip.
133
133
  */
134
134
  export async function importRip(url) {
135
135
  for (const [key, mod] of Object.entries(importRip.modules)) {
package/src/components.js CHANGED
@@ -1873,6 +1873,16 @@ export function installComponentSupport(CodeGenerator, Lexer) {
1873
1873
  props.push(`children: ${childrenVar}`);
1874
1874
  }
1875
1875
  }
1876
+ } else if (arg && !childrenVar) {
1877
+ const textVar = this.newTextVar();
1878
+ const val = typeof arg === 'string' ? arg.valueOf() : null;
1879
+ if (val && (val.startsWith('"') || val.startsWith("'") || val.startsWith('`'))) {
1880
+ this._createLines.push(`${textVar} = document.createTextNode(${val});`);
1881
+ } else {
1882
+ this._createLines.push(`${textVar} = document.createTextNode(${this.generateInComponent(arg, 'value')});`);
1883
+ }
1884
+ childrenVar = textVar;
1885
+ props.push(`children: ${childrenVar}`);
1876
1886
  }
1877
1887
  }
1878
1888
 
File without changes