lilact 0.28.4 → 0.28.5

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 (35) hide show
  1. package/dist/lilact.development.js +18 -13
  2. package/dist/lilact.development.js.map +2 -2
  3. package/dist/lilact.development.min.js +22 -22
  4. package/dist/lilact.development.min.js.map +2 -2
  5. package/dist/lilact.production.min.js +22 -22
  6. package/docs/classes/accessories.ErrorBoundary.html +8 -8
  7. package/docs/classes/accessories.Suspense.html +7 -7
  8. package/docs/classes/components.Component.html +11 -11
  9. package/docs/classes/components.HTMLComponent.html +11 -11
  10. package/docs/classes/components.RootComponent.html +11 -11
  11. package/docs/functions/components.cloneComponent.html +1 -1
  12. package/docs/functions/components.createComponent.html +1 -1
  13. package/docs/functions/components.createPortal.html +1 -1
  14. package/docs/functions/components.createRoot.html +1 -1
  15. package/docs/functions/components.memo.html +1 -1
  16. package/docs/functions/components.render.html +1 -1
  17. package/docs/functions/run.lazy.html +1 -1
  18. package/docs/functions/run.require.html +1 -1
  19. package/docs/functions/run.run.html +1 -1
  20. package/docs/functions/run.runScripts.html +1 -1
  21. package/docs/static/index.html +0 -2
  22. package/docs/static/lilact.development.js +18 -13
  23. package/docs/static/lilact.development.js.map +2 -2
  24. package/docs/static/lilact.development.min.js +22 -22
  25. package/docs/static/lilact.development.min.js.map +2 -2
  26. package/docs/static/lilact.production.min.js +22 -22
  27. package/docs/variables/components.cloneElement.html +1 -1
  28. package/examples/lilact.development.js +18 -13
  29. package/examples/lilact.development.js.map +2 -2
  30. package/examples/lilact.development.min.js +22 -22
  31. package/examples/lilact.development.min.js.map +2 -2
  32. package/examples/lilact.production.min.js +22 -22
  33. package/package.json +1 -1
  34. package/src/components.jsx +21 -14
  35. package/src/run.jsx +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lilact",
3
- "version": "0.28.4",
3
+ "version": "0.28.5",
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/",
@@ -310,23 +310,29 @@ if(DEBUG) {
310
310
  i--;
311
311
  }
312
312
  else {
313
- const core = prepareCore(this, item);
314
- this.outlet[i] = core;
313
+ try {
314
+ const core = prepareCore(this, item);
315
+ this.outlet[i] = core;
315
316
 
316
- if(core[TEXT]===undefined) {
317
- core.container= this.element? this : this.container;
318
- core.apply(item.props);
319
- }
320
- else {
321
- if(!core.element) {
322
- core.element = document.createTextNode(item[TEXT]);
323
- core[TEXT] = item[TEXT];
317
+ if(core[TEXT]===undefined) {
318
+ core.container = this.element? this : this.container;
319
+ core.apply(item.props);
324
320
  }
325
- else if(core[TEXT]!==item[TEXT]) {
326
- core.element.textContent = item[TEXT];
327
- core[TEXT] = item[TEXT];
321
+ else {
322
+ if(!core.element) {
323
+ core.element = document.createTextNode(item[TEXT]);
324
+ core[TEXT] = item[TEXT];
325
+ }
326
+ else if(core[TEXT]!==item[TEXT]) {
327
+ core.element.textContent = item[TEXT];
328
+ core[TEXT] = item[TEXT];
329
+ }
328
330
  }
329
331
  }
332
+ catch(e) {
333
+ renderErrorHandler(this, e);
334
+ }
335
+
330
336
  }
331
337
  }
332
338
 
@@ -633,10 +639,12 @@ if(DEBUG) {
633
639
  const renderErrorHandler = (c, e) =>
634
640
  {
635
641
  const stack = [c];
642
+
636
643
  while(c && !c.component?.componentDidCatch) {
637
644
  c = c.parent;
638
645
  if(c) stack.push(c);
639
646
  }
647
+
640
648
  if(c?.component?.componentDidCatch) {
641
649
  if(c.entity?.getDerivedStateFromError) {
642
650
  c.component.setState(c.entity.getDerivedStateFromError.call(c, e));
@@ -655,7 +663,6 @@ const renderErrorHandler = (c, e) =>
655
663
  c.component.componentDidCatch(e, {componentStack: stack, componentStackLog: stack_log});
656
664
  }
657
665
  else throw(e);
658
-
659
666
  }
660
667
 
661
668
 
package/src/run.jsx CHANGED
@@ -143,6 +143,7 @@ export function run(
143
143
  {
144
144
  isInline = true,
145
145
  isModule = true,
146
+ hotReload = true
146
147
  } = {}
147
148
  ) {
148
149
  let module = required_scripts[path];