+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

feat(rome_js_analyze): compute AnalyzerOptions from Workspace #3381

Merged
merged 14 commits into from
Oct 12, 2022

Conversation

ematipico
Copy link
Contributor

@ematipico ematipico commented Oct 10, 2022

Summary

Closes #3392

I also changed the signature of the function run to result a Result. This would allow us to track the diagnostics emitted from errors. The tracking of the errors will be done in a separate PR, because it requires a refactor of the current diagnostics of the analzyer, which still use the old diagnostics.

Test Plan

Unfortunately I can't test my changes yet. The current CI should work

@ematipico ematipico force-pushed the feature/analyzer-options-workspace branch from 2828017 to c3590b0 Compare October 10, 2022 14:03
Base automatically changed from feature/handle-serde-error to main October 10, 2022 15:39
@ematipico ematipico temporarily deployed to netlify-playground October 11, 2022 08:29 Inactive
@netlify
Copy link

netlify bot commented Oct 11, 2022

Deploy Preview for rometools ready!

Name Link
🔨 Latest commit f127341
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/6346765f2a86240007bb4b94
😎 Deploy Preview https://deploy-preview-3381--rometools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented Oct 11, 2022

@ematipico ematipico temporarily deployed to netlify-playground October 11, 2022 09:43 Inactive
@ematipico ematipico marked this pull request as ready for review October 11, 2022 09:46
@ematipico ematipico temporarily deployed to netlify-playground October 11, 2022 09:47 Inactive
@calibre-analytics
Copy link

calibre-analytics bot commented Oct 11, 2022

Comparing feat(rome_js_analyze): compute AnalyzerOptions from Workspace Snapshot #6 to median since last deploy of rome.tools.

LCP? CLS? TBT?
Overall
Median across all pages and test profiles
327ms
from 556ms
0.077
no change
22ms
from 43ms
Chrome Desktop
Chrome Desktop • Cable
327ms
from 585ms
0.237
from 0.006
139ms
from 220ms
iPhone, 4G LTE
iPhone 12 • 4G LTE
248ms
from 218ms
0.077
no change
13ms
from 6ms
Motorola Moto G Power, 3G connection
Motorola Moto G Power • Regular 3G
561ms
no change
0.049
no change
22ms
from 43ms

1 page tested

 Home

Browser previews

Chrome Desktop iPhone, 4G LTE Motorola Moto G Power, 3G connection
Chrome Desktop iPhone, 4G LTE Motorola Moto G Power, 3G connection

Most significant changes

Value Budget
Cumulative Layout Shift
Chrome Desktop
0.237
from 0.006
Total JavaScript Size in Bytes
Chrome Desktop
1.24 MB
from 86.8 KB
Total JavaScript Size in Bytes
iPhone, 4G LTE
1.24 MB
from 86.8 KB
Total JavaScript Size in Bytes
Motorola Moto G Power, 3G connection
1.24 MB
from 86.8 KB
Number of Requests
Chrome Desktop
39
from 5

5 other significant changes: Number of Requests on iPhone, 4G LTE, Number of Requests on Motorola Moto G Power, 3G connection, Total Page Size in Bytes on Chrome Desktop, Total Page Size in Bytes on iPhone, 4G LTE, Total Page Size in Bytes on Motorola Moto G Power, 3G connection

Calibre: Site dashboard | View this PR | Edit settings | View documentation

@ematipico ematipico temporarily deployed to netlify-playground October 11, 2022 10:12 Inactive
} else {
vec![]
};
to_globals: ToGlobals,
Copy link
Contributor

Choose a reason for hiding this comment

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

My understanding is that globals are a JS specific concept. Shouldn't it be handled outside of the generic to_analyzer_configuration or how do we plan to support other languages?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was, but now they can be a CSS thing too :)

Imagine a third party CSS that creates a variable --external-font-size, and it's used inside the user's code:

.some_class {
	font-size: var(--external-font-size) * 0.2
}

Copy link
Contributor

Choose a reason for hiding this comment

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

OK. I think my main concern is how this approach scales with new settings that are common to some languages (globals e.g. aren't supported by JSON). Is our intention to add a closure for every such concept?

Anyway: This is unrelated to your change. Only something that popped up because I was confused about that to_globals call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately this approach won't scale that well, at least not as much as the same approach we have for FormatOptions -> JsFormatOptions. Initially I wanted to apply the same approach, but I encountered many complex issues that would have required refactors - which I am not yet comfortable with - inside the analyzer itself.

@ematipico ematipico temporarily deployed to netlify-playground October 12, 2022 08:10 Inactive
@ematipico ematipico requested a review from MichaReiser October 12, 2022 08:10
@ematipico ematipico merged commit 4d107e2 into main Oct 12, 2022
@ematipico ematipico deleted the feature/analyzer-options-workspace branch October 12, 2022 13:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allow to compute AnalyzerOptions from the Workspace
3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载