-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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: pass file preprocesor override to protocol as debug data #31171
chore: pass file preprocesor override to protocol as debug data #31171
Conversation
cypress
|
Project |
cypress
|
Branch Review |
ryanm/chore/pass-file-preprocessor-override-to-protocol
|
Run status |
|
Run duration | 17m 59s |
Commit |
|
Committer | Ryan Manuel |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
11
|
|
1232
|
|
0
|
|
32101
|
View all changes introduced in this branch ↗︎ |
UI Coverage
46.15%
|
|
---|---|
|
184
|
|
162
|
Accessibility
92.55%
|
|
---|---|
|
3 critical
8 serious
2 moderate
2 minor
|
|
877
|
…eprocessor-override-to-protocol
registerChildEvent('file:preprocessor', this._getDefaultPreprocessor(initialConfig), true) | ||
} |
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.
Instead of updating registerChildEvent
which seems odd since we would need to update all of our registerChildEvent
calls to pass true
, can we do something like:
registerChildEvent('file:preprocessor', this._getDefaultPreprocessor(initialConfig), true) | |
} | |
registerChildEvent('file:preprocessor', this._getDefaultPreprocessor(initialConfig), true) | |
} else { | |
const handler = this.registeredEventsById[this.registeredEventsByName['file:preprocessor']].handler | |
this.ipc.send('file:preprocessor:overridden', { handlerString: handler.toString() }) | |
} |
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 like it. Updated: 1a261e2
(#31171)
@@ -238,6 +244,12 @@ export class ProjectConfigIpc extends EventEmitter { | |||
reject(err) | |||
}) | |||
|
|||
this.once('file:preprocessor:overridden', ({ handlerString }) => { | |||
this.onDebugData({ | |||
filePreprocessorHandlerString: handlerString, |
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.
filePreprocessorHandlerString: handlerString, | |
filePreprocessorHandlerText: handlerFunctionText, |
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.
Good call. Updated: 1a261e2
(#31171)
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.
Looks good overall! Added a couple suggestions.
@@ -238,6 +244,12 @@ export class ProjectConfigIpc extends EventEmitter { | |||
reject(err) | |||
}) | |||
|
|||
this.once('file:preprocessor:overridden', ({ handlerString }) => { |
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.
this.once('file:preprocessor:overridden', ({ handlerString }) => { | |
this.once('file:preprocessor:overridden', ({ handlerText }) => { |
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.
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Additional details
In order to improve troubleshooting source map issues as a part of test generation, we are going to start capturing any
file:preprocessor
overrides. This will hopefully give us insight into whether or not sourcemaps have not been properly enabled. This PR captures the function string and passes it from the child process to main Cypress where it's stored as a debug property on ProjectConfigLifecycleManager. There it can be passed to protocol where it will be stored as a debug event.Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?