Skip to content

[WIP] LiveUrl #2673

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

Draft
wants to merge 9 commits into
base: 2.x
Choose a base branch
from
Draft

[WIP] LiveUrl #2673

wants to merge 9 commits into from

Conversation

mbuliard
Copy link

@mbuliard mbuliard commented Apr 1, 2025

Q A
Bug fix? no
New feature? yes/no
Docs? yes/no
Issues Fix #...
License MIT

WIP, do not merge

@carsonbot carsonbot added Feature New Feature Status: Needs Work Additional work is needed labels Apr 1, 2025
Copy link

github-actions bot commented Apr 1, 2025

📊 Packages dist files size difference

Thanks for the PR! Here is the difference in size of the packages dist files between the base branch and the PR.
Please review the changes and make sure they are expected.

FileBefore (Size / Gzip)After (Size / Gzip)
LiveComponent
Backend/BackendResponse.d.ts 136 B / 139 B 199 B+46% 📈 / 163 B+17% 📈
Component/plugins/QueryStringPlugin.d.ts 356 B / 239 B Removed
live_controller.d.ts 3.3 kB / 924 B 3.1 kB-6% 📉 / 893 B-3% 📉
live_controller.js 120 kB / 23.4 kB 116.68 kB-3% 📉 / 22.57 kB-4% 📉
url_utils.d.ts 306 B / 205 B Removed

@mbuliard mbuliard marked this pull request as draft April 1, 2025 19:23
@smnandre
Copy link
Member

smnandre commented Apr 4, 2025

(Had a quick chat with @mbuliard yesterday — he's making a few adjustments before opening the PR. Stay tuned! 😄 )

@mbuliard mbuliard force-pushed the live-url branch 5 times, most recently from 93c0a12 to d848b54 Compare April 10, 2025 11:34
@@ -328,6 +329,10 @@ export default class Component {
}

this.processRerender(html, backendResponse);
const liveUrl = await backendResponse.getLiveUrl();
if (liveUrl) {
HistoryStrategy.replace(new UrlUtils(liveUrl + window.location.hash, window.location.origin));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
HistoryStrategy.replace(new UrlUtils(liveUrl + window.location.hash, window.location.origin));
history.replaceState(history.state, '', liveUrl + window.location.hash);

? (not sure)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would allow the remove both queryStringPlugin.ts and url_utils.ts (i think)

@smnandre
Copy link
Member

smnandre commented May 4, 2025

Do you want/need any help here @mbuliard ?

@mbuliard mbuliard force-pushed the live-url branch 3 times, most recently from ff471f9 to 6903e06 Compare May 9, 2025 22:07
… props also from path. RequestInitializeSubscriber also renamed
@mbuliard
Copy link
Author

Do you want/need any help here @mbuliard ?

Thanks ! I needed free time, but the PR is almost done. Related tests are green, but I shall now add my own testing of the backend.

What took me some time was to the handling of custom actions, who may (and often do) update component props. I choose to store the updated component props in _live_request_data.responseProps, next to props and updated values.
I'm thinking to always populate these responseProps, even for default action and then simplifying my LiveUrlSubscriber.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature Status: Needs Work Additional work is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants