跪拜 Guibai
← Back to the summary

19 Weex Rendering Bugs That Will Haunt Your Cross-Platform Build

  1. text/div font style settings may differ; for example, font-weight on a div may not take effect.
  2. background shorthand doesn't work; you must use background-color and background-image separately.
  3. On Android, every div needs explicit width and height. Elements expanded by content fail to render correctly when positioned.
  4. text placed directly at the same level as flex:1 sometimes loses its style; wrap the text in a div tag.
  5. Browsing H5 in the Baidu app causes session changes that refresh and log the user out to the login page.
  6. Weex upward loop scrolling occasionally leaves the first element stuck.
  7. On Android, after a timer stops, restarting it fails to execute; calling an empty timer again restarts it.
  8. The refresh component cannot be dynamically shown/hidden; you can change the pull-to-refresh component position via layout.
  9. On iOS, after setting background-image via style, setting it to empty doesn't work; set the color to transparent instead.
  10. On iOS, the pull-to-refresh component's background only covers the height area; handle it with an underlying layer. Android can set background color on refresh normally.
  11. On Android, if CSS sets a style and then style is set again, flickering occurs; remove the CSS style (appears with offer number scrolling and the king kong area slider).
  12. On iOS, box-shadow causes overflow to fail.
  13. On HarmonyOS and H5, using translate to drag an image component off-screen with transition-delay causes the image resource not to load — it loads only after user interaction.
  14. On iOS, if a rendered component gets data with too large a difference on pull-back, it disappears because of key.
  15. On Android, using transition to switch styles causes all styles except a few supported ones to fail. Wrap the transition element and other styling nodes separately — e.g., for button size and position transitions, wrap the border-radius and color changes.
  16. On iOS, if the four values of border-radius are written separately and are inconsistent, it doesn't work; use image slicing or element stacking, depending on the scenario.
  17. Weex's web side doesn't implement the richtext component and tags; use with caution.
  18. The syntax for writing the four borders separately doesn't work on Android and iOS; if you want to draw a three-pointed arrow, slice images.
  19. Weex single-line ellipsis with white-space: nowrap; doesn't show the ellipsis on HarmonyOS.
Comments

Top 3 of 5 from juejin.cn, machine-translated. The original thread is authoritative.

booboosui

The first item isn't 'may not work' — it definitely won't: font-weight in Weex belongs to text styles and only applies to text/input/richtext; div has no font concept. Also the docs say iOS supports all 9 weights from 100–900, while Android only recognizes 400 and 700, and any other number gets forced down to 400 or 700 — so the 500 Medium from design will always render too thin on Android; adjusting the number won't fix it, the only way is to load the Medium weight via font-family. Related counterexample: #12's box-shadow is an iOS-only property; the docs literally say 'currently only iOS is supported, Android is not supported yet', so the 'overflows invalidated' symptom simply won't appear on Android. It isn't an iOS bug, it's a difference in platform implementation; on the Android side the only way to get a shadow is to cut an image. #19 can also be rewritten: white-space isn't in Weex's supported style list (it never appears on the general styles page), so writing it is a no-op. Single-line ellipsis is lines:1 paired with text-overflow:ellipsis, and the width can only come from the parent container — which is actually the same root cause as #3's 'must have explicit width and height'.

勤劳勇敢的打工人

Wow, there are still pros—your company is still using this?

你们的前端课代表

Still using weex?

勤劳勇敢的打工人

The previous company used it; probably won't ever again. Wasted two years of mine, sigh.

前端菜菜籽

This is basically a tech stack from ten years ago, right?