rip-lang 3.13.8 → 3.13.10

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/docs/index.html CHANGED
@@ -495,7 +495,7 @@
495
495
  body.light .repl-prompt-text { color: #007acc; }
496
496
  </style>
497
497
  <link rel="preload" href="https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs/loader.js" as="script">
498
- <script type="module" src="dist/rip.min.js" data-url=""></script>
498
+ <script type="module" src="dist/rip.min.js"></script>
499
499
  </head>
500
500
  <body>
501
501
 
@@ -1307,7 +1307,7 @@
1307
1307
 
1308
1308
  { success: true, value: evalResult, result }
1309
1309
  catch error
1310
- { success: false, error: error.message }
1310
+ { success: false, error: error?.message or String(error or 'Unknown error') }
1311
1311
 
1312
1312
  # --- REPL Commands ---
1313
1313
 
@@ -1403,7 +1403,7 @@
1403
1403
  replBuffer = if replBuffer then replBuffer + "\n" + line else line
1404
1404
 
1405
1405
  # Try to evaluate
1406
- evalResult = evaluateRip replBuffer
1406
+ evalResult = evaluateRip! replBuffer
1407
1407
 
1408
1408
  if evalResult.success
1409
1409
  # Show debug info if enabled
@@ -1426,7 +1426,7 @@
1426
1426
  replBuffer = ''
1427
1427
  promptSpan.textContent = 'rip>'
1428
1428
 
1429
- else if evalResult.error.includes 'Unexpected end'
1429
+ else if evalResult.error?.includes 'Unexpected end'
1430
1430
  # Incomplete input — wait for more
1431
1431
  promptSpan.textContent = '....>'
1432
1432
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rip-lang",
3
- "version": "3.13.8",
3
+ "version": "3.13.10",
4
4
  "description": "A modern language that compiles to JavaScript",
5
5
  "type": "module",
6
6
  "main": "src/compiler.js",
package/src/app.rip CHANGED
@@ -908,9 +908,13 @@ export launch = (appBase = '', opts = {}) ->
908
908
  el.id = target.replace(/^#/, '')
909
909
  document.body.prepend el
910
910
 
911
- # Get the app bundle — explicit, static files, inline DOM, or server fetch
911
+ # Get the app bundle — explicit object, literal URL, static files, inline DOM, or server fetch
912
912
  if opts.bundle
913
913
  bundle = opts.bundle
914
+ else if opts.bundleUrl
915
+ res = await fetch(opts.bundleUrl, cache: 'no-cache')
916
+ throw new Error "launch: #{opts.bundleUrl} (#{res.status})" unless res.ok
917
+ bundle = res.json!
914
918
  else if opts.components and Array.isArray(opts.components)
915
919
  components = {}
916
920
  for url in opts.components
package/src/browser.js CHANGED
@@ -134,18 +134,20 @@ if (typeof globalThis !== 'undefined') {
134
134
  globalThis.__ripExports = { compile, compileToJS, formatSExpr, getStdlibCode, VERSION, BUILD_DATE, getReactiveRuntime, getComponentRuntime };
135
135
  }
136
136
 
137
- // Auto-launch: if app.rip is bundled and the page has component scripts or a data-url,
138
- // call launch() automatically with config from the script tag's data attributes.
139
- // Hash routing defaults to true (opt out with data-hash="false").
137
+ // Auto-launch: requires data-url or inline data-name scripts.
138
+ // data-url is the literal fetch URL for the component bundle.
140
139
  async function autoLaunch() {
141
140
  if (globalThis.__ripLaunched) return;
142
141
  const ui = importRip.modules?.['app.rip'];
143
142
  if (!ui?.launch) return;
144
- const cfg = document.querySelector('script[data-hash], script[data-url]');
143
+ const cfg = document.querySelector('script[data-url], script[data-hash]');
144
+ const tag = document.querySelectorAll('script[type="text/rip"][data-name]').length > 0;
145
+ if (!cfg && !tag) return;
145
146
  const url = cfg?.getAttribute('data-url') || '';
146
147
  const hash = cfg?.getAttribute('data-hash');
147
148
  const opts = { hash: hash !== 'false' };
148
- await ui.launch(url, opts);
149
+ if (url) opts.bundleUrl = url;
150
+ await ui.launch('', opts);
149
151
  }
150
152
 
151
153
  // Auto-process <script type="text/rip"> blocks, then auto-launch if applicable.