PageSourceSearch

https://app.wpml.org/assets/desk/register-f84e1a1a.js

js wpml.org collected 2026-09-24 06:48:51 UTC 1,908 bytes, 26 lines download raw bytes

1// Desk-only Stimulus controllers, registered by the ADMIN LAYOUT alone (app/views/layouts/admin.html.erb).
2//
3// Why they do not live under app/javascript/controllers: that started as a request-flood measure —
4// controllers/index.js used to EAGER-load every module pinned there on every page, client pages
5// included, and the availability controller (W4 piece 1) added exactly one request per page and
6// pushed the account-landing E2E scenarios over their gate (506 of 500, 2026-09-08). Since the
7// 2026-09-17 loading change that is lazy, so a desk controller under controllers/ would no longer
8// cost a client page anything. They stay here anyway, because a desk controller belongs where the
9// desk is — and because this file is now the ONLY thing that registers these three names.
10//
11// ⚠ THAT MAKES THE LOAD ORDER LOAD-BEARING. The lazy loader turns `data-controller="availability"`
12// into `import("controllers/availability_controller")`, which the import map does not name, so it
13// must never see the desk markup before this file has registered the name (Stimulus' loader skips
14// an identifier that is already registered). controllers/index.js holds its scan until
15// DOMContentLoaded for exactly that reason; its comment is the long form.
16import { application } from "controllers/application"
17import AvailabilityController from "desk/availability_controller"
18import AcceptController from "desk/accept_controller"
19import WorkNoticesController from "desk/work_notices_controller"
20// W4 piece 4: the browser notification. A SIDE-EFFECT IMPORT, not a controller — it answers the
21// `desk:notice` window event and has no element to attach to, so importing it IS registering it.
22import "desk/browser_notifications"
23
24application.register("availability", AvailabilityController)
25application.register("desk-accept", AcceptController)
26application.register("work-notices", WorkNoticesController)

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.