Skip to content

Commit 062c761

Browse files
authored
Merge pull request #206 from airbnb/fix-baidu-new-compiler
Inline the content of `children.wxml` into `component.wxml` to support new Baidu compiler on dev tool >= v4.22
2 parents 8bf2514 + b2acc04 commit 062c761

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

packages/webpack-plugin/src/constants/features.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ import { GojiTarget } from '@goji/core';
33
export const getFeatures = (target: GojiTarget) => ({
44
useSubtree: target === 'wechat' || target === 'qq',
55

6-
// Alipay only support recursion dependency self to self so we have to inline the children.wxml
7-
// Success: A -> A -> A
8-
// Fail: A -> B -> A
9-
useInlineChildrenInComponent: target === 'alipay',
6+
useInlineChildrenInComponent:
7+
// Alipay only support circular dependency self to self so we have to inline the children.wxml
8+
// Success: A -> A -> A
9+
// Fail: A -> B -> A
10+
target === 'alipay' ||
11+
// Baidu changes the behavior of circular dependency on dev tool >= v4.22 with new compiler
12+
// so we have to inline the children.wxml
13+
// https://smartprogram.baidu.com/docs/develop/devtools/beta-notify#_5-%E6%A8%A1%E6%9D%BF-import-%E8%AF%AD%E6%B3%95%E4%B8%8D%E5%85%81%E8%AE%B8%E5%BE%AA%E7%8E%AF%E5%BC%95%E7%94%A8%E3%80%82
14+
target === 'baidu',
1015

1116
// Baidu fails to render if an outside same `<include>` exists
1217
// https://github.com/airbnb/goji-js/issues/185

0 commit comments

Comments
 (0)