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

Garfish preload plugin #599

Closed
2 tasks done
workkk98 opened this issue Jan 17, 2023 · 3 comments
Closed
2 tasks done

Garfish preload plugin #599

workkk98 opened this issue Jan 17, 2023 · 3 comments

Comments

@workkk98
Copy link
Contributor

Clear and concise description of the problem

preload插件是为了预先加载一些子应用的入口文件。但子应用的加载顺序存在优先级,看源码中的方案是依赖子应用实际的加载数来排序的。这就引入了一个问题,有些新加的子应用可能是比原先子应用的优先级高很多。但是在刚引入该子应用时,可能是在最后加载。preload就没有起到它的作用。

Suggested solution

希望garfish,在run方法中可以传入一个初始化的子应用的优先级,且这个优先级是支持部分固化,部分动态计算。例如

interface AppRankRecord {
  [appName: string]: number
}

若应用已存在缓存,则覆写这个配置。优先从AppRankRecord中取出,余下的按照原先的方案排优先级。

Alternative

No response

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@zhoushaw
Copy link
Member

感谢你的反馈,之前 Garfish 内置的 preload Plugin 内置的一些规则确实无法满足用户的一些诉求,基于这个原因我们提供了 preloadApp API ,通过这个 API,你可以根据自己的加载规则和想法去封装自己的 plugin 进行预加载

@workkk98
Copy link
Contributor Author

感谢你的反馈,之前 Garfish 内置的 preload Plugin 内置的一些规则确实无法满足用户的一些诉求,基于这个原因我们提供了 preloadApp API ,通过这个 API,你可以根据自己的加载规则和想法去封装自己的 plugin 进行预加载

preloadApp这个api是否能多提供个immediately参数,用来透传给loadAppResource呢

@zhoushaw
Copy link
Member

zhoushaw commented Mar 9, 2023

preloadApp 本身就是立即执行的

@zhoushaw zhoushaw closed this as completed Mar 9, 2023
@zhoushaw zhoushaw reopened this Mar 9, 2023
@zhoushaw zhoushaw closed this as completed Mar 9, 2023
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