@odoo/owl 3.0.0-alpha.24 → 3.0.0-alpha.26
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/dist/compile_templates.mjs +19 -3
- package/dist/owl-devtools.zip +0 -0
- package/dist/owl.cjs.js +69 -38
- package/dist/owl.es.js +69 -38
- package/dist/owl.iife.js +69 -38
- package/dist/owl.iife.min.js +1 -1
- package/dist/types/compiler/code_generator.d.ts +2 -1
- package/dist/types/compiler/inline_expressions.d.ts +0 -6
- package/dist/types/compiler/parser.d.ts +1 -1
- package/dist/types/owl.d.ts +7 -9
- package/dist/types/runtime/app.d.ts +1 -2
- package/dist/types/runtime/blockdom/block_compiler.d.ts +0 -1
- package/dist/types/runtime/blockdom/index.d.ts +4 -3
- package/dist/types/runtime/component_node.d.ts +1 -3
- package/dist/types/runtime/rendering/fibers.d.ts +3 -3
- package/dist/types/runtime/types.d.ts +1 -1
- package/dist/types/runtime/utils.d.ts +2 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -474,6 +474,7 @@ class CodeTarget {
|
|
|
474
474
|
tSetVars = new Map();
|
|
475
475
|
code = [];
|
|
476
476
|
hasRoot = false;
|
|
477
|
+
deferReturn = false;
|
|
477
478
|
needsScopeProtection = false;
|
|
478
479
|
on;
|
|
479
480
|
constructor(name, on) {
|
|
@@ -554,8 +555,13 @@ class CodeGenerator {
|
|
|
554
555
|
this.dev = options.dev || false;
|
|
555
556
|
this.ast = ast;
|
|
556
557
|
this.templateName = options.name;
|
|
557
|
-
if (options.name
|
|
558
|
-
|
|
558
|
+
if (options.name) {
|
|
559
|
+
if (options.name.startsWith("__")) {
|
|
560
|
+
this.target.name = options.name;
|
|
561
|
+
}
|
|
562
|
+
else {
|
|
563
|
+
this.target.name = `template_${options.name.replace(/[^a-zA-Z0-9_$]/g, "_")}`;
|
|
564
|
+
}
|
|
559
565
|
}
|
|
560
566
|
if (options.hasGlobalValues) {
|
|
561
567
|
this.helpers.add("__globals__");
|
|
@@ -666,7 +672,7 @@ class CodeGenerator {
|
|
|
666
672
|
if (ctx.tKeyExpr) {
|
|
667
673
|
blockExpr = `toggler(${ctx.tKeyExpr}, ${blockExpr})`;
|
|
668
674
|
}
|
|
669
|
-
if (block.isRoot) {
|
|
675
|
+
if (block.isRoot && !this.target.deferReturn) {
|
|
670
676
|
if (this.target.on) {
|
|
671
677
|
blockExpr = this.wrapWithEventCatcher(blockExpr, this.target.on);
|
|
672
678
|
}
|
|
@@ -1153,10 +1159,20 @@ class CodeGenerator {
|
|
|
1153
1159
|
const n = ast.content.filter((c) => !c.hasNoRepresentation).length;
|
|
1154
1160
|
let result = null;
|
|
1155
1161
|
if (n <= 1) {
|
|
1162
|
+
// Check if there are non-DOM directives (like t-set) after the DOM child.
|
|
1163
|
+
// If so, defer the return so those directives are compiled before it.
|
|
1164
|
+
const shouldDefer = !this.target.hasRoot && ast.content[ast.content.length - 1].hasNoRepresentation;
|
|
1165
|
+
if (shouldDefer) {
|
|
1166
|
+
this.target.deferReturn = true;
|
|
1167
|
+
}
|
|
1156
1168
|
for (let child of ast.content) {
|
|
1157
1169
|
const blockName = this.compileAST(child, ctx);
|
|
1158
1170
|
result = result || blockName;
|
|
1159
1171
|
}
|
|
1172
|
+
if (shouldDefer) {
|
|
1173
|
+
this.target.deferReturn = false;
|
|
1174
|
+
this.addLine(`return ${result};`);
|
|
1175
|
+
}
|
|
1160
1176
|
return result;
|
|
1161
1177
|
}
|
|
1162
1178
|
block = this.createBlock(block, "multi", ctx);
|
package/dist/owl-devtools.zip
CHANGED
|
Binary file
|
package/dist/owl.cjs.js
CHANGED
|
@@ -2322,7 +2322,6 @@ class MountFiber extends RootFiber {
|
|
|
2322
2322
|
}
|
|
2323
2323
|
|
|
2324
2324
|
class ComponentNode {
|
|
2325
|
-
el;
|
|
2326
2325
|
app;
|
|
2327
2326
|
fiber = null;
|
|
2328
2327
|
component;
|
|
@@ -2370,16 +2369,6 @@ class ComponentNode {
|
|
|
2370
2369
|
setComputation(previousComputation);
|
|
2371
2370
|
contextStack.length = 0; // clear context stack
|
|
2372
2371
|
}
|
|
2373
|
-
mountComponent(target, options) {
|
|
2374
|
-
const fiber = new MountFiber(this, target, options);
|
|
2375
|
-
this.app.scheduler.addFiber(fiber);
|
|
2376
|
-
let prev = getCurrentComputation();
|
|
2377
|
-
this.initiateRender(fiber);
|
|
2378
|
-
// only useful if the component is a root, and a willstart function just
|
|
2379
|
-
// crashed synchonously. In that case, it is possible that the previous
|
|
2380
|
-
// computation has not been properly restored
|
|
2381
|
-
setComputation(prev);
|
|
2382
|
-
}
|
|
2383
2372
|
async initiateRender(fiber) {
|
|
2384
2373
|
this.fiber = fiber;
|
|
2385
2374
|
if (this.mounted.length) {
|
|
@@ -2394,6 +2383,7 @@ class ComponentNode {
|
|
|
2394
2383
|
await Promise.all(promises);
|
|
2395
2384
|
}
|
|
2396
2385
|
catch (e) {
|
|
2386
|
+
setComputation(prev);
|
|
2397
2387
|
handleError({ node: this, error: e });
|
|
2398
2388
|
return;
|
|
2399
2389
|
}
|
|
@@ -3183,7 +3173,21 @@ function createComponent(app, name, isStatic, hasSlotsProp, hasDynamicPropList,
|
|
|
3183
3173
|
if (node) {
|
|
3184
3174
|
if (arePropsDifferent(node.props, props) || parentFiber.deep || node.forceNextRender) {
|
|
3185
3175
|
node.forceNextRender = false;
|
|
3186
|
-
|
|
3176
|
+
if (node.willUpdateProps.length) {
|
|
3177
|
+
updateAndRender.call(node, props, parentFiber);
|
|
3178
|
+
}
|
|
3179
|
+
else {
|
|
3180
|
+
// Synchronous fast path — no willUpdateProps hooks
|
|
3181
|
+
const fiber = makeChildFiber(node, parentFiber);
|
|
3182
|
+
node.fiber = fiber;
|
|
3183
|
+
node.props = props;
|
|
3184
|
+
const parentRoot = parentFiber.root;
|
|
3185
|
+
if (node.willPatch.length)
|
|
3186
|
+
parentRoot.willPatch.push(fiber);
|
|
3187
|
+
if (node.patched.length)
|
|
3188
|
+
parentRoot.patched.push(fiber);
|
|
3189
|
+
fiber.render();
|
|
3190
|
+
}
|
|
3187
3191
|
}
|
|
3188
3192
|
}
|
|
3189
3193
|
else {
|
|
@@ -3804,6 +3808,7 @@ class CodeTarget {
|
|
|
3804
3808
|
tSetVars = new Map();
|
|
3805
3809
|
code = [];
|
|
3806
3810
|
hasRoot = false;
|
|
3811
|
+
deferReturn = false;
|
|
3807
3812
|
needsScopeProtection = false;
|
|
3808
3813
|
on;
|
|
3809
3814
|
constructor(name, on) {
|
|
@@ -3884,8 +3889,13 @@ class CodeGenerator {
|
|
|
3884
3889
|
this.dev = options.dev || false;
|
|
3885
3890
|
this.ast = ast;
|
|
3886
3891
|
this.templateName = options.name;
|
|
3887
|
-
if (options.name
|
|
3888
|
-
|
|
3892
|
+
if (options.name) {
|
|
3893
|
+
if (options.name.startsWith("__")) {
|
|
3894
|
+
this.target.name = options.name;
|
|
3895
|
+
}
|
|
3896
|
+
else {
|
|
3897
|
+
this.target.name = `template_${options.name.replace(/[^a-zA-Z0-9_$]/g, "_")}`;
|
|
3898
|
+
}
|
|
3889
3899
|
}
|
|
3890
3900
|
if (options.hasGlobalValues) {
|
|
3891
3901
|
this.helpers.add("__globals__");
|
|
@@ -3996,7 +4006,7 @@ class CodeGenerator {
|
|
|
3996
4006
|
if (ctx.tKeyExpr) {
|
|
3997
4007
|
blockExpr = `toggler(${ctx.tKeyExpr}, ${blockExpr})`;
|
|
3998
4008
|
}
|
|
3999
|
-
if (block.isRoot) {
|
|
4009
|
+
if (block.isRoot && !this.target.deferReturn) {
|
|
4000
4010
|
if (this.target.on) {
|
|
4001
4011
|
blockExpr = this.wrapWithEventCatcher(blockExpr, this.target.on);
|
|
4002
4012
|
}
|
|
@@ -4483,10 +4493,20 @@ class CodeGenerator {
|
|
|
4483
4493
|
const n = ast.content.filter((c) => !c.hasNoRepresentation).length;
|
|
4484
4494
|
let result = null;
|
|
4485
4495
|
if (n <= 1) {
|
|
4496
|
+
// Check if there are non-DOM directives (like t-set) after the DOM child.
|
|
4497
|
+
// If so, defer the return so those directives are compiled before it.
|
|
4498
|
+
const shouldDefer = !this.target.hasRoot && ast.content[ast.content.length - 1].hasNoRepresentation;
|
|
4499
|
+
if (shouldDefer) {
|
|
4500
|
+
this.target.deferReturn = true;
|
|
4501
|
+
}
|
|
4486
4502
|
for (let child of ast.content) {
|
|
4487
4503
|
const blockName = this.compileAST(child, ctx);
|
|
4488
4504
|
result = result || blockName;
|
|
4489
4505
|
}
|
|
4506
|
+
if (shouldDefer) {
|
|
4507
|
+
this.target.deferReturn = false;
|
|
4508
|
+
this.addLine(`return ${result};`);
|
|
4509
|
+
}
|
|
4490
4510
|
return result;
|
|
4491
4511
|
}
|
|
4492
4512
|
block = this.createBlock(block, "multi", ctx);
|
|
@@ -5680,7 +5700,7 @@ function compile(template, options = {
|
|
|
5680
5700
|
}
|
|
5681
5701
|
|
|
5682
5702
|
// do not modify manually. This file is generated by the release script.
|
|
5683
|
-
const version = "3.0.0-alpha.
|
|
5703
|
+
const version = "3.0.0-alpha.26";
|
|
5684
5704
|
|
|
5685
5705
|
function effect(fn) {
|
|
5686
5706
|
const computation = createComputation(() => {
|
|
@@ -5974,7 +5994,37 @@ class App extends TemplateSet {
|
|
|
5974
5994
|
return promise;
|
|
5975
5995
|
}
|
|
5976
5996
|
App.validateTarget(target);
|
|
5977
|
-
|
|
5997
|
+
// Set up error handler and onMounted callback
|
|
5998
|
+
let handlers = nodeErrorHandlers.get(node);
|
|
5999
|
+
if (!handlers) {
|
|
6000
|
+
handlers = [];
|
|
6001
|
+
nodeErrorHandlers.set(node, handlers);
|
|
6002
|
+
}
|
|
6003
|
+
handlers.unshift((e, finalize) => {
|
|
6004
|
+
const finalError = finalize();
|
|
6005
|
+
reject(finalError);
|
|
6006
|
+
});
|
|
6007
|
+
node.mounted.push(() => {
|
|
6008
|
+
resolve(node.component);
|
|
6009
|
+
handlers.shift();
|
|
6010
|
+
});
|
|
6011
|
+
const fiber = new MountFiber(node, target, options);
|
|
6012
|
+
this.scheduler.addFiber(fiber);
|
|
6013
|
+
if (node.willStart.length) {
|
|
6014
|
+
node.initiateRender(fiber);
|
|
6015
|
+
}
|
|
6016
|
+
else {
|
|
6017
|
+
node.fiber = fiber;
|
|
6018
|
+
if (node.mounted.length) {
|
|
6019
|
+
fiber.root.mounted.push(fiber);
|
|
6020
|
+
}
|
|
6021
|
+
try {
|
|
6022
|
+
fiber.render();
|
|
6023
|
+
}
|
|
6024
|
+
catch (e) {
|
|
6025
|
+
reject(e);
|
|
6026
|
+
}
|
|
6027
|
+
}
|
|
5978
6028
|
return promise;
|
|
5979
6029
|
},
|
|
5980
6030
|
destroy: () => {
|
|
@@ -5986,25 +6036,6 @@ class App extends TemplateSet {
|
|
|
5986
6036
|
this.roots.add(root);
|
|
5987
6037
|
return root;
|
|
5988
6038
|
}
|
|
5989
|
-
mountNode(node, target, resolve, reject, options) {
|
|
5990
|
-
// Manually add the last resort error handler on the node
|
|
5991
|
-
let handlers = nodeErrorHandlers.get(node);
|
|
5992
|
-
if (!handlers) {
|
|
5993
|
-
handlers = [];
|
|
5994
|
-
nodeErrorHandlers.set(node, handlers);
|
|
5995
|
-
}
|
|
5996
|
-
handlers.unshift((e, finalize) => {
|
|
5997
|
-
const finalError = finalize();
|
|
5998
|
-
reject(finalError);
|
|
5999
|
-
});
|
|
6000
|
-
// manually set a onMounted callback.
|
|
6001
|
-
// that way, we are independant from the current node.
|
|
6002
|
-
node.mounted.push(() => {
|
|
6003
|
-
resolve(node.component);
|
|
6004
|
-
handlers.shift();
|
|
6005
|
-
});
|
|
6006
|
-
node.mountComponent(target, options);
|
|
6007
|
-
}
|
|
6008
6039
|
destroy() {
|
|
6009
6040
|
for (let root of this.roots) {
|
|
6010
6041
|
root.destroy();
|
|
@@ -6837,6 +6868,6 @@ exports.whenReady = whenReady;
|
|
|
6837
6868
|
exports.xml = xml;
|
|
6838
6869
|
|
|
6839
6870
|
|
|
6840
|
-
__info__.date = '2026-04-
|
|
6841
|
-
__info__.hash = '
|
|
6871
|
+
__info__.date = '2026-04-13T09:25:02.574Z';
|
|
6872
|
+
__info__.hash = 'fddcc27';
|
|
6842
6873
|
__info__.url = 'https://github.com/odoo/owl';
|
package/dist/owl.es.js
CHANGED
|
@@ -2320,7 +2320,6 @@ class MountFiber extends RootFiber {
|
|
|
2320
2320
|
}
|
|
2321
2321
|
|
|
2322
2322
|
class ComponentNode {
|
|
2323
|
-
el;
|
|
2324
2323
|
app;
|
|
2325
2324
|
fiber = null;
|
|
2326
2325
|
component;
|
|
@@ -2368,16 +2367,6 @@ class ComponentNode {
|
|
|
2368
2367
|
setComputation(previousComputation);
|
|
2369
2368
|
contextStack.length = 0; // clear context stack
|
|
2370
2369
|
}
|
|
2371
|
-
mountComponent(target, options) {
|
|
2372
|
-
const fiber = new MountFiber(this, target, options);
|
|
2373
|
-
this.app.scheduler.addFiber(fiber);
|
|
2374
|
-
let prev = getCurrentComputation();
|
|
2375
|
-
this.initiateRender(fiber);
|
|
2376
|
-
// only useful if the component is a root, and a willstart function just
|
|
2377
|
-
// crashed synchonously. In that case, it is possible that the previous
|
|
2378
|
-
// computation has not been properly restored
|
|
2379
|
-
setComputation(prev);
|
|
2380
|
-
}
|
|
2381
2370
|
async initiateRender(fiber) {
|
|
2382
2371
|
this.fiber = fiber;
|
|
2383
2372
|
if (this.mounted.length) {
|
|
@@ -2392,6 +2381,7 @@ class ComponentNode {
|
|
|
2392
2381
|
await Promise.all(promises);
|
|
2393
2382
|
}
|
|
2394
2383
|
catch (e) {
|
|
2384
|
+
setComputation(prev);
|
|
2395
2385
|
handleError({ node: this, error: e });
|
|
2396
2386
|
return;
|
|
2397
2387
|
}
|
|
@@ -3181,7 +3171,21 @@ function createComponent(app, name, isStatic, hasSlotsProp, hasDynamicPropList,
|
|
|
3181
3171
|
if (node) {
|
|
3182
3172
|
if (arePropsDifferent(node.props, props) || parentFiber.deep || node.forceNextRender) {
|
|
3183
3173
|
node.forceNextRender = false;
|
|
3184
|
-
|
|
3174
|
+
if (node.willUpdateProps.length) {
|
|
3175
|
+
updateAndRender.call(node, props, parentFiber);
|
|
3176
|
+
}
|
|
3177
|
+
else {
|
|
3178
|
+
// Synchronous fast path — no willUpdateProps hooks
|
|
3179
|
+
const fiber = makeChildFiber(node, parentFiber);
|
|
3180
|
+
node.fiber = fiber;
|
|
3181
|
+
node.props = props;
|
|
3182
|
+
const parentRoot = parentFiber.root;
|
|
3183
|
+
if (node.willPatch.length)
|
|
3184
|
+
parentRoot.willPatch.push(fiber);
|
|
3185
|
+
if (node.patched.length)
|
|
3186
|
+
parentRoot.patched.push(fiber);
|
|
3187
|
+
fiber.render();
|
|
3188
|
+
}
|
|
3185
3189
|
}
|
|
3186
3190
|
}
|
|
3187
3191
|
else {
|
|
@@ -3802,6 +3806,7 @@ class CodeTarget {
|
|
|
3802
3806
|
tSetVars = new Map();
|
|
3803
3807
|
code = [];
|
|
3804
3808
|
hasRoot = false;
|
|
3809
|
+
deferReturn = false;
|
|
3805
3810
|
needsScopeProtection = false;
|
|
3806
3811
|
on;
|
|
3807
3812
|
constructor(name, on) {
|
|
@@ -3882,8 +3887,13 @@ class CodeGenerator {
|
|
|
3882
3887
|
this.dev = options.dev || false;
|
|
3883
3888
|
this.ast = ast;
|
|
3884
3889
|
this.templateName = options.name;
|
|
3885
|
-
if (options.name
|
|
3886
|
-
|
|
3890
|
+
if (options.name) {
|
|
3891
|
+
if (options.name.startsWith("__")) {
|
|
3892
|
+
this.target.name = options.name;
|
|
3893
|
+
}
|
|
3894
|
+
else {
|
|
3895
|
+
this.target.name = `template_${options.name.replace(/[^a-zA-Z0-9_$]/g, "_")}`;
|
|
3896
|
+
}
|
|
3887
3897
|
}
|
|
3888
3898
|
if (options.hasGlobalValues) {
|
|
3889
3899
|
this.helpers.add("__globals__");
|
|
@@ -3994,7 +4004,7 @@ class CodeGenerator {
|
|
|
3994
4004
|
if (ctx.tKeyExpr) {
|
|
3995
4005
|
blockExpr = `toggler(${ctx.tKeyExpr}, ${blockExpr})`;
|
|
3996
4006
|
}
|
|
3997
|
-
if (block.isRoot) {
|
|
4007
|
+
if (block.isRoot && !this.target.deferReturn) {
|
|
3998
4008
|
if (this.target.on) {
|
|
3999
4009
|
blockExpr = this.wrapWithEventCatcher(blockExpr, this.target.on);
|
|
4000
4010
|
}
|
|
@@ -4481,10 +4491,20 @@ class CodeGenerator {
|
|
|
4481
4491
|
const n = ast.content.filter((c) => !c.hasNoRepresentation).length;
|
|
4482
4492
|
let result = null;
|
|
4483
4493
|
if (n <= 1) {
|
|
4494
|
+
// Check if there are non-DOM directives (like t-set) after the DOM child.
|
|
4495
|
+
// If so, defer the return so those directives are compiled before it.
|
|
4496
|
+
const shouldDefer = !this.target.hasRoot && ast.content[ast.content.length - 1].hasNoRepresentation;
|
|
4497
|
+
if (shouldDefer) {
|
|
4498
|
+
this.target.deferReturn = true;
|
|
4499
|
+
}
|
|
4484
4500
|
for (let child of ast.content) {
|
|
4485
4501
|
const blockName = this.compileAST(child, ctx);
|
|
4486
4502
|
result = result || blockName;
|
|
4487
4503
|
}
|
|
4504
|
+
if (shouldDefer) {
|
|
4505
|
+
this.target.deferReturn = false;
|
|
4506
|
+
this.addLine(`return ${result};`);
|
|
4507
|
+
}
|
|
4488
4508
|
return result;
|
|
4489
4509
|
}
|
|
4490
4510
|
block = this.createBlock(block, "multi", ctx);
|
|
@@ -5678,7 +5698,7 @@ function compile(template, options = {
|
|
|
5678
5698
|
}
|
|
5679
5699
|
|
|
5680
5700
|
// do not modify manually. This file is generated by the release script.
|
|
5681
|
-
const version = "3.0.0-alpha.
|
|
5701
|
+
const version = "3.0.0-alpha.26";
|
|
5682
5702
|
|
|
5683
5703
|
function effect(fn) {
|
|
5684
5704
|
const computation = createComputation(() => {
|
|
@@ -5972,7 +5992,37 @@ class App extends TemplateSet {
|
|
|
5972
5992
|
return promise;
|
|
5973
5993
|
}
|
|
5974
5994
|
App.validateTarget(target);
|
|
5975
|
-
|
|
5995
|
+
// Set up error handler and onMounted callback
|
|
5996
|
+
let handlers = nodeErrorHandlers.get(node);
|
|
5997
|
+
if (!handlers) {
|
|
5998
|
+
handlers = [];
|
|
5999
|
+
nodeErrorHandlers.set(node, handlers);
|
|
6000
|
+
}
|
|
6001
|
+
handlers.unshift((e, finalize) => {
|
|
6002
|
+
const finalError = finalize();
|
|
6003
|
+
reject(finalError);
|
|
6004
|
+
});
|
|
6005
|
+
node.mounted.push(() => {
|
|
6006
|
+
resolve(node.component);
|
|
6007
|
+
handlers.shift();
|
|
6008
|
+
});
|
|
6009
|
+
const fiber = new MountFiber(node, target, options);
|
|
6010
|
+
this.scheduler.addFiber(fiber);
|
|
6011
|
+
if (node.willStart.length) {
|
|
6012
|
+
node.initiateRender(fiber);
|
|
6013
|
+
}
|
|
6014
|
+
else {
|
|
6015
|
+
node.fiber = fiber;
|
|
6016
|
+
if (node.mounted.length) {
|
|
6017
|
+
fiber.root.mounted.push(fiber);
|
|
6018
|
+
}
|
|
6019
|
+
try {
|
|
6020
|
+
fiber.render();
|
|
6021
|
+
}
|
|
6022
|
+
catch (e) {
|
|
6023
|
+
reject(e);
|
|
6024
|
+
}
|
|
6025
|
+
}
|
|
5976
6026
|
return promise;
|
|
5977
6027
|
},
|
|
5978
6028
|
destroy: () => {
|
|
@@ -5984,25 +6034,6 @@ class App extends TemplateSet {
|
|
|
5984
6034
|
this.roots.add(root);
|
|
5985
6035
|
return root;
|
|
5986
6036
|
}
|
|
5987
|
-
mountNode(node, target, resolve, reject, options) {
|
|
5988
|
-
// Manually add the last resort error handler on the node
|
|
5989
|
-
let handlers = nodeErrorHandlers.get(node);
|
|
5990
|
-
if (!handlers) {
|
|
5991
|
-
handlers = [];
|
|
5992
|
-
nodeErrorHandlers.set(node, handlers);
|
|
5993
|
-
}
|
|
5994
|
-
handlers.unshift((e, finalize) => {
|
|
5995
|
-
const finalError = finalize();
|
|
5996
|
-
reject(finalError);
|
|
5997
|
-
});
|
|
5998
|
-
// manually set a onMounted callback.
|
|
5999
|
-
// that way, we are independant from the current node.
|
|
6000
|
-
node.mounted.push(() => {
|
|
6001
|
-
resolve(node.component);
|
|
6002
|
-
handlers.shift();
|
|
6003
|
-
});
|
|
6004
|
-
node.mountComponent(target, options);
|
|
6005
|
-
}
|
|
6006
6037
|
destroy() {
|
|
6007
6038
|
for (let root of this.roots) {
|
|
6008
6039
|
root.destroy();
|
|
@@ -6793,6 +6824,6 @@ TemplateSet.prototype._compileTemplate = function _compileTemplate(name, templat
|
|
|
6793
6824
|
export { App, Component, EventBus, OwlError, Plugin, Registry, Resource, __info__, assertType, batched, blockDom, computed, config, effect, htmlEscape, markRaw, markup, mount, onError, onMounted, onPatched, onWillDestroy, onWillPatch, onWillStart, onWillUnmount, onWillUpdateProps, plugin, props, providePlugins, proxy, signal, status, toRaw, types, untrack, useApp, useContext, useEffect, useListener, useResource, validateType, whenReady, xml };
|
|
6794
6825
|
|
|
6795
6826
|
|
|
6796
|
-
__info__.date = '2026-04-
|
|
6797
|
-
__info__.hash = '
|
|
6827
|
+
__info__.date = '2026-04-13T09:25:02.574Z';
|
|
6828
|
+
__info__.hash = 'fddcc27';
|
|
6798
6829
|
__info__.url = 'https://github.com/odoo/owl';
|
package/dist/owl.iife.js
CHANGED
|
@@ -2323,7 +2323,6 @@
|
|
|
2323
2323
|
}
|
|
2324
2324
|
|
|
2325
2325
|
class ComponentNode {
|
|
2326
|
-
el;
|
|
2327
2326
|
app;
|
|
2328
2327
|
fiber = null;
|
|
2329
2328
|
component;
|
|
@@ -2371,16 +2370,6 @@
|
|
|
2371
2370
|
setComputation(previousComputation);
|
|
2372
2371
|
contextStack.length = 0; // clear context stack
|
|
2373
2372
|
}
|
|
2374
|
-
mountComponent(target, options) {
|
|
2375
|
-
const fiber = new MountFiber(this, target, options);
|
|
2376
|
-
this.app.scheduler.addFiber(fiber);
|
|
2377
|
-
let prev = getCurrentComputation();
|
|
2378
|
-
this.initiateRender(fiber);
|
|
2379
|
-
// only useful if the component is a root, and a willstart function just
|
|
2380
|
-
// crashed synchonously. In that case, it is possible that the previous
|
|
2381
|
-
// computation has not been properly restored
|
|
2382
|
-
setComputation(prev);
|
|
2383
|
-
}
|
|
2384
2373
|
async initiateRender(fiber) {
|
|
2385
2374
|
this.fiber = fiber;
|
|
2386
2375
|
if (this.mounted.length) {
|
|
@@ -2395,6 +2384,7 @@
|
|
|
2395
2384
|
await Promise.all(promises);
|
|
2396
2385
|
}
|
|
2397
2386
|
catch (e) {
|
|
2387
|
+
setComputation(prev);
|
|
2398
2388
|
handleError({ node: this, error: e });
|
|
2399
2389
|
return;
|
|
2400
2390
|
}
|
|
@@ -3184,7 +3174,21 @@
|
|
|
3184
3174
|
if (node) {
|
|
3185
3175
|
if (arePropsDifferent(node.props, props) || parentFiber.deep || node.forceNextRender) {
|
|
3186
3176
|
node.forceNextRender = false;
|
|
3187
|
-
|
|
3177
|
+
if (node.willUpdateProps.length) {
|
|
3178
|
+
updateAndRender.call(node, props, parentFiber);
|
|
3179
|
+
}
|
|
3180
|
+
else {
|
|
3181
|
+
// Synchronous fast path — no willUpdateProps hooks
|
|
3182
|
+
const fiber = makeChildFiber(node, parentFiber);
|
|
3183
|
+
node.fiber = fiber;
|
|
3184
|
+
node.props = props;
|
|
3185
|
+
const parentRoot = parentFiber.root;
|
|
3186
|
+
if (node.willPatch.length)
|
|
3187
|
+
parentRoot.willPatch.push(fiber);
|
|
3188
|
+
if (node.patched.length)
|
|
3189
|
+
parentRoot.patched.push(fiber);
|
|
3190
|
+
fiber.render();
|
|
3191
|
+
}
|
|
3188
3192
|
}
|
|
3189
3193
|
}
|
|
3190
3194
|
else {
|
|
@@ -3805,6 +3809,7 @@
|
|
|
3805
3809
|
tSetVars = new Map();
|
|
3806
3810
|
code = [];
|
|
3807
3811
|
hasRoot = false;
|
|
3812
|
+
deferReturn = false;
|
|
3808
3813
|
needsScopeProtection = false;
|
|
3809
3814
|
on;
|
|
3810
3815
|
constructor(name, on) {
|
|
@@ -3885,8 +3890,13 @@
|
|
|
3885
3890
|
this.dev = options.dev || false;
|
|
3886
3891
|
this.ast = ast;
|
|
3887
3892
|
this.templateName = options.name;
|
|
3888
|
-
if (options.name
|
|
3889
|
-
|
|
3893
|
+
if (options.name) {
|
|
3894
|
+
if (options.name.startsWith("__")) {
|
|
3895
|
+
this.target.name = options.name;
|
|
3896
|
+
}
|
|
3897
|
+
else {
|
|
3898
|
+
this.target.name = `template_${options.name.replace(/[^a-zA-Z0-9_$]/g, "_")}`;
|
|
3899
|
+
}
|
|
3890
3900
|
}
|
|
3891
3901
|
if (options.hasGlobalValues) {
|
|
3892
3902
|
this.helpers.add("__globals__");
|
|
@@ -3997,7 +4007,7 @@
|
|
|
3997
4007
|
if (ctx.tKeyExpr) {
|
|
3998
4008
|
blockExpr = `toggler(${ctx.tKeyExpr}, ${blockExpr})`;
|
|
3999
4009
|
}
|
|
4000
|
-
if (block.isRoot) {
|
|
4010
|
+
if (block.isRoot && !this.target.deferReturn) {
|
|
4001
4011
|
if (this.target.on) {
|
|
4002
4012
|
blockExpr = this.wrapWithEventCatcher(blockExpr, this.target.on);
|
|
4003
4013
|
}
|
|
@@ -4484,10 +4494,20 @@
|
|
|
4484
4494
|
const n = ast.content.filter((c) => !c.hasNoRepresentation).length;
|
|
4485
4495
|
let result = null;
|
|
4486
4496
|
if (n <= 1) {
|
|
4497
|
+
// Check if there are non-DOM directives (like t-set) after the DOM child.
|
|
4498
|
+
// If so, defer the return so those directives are compiled before it.
|
|
4499
|
+
const shouldDefer = !this.target.hasRoot && ast.content[ast.content.length - 1].hasNoRepresentation;
|
|
4500
|
+
if (shouldDefer) {
|
|
4501
|
+
this.target.deferReturn = true;
|
|
4502
|
+
}
|
|
4487
4503
|
for (let child of ast.content) {
|
|
4488
4504
|
const blockName = this.compileAST(child, ctx);
|
|
4489
4505
|
result = result || blockName;
|
|
4490
4506
|
}
|
|
4507
|
+
if (shouldDefer) {
|
|
4508
|
+
this.target.deferReturn = false;
|
|
4509
|
+
this.addLine(`return ${result};`);
|
|
4510
|
+
}
|
|
4491
4511
|
return result;
|
|
4492
4512
|
}
|
|
4493
4513
|
block = this.createBlock(block, "multi", ctx);
|
|
@@ -5681,7 +5701,7 @@
|
|
|
5681
5701
|
}
|
|
5682
5702
|
|
|
5683
5703
|
// do not modify manually. This file is generated by the release script.
|
|
5684
|
-
const version = "3.0.0-alpha.
|
|
5704
|
+
const version = "3.0.0-alpha.26";
|
|
5685
5705
|
|
|
5686
5706
|
function effect(fn) {
|
|
5687
5707
|
const computation = createComputation(() => {
|
|
@@ -5975,7 +5995,37 @@
|
|
|
5975
5995
|
return promise;
|
|
5976
5996
|
}
|
|
5977
5997
|
App.validateTarget(target);
|
|
5978
|
-
|
|
5998
|
+
// Set up error handler and onMounted callback
|
|
5999
|
+
let handlers = nodeErrorHandlers.get(node);
|
|
6000
|
+
if (!handlers) {
|
|
6001
|
+
handlers = [];
|
|
6002
|
+
nodeErrorHandlers.set(node, handlers);
|
|
6003
|
+
}
|
|
6004
|
+
handlers.unshift((e, finalize) => {
|
|
6005
|
+
const finalError = finalize();
|
|
6006
|
+
reject(finalError);
|
|
6007
|
+
});
|
|
6008
|
+
node.mounted.push(() => {
|
|
6009
|
+
resolve(node.component);
|
|
6010
|
+
handlers.shift();
|
|
6011
|
+
});
|
|
6012
|
+
const fiber = new MountFiber(node, target, options);
|
|
6013
|
+
this.scheduler.addFiber(fiber);
|
|
6014
|
+
if (node.willStart.length) {
|
|
6015
|
+
node.initiateRender(fiber);
|
|
6016
|
+
}
|
|
6017
|
+
else {
|
|
6018
|
+
node.fiber = fiber;
|
|
6019
|
+
if (node.mounted.length) {
|
|
6020
|
+
fiber.root.mounted.push(fiber);
|
|
6021
|
+
}
|
|
6022
|
+
try {
|
|
6023
|
+
fiber.render();
|
|
6024
|
+
}
|
|
6025
|
+
catch (e) {
|
|
6026
|
+
reject(e);
|
|
6027
|
+
}
|
|
6028
|
+
}
|
|
5979
6029
|
return promise;
|
|
5980
6030
|
},
|
|
5981
6031
|
destroy: () => {
|
|
@@ -5987,25 +6037,6 @@
|
|
|
5987
6037
|
this.roots.add(root);
|
|
5988
6038
|
return root;
|
|
5989
6039
|
}
|
|
5990
|
-
mountNode(node, target, resolve, reject, options) {
|
|
5991
|
-
// Manually add the last resort error handler on the node
|
|
5992
|
-
let handlers = nodeErrorHandlers.get(node);
|
|
5993
|
-
if (!handlers) {
|
|
5994
|
-
handlers = [];
|
|
5995
|
-
nodeErrorHandlers.set(node, handlers);
|
|
5996
|
-
}
|
|
5997
|
-
handlers.unshift((e, finalize) => {
|
|
5998
|
-
const finalError = finalize();
|
|
5999
|
-
reject(finalError);
|
|
6000
|
-
});
|
|
6001
|
-
// manually set a onMounted callback.
|
|
6002
|
-
// that way, we are independant from the current node.
|
|
6003
|
-
node.mounted.push(() => {
|
|
6004
|
-
resolve(node.component);
|
|
6005
|
-
handlers.shift();
|
|
6006
|
-
});
|
|
6007
|
-
node.mountComponent(target, options);
|
|
6008
|
-
}
|
|
6009
6040
|
destroy() {
|
|
6010
6041
|
for (let root of this.roots) {
|
|
6011
6042
|
root.destroy();
|
|
@@ -6838,8 +6869,8 @@
|
|
|
6838
6869
|
exports.xml = xml;
|
|
6839
6870
|
|
|
6840
6871
|
|
|
6841
|
-
__info__.date = '2026-04-
|
|
6842
|
-
__info__.hash = '
|
|
6872
|
+
__info__.date = '2026-04-13T09:25:02.574Z';
|
|
6873
|
+
__info__.hash = 'fddcc27';
|
|
6843
6874
|
__info__.url = 'https://github.com/odoo/owl';
|
|
6844
6875
|
|
|
6845
6876
|
|