alibaba / rax

🐰 Rax is a progressive framework for building universal application. https://rax.js.org
Other
7.99k stars 627 forks source link

[Discussion] rax-use-import 异步获取资源代码被同步执行 #2182

Closed SoloJiang closed 3 years ago

SoloJiang commented 3 years ago

Example

function Home() {
  const [TargetComponent, error] = useImport(() => import('./targetComponent'));
  if (!error && TargetComponent) {
    return <TargetComponent />;
  }
}

分析

rax-use-import 解决的问题:

目前存在的问题:

SoloJiang commented 3 years ago

本质是解决异步 bundle 在各个加载时机中设置 publicPath 的问题,该问题和 publicPath 的设置机制有关