Skip to content

Commit

Permalink
Merge pull request #206 from airbnb/fix-baidu-new-compiler
Browse files Browse the repository at this point in the history
Inline the content of `children.wxml` into `component.wxml` to support new Baidu compiler on dev tool >= v4.22
  • Loading branch information
malash authored Jul 11, 2023
2 parents 8bf2514 + b2acc04 commit 062c761
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/webpack-plugin/src/constants/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ import { GojiTarget } from '@goji/core';
export const getFeatures = (target: GojiTarget) => ({
useSubtree: target === 'wechat' || target === 'qq',

// Alipay only support recursion dependency self to self so we have to inline the children.wxml
// Success: A -> A -> A
// Fail: A -> B -> A
useInlineChildrenInComponent: target === 'alipay',
useInlineChildrenInComponent:
// Alipay only support circular dependency self to self so we have to inline the children.wxml
// Success: A -> A -> A
// Fail: A -> B -> A
target === 'alipay' ||
// Baidu changes the behavior of circular dependency on dev tool >= v4.22 with new compiler
// so we have to inline the children.wxml
// 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
target === 'baidu',

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

0 comments on commit 062c761

Please sign in to comment.