mobile.search.util is defined as:
"mobile.search.util": { "targets": [ "mobile", "desktop" ], "dependencies": [ "mobile.startup" ], "scripts": [ "resources/mobile.search.util/extendSearchParams.js" ] }
That is, it consists of one JavaScript file and depends on mobile.startup.
It is referenced only by MobileFrontend, mobile.watchstar, mobile.search.api, and mobile.nearby. The first two already each depend on mobile.startup and mobile.nearby depends on mobile.init which depends on mobile.startup. mobile.watchlist has an implicit dependency on mobile.search.util but already depends on mobile.startup.
This task encompasses the following work:
- Move extendSearchParams.js and extendSearchParams.test.js to mobile.startup.
- Update all M.define() / require() calls from 'mobile.search.util/extendSearchParams' to 'mobile.startup/extendSearchParams'. mobile.startup/extendSearchParams.js' M.define() call is moved to mobile.startup.js as per usual.
- Update mobile.startup/extendSearchParams.js to use module.exports, remove the top-level IIFE and replace parameters with file scope variables, and replace other M.require() calls with Node.js require().
- Add a Node.js require('./extendSearchParams.js') to the end of the growing module list in mobile.startup.js.
- Delete the extension.json entry for mobile.search.util.
- Easy, peasy.
Acceptance criteria
- Update any dependencies to mobile.search.util to point to mobile.startup
- Remove the mobile.search.util module (there is no impact on caching here as mobile.search.util is never added directly to the HTML via an addModules call)
- Follow the deprecation policy to ensure compatibility between old and new modules. The new module should be renamed and defined via M.define like so:
M.define( "mobile.startup/extendSearchParams" ).deprecate( "mobile.search.util/extendSearchParams" )
- Update existing users to use the new module name.