lilact 0.26.16 → 0.27.0

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.
Files changed (62) hide show
  1. package/dist/lilact.development.js +236 -337
  2. package/dist/lilact.development.js.map +3 -3
  3. package/dist/lilact.development.min.js +34 -34
  4. package/dist/lilact.development.min.js.map +3 -3
  5. package/dist/lilact.production.min.js +34 -34
  6. package/docs/assets/navigation.js +1 -1
  7. package/docs/assets/search.js +1 -1
  8. package/docs/classes/accessories.ErrorBoundary.html +8 -8
  9. package/docs/classes/accessories.Suspense.html +7 -7
  10. package/docs/classes/components.Component.html +11 -11
  11. package/docs/classes/components.HTMLComponent.html +11 -11
  12. package/docs/classes/components.RootComponent.html +11 -11
  13. package/docs/functions/components.cloneComponent.html +1 -1
  14. package/docs/functions/components.createComponent.html +1 -1
  15. package/docs/functions/components.createPortal.html +1 -1
  16. package/docs/functions/components.createRoot.html +1 -1
  17. package/docs/functions/components.memo.html +1 -1
  18. package/docs/functions/components.render.html +1 -1
  19. package/docs/functions/errors.globalErrorHandler.html +1 -2
  20. package/docs/functions/errors.scanBlockLabels.html +1 -2
  21. package/docs/functions/errors.traceError.html +1 -3
  22. package/docs/functions/hooks.startTransition.html +1 -1
  23. package/docs/functions/hooks.useActionState.html +1 -1
  24. package/docs/functions/hooks.useDebugValue.html +1 -1
  25. package/docs/functions/hooks.useDeferredValue.html +1 -1
  26. package/docs/functions/hooks.useEffect.html +1 -1
  27. package/docs/functions/hooks.useImperativeHandle.html +1 -1
  28. package/docs/functions/hooks.useInsertionEffect.html +1 -1
  29. package/docs/functions/hooks.useMemo.html +1 -1
  30. package/docs/functions/hooks.useReducer.html +1 -1
  31. package/docs/functions/run.lazy.html +1 -2
  32. package/docs/functions/run.require.html +1 -2
  33. package/docs/functions/run.run.html +1 -2
  34. package/docs/functions/run.runScripts.html +1 -1
  35. package/docs/functions/timers.timeoutPromise.html +3 -3
  36. package/docs/modules/errors.html +1 -1
  37. package/docs/modules/run.html +1 -1
  38. package/docs/static/index.html +1 -1
  39. package/docs/static/lilact.development.js +236 -337
  40. package/docs/static/lilact.development.js.map +3 -3
  41. package/docs/static/lilact.development.min.js +34 -34
  42. package/docs/static/lilact.development.min.js.map +3 -3
  43. package/docs/static/lilact.production.min.js +34 -34
  44. package/docs/variables/components.cloneElement.html +1 -1
  45. package/docs/variables/errors.blocks_info.html +1 -1
  46. package/docs/variables/errors.error.html +1 -1
  47. package/docs/variables/run.required_scripts.html +1 -0
  48. package/examples/index.html +1 -1
  49. package/examples/lilact.development.js +236 -337
  50. package/examples/lilact.development.js.map +3 -3
  51. package/examples/lilact.development.min.js +34 -34
  52. package/examples/lilact.development.min.js.map +3 -3
  53. package/examples/lilact.production.min.js +34 -34
  54. package/package.json +1 -1
  55. package/src/components.jsx +10 -4
  56. package/src/errors.jsx +179 -364
  57. package/src/expscan.js +1 -1
  58. package/src/hooks.jsx +8 -5
  59. package/src/jsx.js +14 -14
  60. package/src/lilact.jsx +1 -1
  61. package/src/run.jsx +119 -157
  62. package/docs/functions/errors.mapLocation.html +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lilact",
3
- "version": "0.26.16",
3
+ "version": "0.27.0",
4
4
  "description": "A Little React/JSX Runtime Implementation for Browser",
5
5
  "repository": "github:arashkazemi/lilact",
6
6
  "homepage": "https://arashkazemi.github.io/lilact/",
@@ -371,7 +371,7 @@ if(DEBUG) {
371
371
  if(this.outlet!==undefined) {
372
372
  for(let c of this.outlet) {
373
373
  if(c.cleanup) {
374
- c.cleanup();
374
+ promises.push(c.cleanup());
375
375
  }
376
376
  }
377
377
  }
@@ -379,7 +379,7 @@ if(DEBUG) {
379
379
  if(this.props?.children!==undefined) {
380
380
  for(let c of this.props.children) {
381
381
  if(c.cleanup) {
382
- c.cleanup();
382
+ promises.push(c.cleanup());
383
383
  }
384
384
  }
385
385
  }
@@ -387,10 +387,12 @@ if(DEBUG) {
387
387
  if(this.hooks!==undefined) {
388
388
  for(let h of this.hooks) {
389
389
  if(h.cleanup) {
390
- h.cleanup();
390
+ promises.push(h.cleanup());
391
391
  }
392
392
  }
393
393
  }
394
+
395
+ await Promise.all(promises);
394
396
  }
395
397
 
396
398
  catch(e) {
@@ -400,6 +402,9 @@ if(DEBUG) {
400
402
 
401
403
  updateElementProps(patch, force=false)
402
404
  {
405
+ // note: string.slice(0,undefined) returns the complete string. that's why
406
+ // the slices are correct even if maxLength is not set.
407
+
403
408
  if(this.entity==="input") {
404
409
  if(!patch?.type) patch.type = 'text';
405
410
  if(patch.type!==this.element.type) {
@@ -432,7 +437,7 @@ if(DEBUG) {
432
437
  this.event_detachers[al]();
433
438
  }
434
439
  else {
435
- this.element.setAttribute(a, undefined);
440
+ this.element.removeAttribute(a);
436
441
  }
437
442
  }
438
443
  }
@@ -485,6 +490,7 @@ if(DEBUG) {
485
490
  }
486
491
  else if(boolean_html_attributes_set.has(a)) { // not lower cased(al), as it is set as a js property
487
492
  this.element[a] = toBool(patch[a]);
493
+ if(!this.element[a]) this.element.removeAttribute(a);
488
494
  }
489
495
  else if(a==='autoFocus') { // not lower cased(al), as it is set as a js property
490
496
  this.element['autofocus'] = toBool(patch[a]);