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

fix(hmr): subapp v1 #2024

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "subapp-web",
"comment": "fix hmr error",
"type": "patch"
}
],
"packageName": "subapp-web"
}
13 changes: 11 additions & 2 deletions packages/subapp-web/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function loadSubApp(info, renderStart, options) {
subApp.start = (instance, options, info) => {
instance = instance || subApp.preStart(instance, options, info);
info = info || subApp.info;
if (instance && !instance.props) {
if (instance && !instance.props && options) {
instance.props = options.props;
}
// if user provided a start function, then user is expected to
Expand Down Expand Up @@ -187,7 +187,16 @@ export function isLoaded(name) {
return Boolean(xarc.getSubApp(name));
}

export function lazyLoadSubApp({ name, id, timeout = 15000, onLoad, onError, fallback, ns, props }) {
export function lazyLoadSubApp({
name,
id,
timeout = 15000,
onLoad,
onError,
fallback,
ns,
props
}) {
// TODO: timeout and callback
const lname = name.toLowerCase();

Expand Down
Loading