-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
chore: Intregrate runner packages. #23028
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
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.
Left a few comments/questions, happy to approve once they've been replied too - nice job on this, great to see some of this getting cleaned up!
@@ -40,8 +40,6 @@ | |||
/packages/rewriter/ @cypress-io/end-to-end | |||
/packages/root/ @cypress-io/end-to-end | |||
/packages/runner/ @cypress-io/end-to-end | |||
/packages/runner-ct/ @cypress-io/component-testing | |||
/packages/runner-shared/ @cypress-io/end-to-end | |||
/packages/server/ @cypress-io/end-to-end | |||
/packages/socket/ @cypress-io/end-to-end | |||
/packages/static/ @cypress-io/end-to-end |
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.
FYI some context - we ideally should delete ALL of runner/runner-shared, and bundle the entire app with the Vite stack.
The reason we are stuck like this is explained a little here: #20663 (comment)
Basically some of the code in driver and possibly reporter are not really ESM compatible - webpack does something different to Vite to resolve the modules, which is why it works in webpack, but we cannot import to Vite.
Not sure if this is something you are looking to investigate more @sainthkh but if you do please let me know, I'd like to follow along/help out - I'd really like to get away from this "inject webpack bundle" mess at some point, but it's quite hard. Likely making driver 100% ESM (including dependencies) would be a good first step.
Any thoughts on 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.
It seems that we have 4 things to do to delete the runner
pacakge.
- Migrate
dom
. -> I thinkdriver/src/dom
might be a good place or move it toapp
directly. - Reimplement Studio -> Cypress Studio Reimplementation Spike #22870
- ESM-ify
driver
-> I agree it's the biggest problem. - Let
reporter
compile its own styles. -> Moverunner/webpack.config.ts
toreporter
.
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.
Dom -> are you going do to this here?
Studio -> I am looking into this now
ESMify driver -> agree, hard
Reporter styles -> do this separately I think?
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.
I read the dom
code and it seems that it's better to be a separate PR.
It currently renders highlight by
- Creating the container node with jQuery.
- Rendering the Highlight DOM with React.
I can simply migrate dom
to app
and use unified-runner
. But I don't think it's not our goal. It's just hiding and postponing.
To get migrating dom
done, I need to do these things:
- Remove JQuery from
dom
anddimensions
. - Move the current JQuery version of
dimensions
todriver/src/dom
because it's used indriver/src/dom/blackout
. - Migrate
Highlight
fromreact
tovue
with ourTooltip
component. - Migrate
dom
functions toapp/runner/aut-iframe
. Leavestudio
-related functions. - Clean up unified-runner
dom
andCypressJQuery
. They're only used insideaut-iframe
. I guess they can be removed safely fromunified-runner
.
I think it's a big change and outside the scope of this PR.
As for reporter styles, it's safe to do it after ESM-ifying driver
. We're trying to remove webpack
. I don't think we don't need to create one more webpack.config.ts
now.
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.
I opened the new PR #23187 to migrate dom.js
. It's currently empty because I'm now reading and planning.
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 think alike! I love it. I started cleaning this up last week while waiting on test results because it was bugging me! I'll drop a few comments on things I noticed while cleaning this up.
packages/runner/package.json
Outdated
@@ -24,6 +24,7 @@ | |||
"@packages/rewriter": "0.0.0-development", |
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.
Need to add in the test script to run the mocha tests that were in runner-shared
and need to move the mocha test setup over as well - the test is in src/studio
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.
also "@packages/network": "0.0.0-development",
can be dropped
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.
Currently, runner-shared
unit tests are ignored.
Line 53 in f69afb5
"test": "yarn lerna exec yarn test --scope cypress --scope \"'@packages/{config,errors,data-context,electron,extension,https-proxy,launcher,net-stubbing,network,proxy,rewriter,socket}'\"", |
And it fails in the current develop
branch.
And the only the file that exists is studio-recorder.spec.js
. It's there for reference purpose and it'll be removed soon with #22870.
I checked the code base and removed network
, socket
, and rewriter
.
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.
Nice cleanup! Going to approve, but also happy to re-review if you move the DOM code to app
.
Nice list of TODOs here: #23028 (comment)
Are you still working on this @sainthkh or are we good to re-review and merge if green? |
@lmiller1990 I think it's done. I'll take care of the |
run-reporter seems broken. Last blocker @sainthkh 🤔 |
@lmiller1990 It's happening because there are 4 test files inside I intentionally didn't fix this problem at #22326 because I thought the problem is more at the ci setting side (comment). There are a few solutions for this problem:
|
Let's just take it down to |
User facing changelog
N/A. It's an internal code cleanup.
Additional details
runner-shared
andrunner-ct
intorunner
and removed unusedscss
files andreact
components.Steps to test
packages
folder structure has been changed. Run all tests to make sure that nothing has changed.How has the user experience changed?
N/A. New contributors might not be confused with the legacy codes.
PR Tasks
cypress-documentation
?type definitions
?