-
-
Notifications
You must be signed in to change notification settings - Fork 383
[LiveComponent] Replace the browser's URL before triggering render:finished
hook
#3088
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
Conversation
📊 Packages dist files size differenceℹ️ No difference in dist packagesFiles. |
render:finished
hook
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me
new URL(liveUrl + window.location.hash, window.location.origin) | ||
); | ||
} | ||
this.hooks.triggerHook("render:finished", this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we movev the liveUrl update in processRerender instead ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be careful on how we do it, because the method contains some early returns that could prevent the URL update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. moved into processRerender
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But now people hooking on render:started
and passing shouldRender = false
won't see the URL updated anymore, that's a BC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep indeed.. but if I get this right, with this PR the hook would be trigger even when the render is skipped or if an error occurs .. and this would be some BC too :| Or do we consider this a bug ?
But there are at least two places we need to check attentively how it would impact codebases:
This one (seems without effect but i'd like to be sure):
component.on('render:finished', () => {
// re-start polling, in case polling changed
this.initializePolling();
});
/src/LiveComponent/assets/src/Component/plugins/PollingPlugin.ts#L21-L24
But this one makes me more hesitant:
attachToComponent(component: Component): void {
this.synchronizeValueOfModelFields(component);
component.on('render:finished', () => {
this.synchronizeValueOfModelFields(component);
});
src/LiveComponent/assets/src/Component/plugins/SetValueOntoModelFieldsPlugin.ts#L16-L18
ea8124e
to
2fd6689
Compare
Seems ok to me! Can you fix fabbot check ? (remove the merge commit and rebase on 2.x) .. or we won't be able to merge 😅 |
9682569
to
7b2fc19
Compare
@smnandre is it ok now? thanks |
Well, i do not see any red in the checks box so .. yeah 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @xDeSwa !!
7b2fc19
to
1b0418f
Compare
Thank you @xDeSwa. |
After the URL change, performing the
render:finished
event will provide smoother control.