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

Lazy load the developer dock #2294

Merged
merged 2 commits into from Jan 29, 2024
Merged

Conversation

florian-h05
Copy link
Contributor

No description provided.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05 florian-h05 requested a review from a team as a code owner January 28, 2024 21:48
Copy link

relativeci bot commented Jan 28, 2024

Job #1385: Bundle Size — 15.92MiB (+0.59%).

1759712(current) vs 660b8f1 main#1384(baseline)

Warning

Bundle contains 16 duplicate packages – View duplicate packages

Bundle metrics  Change 6 changes Regression 2 regressions Improvement 2 improvements
                 Current
Job #1385
     Baseline
Job #1384
Improvement  Initial JS 1.81MiB(-4.11%) 1.89MiB
Improvement  Initial CSS 608.39KiB(-0.23%) 609.81KiB
Change  Cache Invalidation 93.98% 93.97%
No change  Chunks 217 217
No change  Assets 683 683
Change  Modules 3078(+2.19%) 3012
Regression  Duplicate Modules 236(+38.82%) 170
Regression  Duplicate Code 1.73%(+8.13%) 1.6%
No change  Packages 152 152
No change  Duplicate Packages 16 16
Bundle size by type  Change 3 changes Regression 3 regressions
                 Current
Job #1385
     Baseline
Job #1384
Regression  JS 9.36MiB (+0.7%) 9.3MiB
Regression  Other 4.78MiB (+0.56%) 4.75MiB
Regression  CSS 863.61KiB (+0.26%) 861.35KiB
Not changed  Fonts 526.1KiB 526.1KiB
Not changed  Media 295.6KiB 295.6KiB
Not changed  IMG 140.74KiB 140.74KiB
Not changed  HTML 1.23KiB 1.23KiB

View job #1385 reportView florian-h05:lazy-load-developer-... branch activityView project dashboard

@florian-h05
Copy link
Contributor Author

@ghys Lazy loading the developer dock/sidebar makes sense IMO as only admins can use it, and it saves us some initial JS.

@ghys
Copy link
Member

ghys commented Jan 29, 2024

It's certainly increasingly needed when the developer dock adds more and more features.
But I don't think it's taking a lot of initial JS, as there are no big library dependencies.

I think it's just this, bundle 13:

image

image

compared to the initial JS (in purple), that's nice to have but not critical.
Another idea would be to put it in the "admin" bundle? That would be bundle 16 here, in red on the top right:

image

But I'm fine with your proposal to create a new one :)

@florian-h05
Copy link
Contributor Author

But I don't think it's taking a lot of initial JS, as there are no big library dependencies.

According to the RelativeCI bot it is around 80 KiB, which sounds quite nice to me.

Another idea would be to put it in the "admin" bundle? That would be bundle 16 here, in red on the top right:

I haven’t considered that, thanks for the suggestion! I’ll change that.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05
Copy link
Contributor Author

Looking at the latest report, I’m not sure whether it is now in bundle 16 and if not, how to put it there. I am now using the same webpack chunk name as for the admin pages: admin-base

@ghys
Copy link
Member

ghys commented Jan 29, 2024

Apparently it's now in the one with the add-on store:

image

@florian-h05
Copy link
Contributor Author

Given the fact that the add-on store is using admin-base as chunk name as well, that looks good to me.

Copy link
Member

@ghys ghys left a comment

Choose a reason for hiding this comment

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

So be it!

I'd strive in general to limit the chunk fragmentation as we have plenty already (100+ chunks), the more we can combine some which will not be in the initial JS but related, the better, IMO.

@ghys ghys merged commit 6ea38c3 into openhab:main Jan 29, 2024
6 checks passed
@florian-h05 florian-h05 deleted the lazy-load-developer-dock branch January 29, 2024 23:45
@florian-h05 florian-h05 added this to the 4.2 milestone Jan 29, 2024
@florian-h05 florian-h05 added the main ui Main UI label Jan 29, 2024
florian-h05 added a commit that referenced this pull request Mar 1, 2024
Regression from #2294.

When the developer dock was opened the first time, the navbar was not
center aligned due to a styling issue because of the lazy loading. This
works-around this by setting (sub)title after component creation.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05 florian-h05 added the enhancement New feature or request label Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants