commit 5024760ece3972b42a128ad032b57e67e8cb104b
parent c7a9790a3566a374803c95b1586b9dd52cb104ca
Author: Nicolas Chevobbe <nchevobbe@mozilla.com>
Date: Thu, 13 Nov 2025 14:40:59 +0000
Bug 1990474 - [devtools] Remove ChangesActor. r=devtools-reviewers,devtools-backward-compat-reviewers,ochameau.
It's not used anymore since we switched to CSS_CHANGE resources.
Differential Revision: https://phabricator.services.mozilla.com/D265789
Diffstat:
9 files changed, 5 insertions(+), 91 deletions(-)
diff --git a/devtools/client/fronts/changes.js b/devtools/client/fronts/changes.js
@@ -1,33 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const {
- FrontClassWithSpec,
- registerFront,
-} = require("resource://devtools/shared/protocol.js");
-const { changesSpec } = require("resource://devtools/shared/specs/changes.js");
-
-/**
- * ChangesFront, the front object for the ChangesActor
- */
-class ChangesFront extends FrontClassWithSpec(changesSpec) {
- constructor(client, targetFront, parentFront) {
- super(client, targetFront, parentFront);
-
- // Attribute name from which to retrieve the actorID out of the target actor's form
- this.formAttributeName = "changesActor";
- }
-
- async initialize() {
- // Ensure the corresponding ChangesActor is immediately available and ready to track
- // changes by calling a method on it. Actors are lazy and won't be created until
- // actually used.
- await super.start();
- }
-}
-
-exports.ChangesFront = ChangesFront;
-registerFront(ChangesFront);
diff --git a/devtools/client/fronts/moz.build b/devtools/client/fronts/moz.build
@@ -18,7 +18,6 @@ DevToolsModules(
"array-buffer.js",
"blackboxing.js",
"breakpoint-list.js",
- "changes.js",
"compatibility.js",
"css-properties.js",
"device.js",
diff --git a/devtools/client/inspector/changes/reducers/changes.js b/devtools/client/inspector/changes/reducers/changes.js
@@ -181,10 +181,10 @@ const INITIAL_STATE = {};
const reducers = {
/**
- * CSS changes are collected on the server by the ChangesActor which dispatches them to
- * the client as atomic operations: a rule/declaration updated, added or removed.
+ * CSS changes are collected on the server by the CSSChangeWatcher which sends CSS_CHANGE
+ * resources to the client as atomic operations: a rule/declaration updated, added or removed.
*
- * By design, the ChangesActor has no big-picture context of all the collected changes.
+ * By design, the CSSChangeWatcher has no big-picture context of all the collected changes.
* It only holds the stack of atomic changes. This makes it roboust for many use cases:
* building a diff-view, supporting undo/redo, offline persistence, etc. Consumers,
* like the Changes panel, get to massage the data for their particular purposes.
diff --git a/devtools/client/inspector/compatibility/CompatibilityView.js b/devtools/client/inspector/compatibility/CompatibilityView.js
@@ -146,8 +146,8 @@ class CompatibilityView {
this.#isChangeAddedWhileHidden = false;
- // We need to debounce updating nodes since "add-change" event on changes actor is
- // fired for every typed character until fixing bug 1503036.
+ // We need to debounce updating nodes since we might get CSS_CHANGE resources for
+ // every typed character until fixing bug 1503036.
if (this.#previousChangedSelector === selector) {
clearTimeout(this.#updateNodesTimeoutId);
}
diff --git a/devtools/server/actors/moz.build b/devtools/server/actors/moz.build
@@ -31,7 +31,6 @@ DevToolsModules(
"blackboxing.js",
"breakpoint-list.js",
"breakpoint.js",
- "changes.js",
"common.js",
"css-properties.js",
"device.js",
diff --git a/devtools/server/actors/utils/actor-registry.js b/devtools/server/actors/utils/actor-registry.js
@@ -228,11 +228,6 @@ const ActorRegistry = {
constructor: "AccessibilityActor",
type: { target: true },
});
- this.registerModule("devtools/server/actors/changes", {
- prefix: "changes",
- constructor: "ChangesActor",
- type: { target: true },
- });
this.registerModule("devtools/server/actors/manifest", {
prefix: "manifest",
constructor: "ManifestActor",
diff --git a/devtools/shared/specs/changes.js b/devtools/shared/specs/changes.js
@@ -1,40 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const {
- Arg,
- generateActorSpec,
- RetVal,
-} = require("resource://devtools/shared/protocol.js");
-
-const changesSpec = generateActorSpec({
- typeName: "changes",
-
- events: {
- "add-change": {
- type: "addChange",
- change: Arg(0, "json"),
- },
- "remove-change": {
- type: "removeChange",
- change: Arg(0, "json"),
- },
- "clear-changes": {
- type: "clearChanges",
- },
- },
-
- methods: {
- allChanges: {
- response: {
- changes: RetVal("array:json"),
- },
- },
- start: {}, // no arguments, no response
- },
-});
-
-exports.changesSpec = changesSpec;
diff --git a/devtools/shared/specs/index.js b/devtools/shared/specs/index.js
@@ -54,11 +54,6 @@ const Types = (exports.__TypesForTests = [
front: "devtools/client/fronts/breakpoint-list",
},
{
- types: ["changes"],
- spec: "devtools/shared/specs/changes",
- front: "devtools/client/fronts/changes",
- },
- {
types: ["compatibility"],
spec: "devtools/shared/specs/compatibility",
front: "devtools/client/fronts/compatibility",
diff --git a/devtools/shared/specs/moz.build b/devtools/shared/specs/moz.build
@@ -18,7 +18,6 @@ DevToolsModules(
"array-buffer.js",
"blackboxing.js",
"breakpoint-list.js",
- "changes.js",
"compatibility.js",
"css-properties.js",
"device.js",