Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] 预加载没有使用自定义 fetch 选项 #149

Closed
Mmear opened this issue Sep 14, 2022 · 0 comments
Closed

[Bug report] 预加载没有使用自定义 fetch 选项 #149

Mmear opened this issue Sep 14, 2022 · 0 comments

Comments

@Mmear
Copy link

Mmear commented Sep 14, 2022

描述bug
预加载没有使用自定义 fetch 选项,看源码似乎没有应用上

如何复现

/**
 * 预加载无界APP
 */
export function preloadApp(preOptions: preOptions): void {
  requestIdleCallback((): void | Promise<void> => {
   // 没有透出 fetch
    const { name, url, props, alive, replace, exec, attrs, fiber, degrade, plugins, lifecycles } = options;
    if (sandbox.preload) return sandbox.preload;
    const runPreload = async () => {
      const { template, getExternalScripts, getExternalStyleSheets } = await importHTML(url, {
        fetch: fetch || window.fetch, // 这里的 fetch 永远是window.fetch
        plugins: sandbox.plugins,
        loadError: sandbox.lifecycles.loadError,
      });
    //...
    };
  });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants