-
Notifications
You must be signed in to change notification settings - Fork 66
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
feat: add resource and navigation event filtering #419
Merged
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
3fd4d7b
feat: add ignore callback to resource plugin config
williazz e44c803
docs: ResourcePlugin(ignoreEvent) callback description and example
williazz 7258bb7
chore(release): 1.14.0
williazz c88e762
fix: rename Resource ignoreEvent to ignore for consistency
williazz 744fb2a
fix: rename resource ignore test using "when... then..." format
williazz 12a10b8
Revert "chore(release): 1.14.0"
williazz af330b7
fix: resource ignore returns any value that coerces into a boolean fo…
williazz 683b219
refactor: change ignore(entry) to expect a PerformanceEntry
williazz 4409167
docs: share ignore() between Resource and Navigation Plugin through p…
williazz a40218d
feat: allow NavigationPlugin to ignore level 2 events
williazz b3d40bc
docs: explain how performance ignore() can ignore navigation and reso…
williazz 82f6704
fix: delete refactors that are unrelated to this PR
williazz 98fcbda
feat: ignore events from chrome extensions by default
williazz 903779b
fix: migrate all shared performance configuration to performance-utils
williazz 00a0e61
Edit documentation
qhanam 30c20ec
Revert logic inversion
qhanam 690944c
Fix PerformanceNavigationTiming type casting
qhanam 51cc2c8
Fix refactor revert
qhanam b6252a7
Fix buildResourcePlugin
qhanam 4aa5058
Fix buildResourcePlugin
qhanam 33b44ca
fix: change default performance config to ignore non-http(s) resource…
williazz b3228fc
refactor: simplify performance unit tests() to ignore all events
williazz 287a4ca
test: add unit tests for defaultPerformanceIgnore()
williazz b0666a2
fix: move defaultPerformanceIgnore() unit tests to performance-utils.…
williazz 95e6868
fix: add unit tests when entry is subclass of PerformanceEntry
williazz 5d0ac8c
Use one type for performance config
qhanam 6fc4f0f
Use stream filter pattern consistently
qhanam 7c9f8db
fix: remove unecessary defaultIgnore() tests
williazz b8d07e1
fix: remove performance mock data helpers
williazz c19a350
Fix default value in docs
qhanam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
export const defaultPerformanceIgnore = (entry: PerformanceEntry) => | ||
import { ResourceType } from '../../utils/common-utils'; | ||
|
||
export const defaultIgnore = (entry: PerformanceEntry) => | ||
entry.entryType === 'resource' && !/^https?:/.test(entry.name); | ||
|
||
export type PartialPerformancePluginConfig = { | ||
ignore?: (event: PerformanceEntry) => any; | ||
eventLimit?: number; | ||
ignore?: (event: PerformanceEntry) => any; | ||
recordAllTypes?: ResourceType[]; | ||
sampleTypes?: ResourceType[]; | ||
}; | ||
|
||
export type PerformancePluginConfig = { | ||
ignore: (event: PerformanceEntry) => any; | ||
eventLimit: number; | ||
ignore: (event: PerformanceEntry) => any; | ||
recordAllTypes: ResourceType[]; | ||
sampleTypes: ResourceType[]; | ||
}; | ||
|
||
export const defaultPerformancePluginConfig = { | ||
ignore: defaultPerformanceIgnore, | ||
eventLimit: 10 | ||
eventLimit: 10, | ||
ignore: defaultIgnore, | ||
recordAllTypes: [ResourceType.DOCUMENT, ResourceType.SCRIPT], | ||
sampleTypes: [ | ||
ResourceType.STYLESHEET, | ||
ResourceType.IMAGE, | ||
ResourceType.FONT, | ||
ResourceType.OTHER | ||
] | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
issue: we need to update the performance config documentation
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.
Documentation for
eventLimit
,recordAllTypes
andsampleTypes
has never existed, so there's no regression or omission with respect to this PR.Let's close out this PR and track that separately.