-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
RFC: Lighthouse Subpackage Proposal (report UI and tracehouse) #9519
Comments
I'll try to leave my grumpiness for all subpackages at the door here :) There is a large tradeoff here with the flexibility and inter-code visibility that something closer to a monorepo allows. Componentizing things can improve maintainability and local understandability, but as more of those components are published separately the larger our committed public interface, the more complicated our release process grows, the harder cross-component refactors are, etc. No one likes to deal with lighthouse-logger or chrome-launcher for a (multiple) reason(s), and those two packages also stand as a good example of how once this path is committed to there's basically no going back, as least without a lot of work that won't ever rise in priority vs just living with the pain and getting other stuff done.
let's ask @patrickhulce: https://github.com/GoogleChrome/lighthouse/pulls?utf8=%E2%9C%93&q=is%3Apr+tracehouse :P (more seriously for tracehouse, you and @paulirish have convinced me it's inevitable so that sounds fine :) I think the report stuff is going to be the biggest win for our current needs, and these:
sound like a good approach. In particular how to compose a Lighthouse report UI that
this sounds hard, and the more we add customized flourishes to the report it sounds harder, but I think would be super valuable. |
Will address the rest later, but here I was talking about the core of the trace processing logic. There's obviously a lot of iterative work that is going into making tracehouse a distinct thing, but prior to that flurry of activity most lines blamed to 2-3 years ago and the most recent commit was 10 months ago. https://github.com/GoogleChrome/lighthouse/blame/9f805249c2a019271fb19c0d8e68db0d93fc540a/lighthouse-core/lib/tracehouse/trace-of-tab.js |
I'm reviving this thread because it's become relevant again for tracehouse :) I updated the original issue striking through a few things that are no longer relevant but the rest of the bones are solid. I'll start here with a description of how things work in Lighthouse CI which uses a monorepo structure. Lighthouse CI is comprised of 4 packages that are published independently but versioned synchronously, i.e. all packages latest version is always the same, a breaking change in one package results in a breaking change version bump to all the packages.
Each subpackage is contained to a folder in Development Experience At development time, I have not experienced any substantive differences compared to if these were all in some massive single package like lighthouse. Yarn workspaces makes this fairly seamless by creating symlinks in Release Experience Release process is extremely simple and completely automated by script with the assistance of These packages in LHCI are all tightly coupled. A breaking change in the server generally requires a breaking change to the client, so it is unusual that a consumer would ever not upgrade these in unison anyway. Syncing the versions greatly simplifies the release process and makes this process automatic. This is probably not going to be true of Applicability to Lighthouse I see no reason why the day-to-day development experience would be any different in Lighthouse than today with a monorepo structure. The external contributor experience is not exactly smooth today and smaller scoped packages invite the possibility of narrowing the required setup or understanding to make changes while not meaningfully increasing any burden of setup beyond usage of IMO, the biggest challenge for bringing the LHCI style is going to be figuring out a versioning policy, automating releases, and clearly communicating changelog. If we decide to keep distinct version tracks for each subpackage, things will be very challenging. If we don't, then our API surface for what requires a breaking change becomes considerably larger and more difficult to manage as @brendankenny alluded to. I also see i18n being a significant challenge if we end up splitting strings across package boundaries. I think it'd be reasonable to move forward with the assumption that all i18n strings must remain in the core package for now. Request for Comment
Honestly, if no one else is excited about this sort of change, then I'd probably lean toward the solution in question 4 and not bother pushing this boulder any further up the hill :) |
I am not excited about extra indirection and complexity introduced to keep packaging systems happy, BUT I am excited about streamlining packaging and eliminating special cases (like
Yeah, so if we say, added support for finding LCP events in the trace and wanted to release that right away in tracehouse, but then didn't do a Lighthouse release for a while after that, how would that look? That seems like it would be ok-ish (would lighthouse's tracehouse dep version get bumped when tracehouse was released or does it not matter and it always uses the local version?). What other dependency situations are tricky? Other things:
|
I'm not sure which aspect of "look" you're most interested in here. If we diverge on version between packages, I don't have a final answer for the communication/tagging/release notes/changelog pieces that's partly what's up for discussion. But I imagine we store the version in
Another script would run post-merge that
I would maybe only expect GitHub releases to be created for lighthouse proper?
It would always use the local version. This increases the importance of the release test script testing the CLI with real npm installed dependenices outside the repo.
I'm not sure I understand this concern given that anything we're proposing is trying to pull code out of the depths of core into it's own high level thing. If you're referring to the fact that there is a
Do we really support
Lerna is not used or referenced in LHCI development at all, lerna is exclusively used at publish time. yarn workspaces are required. |
I was initially confused and thought you wanted a package each for |
That is a long-term goal I believe would be great. I'm very curious to hear why you'd be against it very much :)
For the first step of subpackage management correct I would not prioritize this. If we see no world in which we would split out the other packages though, then I would not be in favor of this work. I'd prefer to just expose tracehouse via option in bullet 4. |
|
We've decided to just add a few lightweight scripts and separate If there's appetite for more and/or usage of these is high we can consider revisiting this approach in the future. |
Can we try to do the same with the viewer? I'm willing to help on this. |
@dvelasquez I believe what you've been referring to as "viewer" is what we call the report renderer. Viewer means something very different to us as it's a standalone app hosted on Github pages that has firebase auth, github authentication. Github gist storage, GA tracking, multiple lighthouse version support back to v2, etc. We do not intend on packaging this app for npm. |
Cool, I see the difference now @patrickhulce |
Yes for the purposes of your project the report renderer source is exactly what you want 👍 |
@patrickhulce is this proposal still pending? 👀 |
Ah yes @adrianaixba I'm slowly working on this for tracehouse ( #11034 #11253 ), I'll update :) |
We did some inter-project organization recently ( |
EDIT: Updated June 2020 with the elements of this that we no longer need styled with strikethrough.
Summary
Long-term goals:
Long-term Proposal:
packages/*
style withcore
,cli
,report
,viewer
,tracehouse
,logger
to establish logical delineations between packages.packages/logger
and publish tracehouse frompackages/tracehouse
, continue to publish the root aslighthouse
initially.core
,cli
, andreport
.packages/core/lib
before being promoted to a folder inpackages/
if demand exists.Short-term goals:
Share report UI elements with lighthouse-ci MVP.Short-term Proposal:
Break apart the monolithictemplates.html
andreport-styles.css
into reusable web components that could berequire
'd in lighthouse-ci.Augment those web components to support diff-modes where applicable.packages/tracehouse
.Short-term Hackier Alternatives:
Fork just the necessary report UI components in the lighthouse-ci repo, copy/paste certain styles for consistency.lighthouse-core/lib/tracehouse
. It's dependencyless and I mean how frequently do we update that logic anyhow.To be honest, given our timeframe constraints and lack of clarity on where the report UI components might go, I think I prefer the hackier alternatives, but the long-term vision of doing things the right way does get me all warm and fuzzy, so feedback welcome! :)
The text was updated successfully, but these errors were encountered: