Background
Remove unused code from instrumentation.js in Vector 22 to simplify maintenance and improve performance. We are logging multiple events against the event platform for every search that we never use. This is requiring unnecessary additional processing and downloaded bytes for the user.
The removal here has no visible impact on end users, but it'll make future updates easier for developers.
User Story
As a developer, I want to remove unused code from instrumentation.js, so that the file is cleaner and easier to work with.
- Identify and remove unused code from instrumentation.js.
- Ensure no other parts of the app are broken after removal.
- Test to confirm everything works as expected.
- Update docs if needed.
Requirement
Remove unused performance metrics from instrumentation.js in Vector 2022 and mediawiki.page.ready to simplify maintenance and improve performance. Ensure that this removal does not break existing functionality or impact other parts of the application.
BDD
Feature: Remove unused performance metrics from Vector search instrumentation.js Scenario: Search functionality with unused performance metrics removed Given I am on the beta site When I perform a search using Vector 2022 skin Then the search results should appear correctly And I should be able to navigate to a page without errors in the developer console
Test Steps
Test Case 1: Verify Search Functionality in Vector 2022 After Code Removal
- Visit https://en.wikipedia.beta.wmflabs.org/w/index.php?title=T352930.
- Perform a search for any valid term in the search bar.
- ✅ AC1: Confirm that the search results appear correctly and allow navigation to a page.
- Open the browser’s developer console.
- ✅ AC2: Ensure no errors are logged in the console during the search workflow.
Test Case 2: Verify Search Functionality in Vector Skin
- Visit https://en.wikipedia.beta.wmflabs.org/w/index.php?title=T352930&useskin=vector.
- Perform a search for any valid term in the search bar.
- ✅ AC3: Confirm that the search results appear correctly and allow navigation to a page.
- Open the browser’s developer console.
- ✅ AC4: Ensure no errors are logged in the console during the search workflow.
Acceptance Criteria
- The code in mediawiki.page.ready is removed: https://gerrit.wikimedia.org/r/c/mediawiki/core/ /1088636/4/resources/src/mediawiki.page.ready/ready.js#b243
- the code in Vevtor instrumentation.js is removed
- Unused code is removed.
- Everything still works.
- No regressions.
QA
- Visit https://en.wikipedia.beta.wmflabs.org/w/index.php?title=T352930 and perform a search. You should be able to find a page and navigate to a page without seeing any errors in the developer console.
- Visit https://en.wikipedia.beta.wmflabs.org/w/index.php?title=T352930&useskin=vector and perform a search. You should be able to find a page and navigate to a page without seeing any errors in the developer console.
QA Results - Beta
AC | Status | Details |
---|---|---|
1 | ✅ | T379861#10382091 |
2 | ✅ | T379861#10382091 |
3 | ✅ | T379861#10382091 |
4 | ✅ | T379861#10382091 |