-
Notifications
You must be signed in to change notification settings - Fork 27.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
Allow disabling HTTP request logs in dev server #74349
base: canary
Are you sure you want to change the base?
Conversation
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
81f16af
to
bc8aed5
Compare
IMO, should be called |
Tracing and logging are different concepts. Tracing usually involves keeping track of a request journey and storing it somewhere. Logging is simpler, just print requests that are happening. |
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 also need an e2e development test for this option
Tests Passed |
Stats from current PRDefault BuildGeneral
Client Bundles (main, webpack)
Legacy Client Bundles (polyfills)
Client Pages
Client Build Manifests
Rendered Page Sizes
Edge SSR bundle Size
Middleware size
Next Runtimes
build cache
Diff detailsDiff for edge-ssr.jsDiff too large to display Diff for 5306-HASH.jsDiff too large to display Diff for main-HASH.jsDiff too large to display Diff for app-page-exp..ntime.dev.jsfailed to diff Diff for app-page-exp..time.prod.jsDiff too large to display Diff for app-page-tur..time.prod.jsDiff too large to display Diff for app-page-tur..time.prod.jsDiff too large to display Diff for app-page.runtime.dev.jsfailed to diff Diff for app-page.runtime.prod.jsDiff too large to display Diff for pages-turbo...time.prod.jsDiff too large to display Diff for pages.runtime.dev.jsDiff too large to display Diff for pages.runtime.prod.jsDiff too large to display Diff for server.runtime.prod.jsfailed to diff |
The above failure is likely unrelated to my change. It's surprisingly passing on my machine so it might be flaky. I found a bug that is likely causing this instability. This diff should make it more stable diff --git packages/react-refresh-utils/internal/helpers.ts packages/react-refresh-utils/internal/helpers.ts
index fd26cc0599..1f7a63b6e6 100644
--- packages/react-refresh-utils/internal/helpers.ts
+++ packages/react-refresh-utils/internal/helpers.ts
@@ -63,6 +63,11 @@ function registerExportsForReactRefresh(
moduleExports: unknown,
moduleID: string
) {
+ // Skip registration if this module was already registered
+ if (RefreshRuntime.isRegisteredForRefresh(moduleID + ' %exports%')) {
+ return
+ }
+
RefreshRuntime.register(moduleExports, moduleID + ' %exports%')
if (moduleExports == null || typeof moduleExports !== 'object') {
// Exit if we can't iterate over exports. The issue appears to be in the React Refresh implementation. When we add the default export to bar.js, it becomes a React Refresh boundary (due to exporting a component). This causes the module to be initialized twice: |
48da0ca
to
362b62b
Compare
e072846
to
edc2b65
Compare
4913050
to
908a7a5
Compare
@huozhi PTAL |
This PR introduces a way to filter or disable incoming request logs in development. It adds a new
incomingRequest
option tologgingConfig
, supporting both a simple boolean toggle and a configurableignore
. By default, logs remain enabled, preserving existing behavior.Notes:
•
loggingConfig.incomingRequest = false
fully disables incoming request logs.•
loggingConfig.incomingRequest.ignore
accepts a regular expressions array to selectively silence logs.• Covered by unit tests (
shouldLogIncomingRequest
)Resolves the dev server’s verbose logging problem discussed in #65992 and complements the effort in #67590.