Skip to content

Lightpanda: the headless browser designed for AI and automation

chore: remove unused imports

Karl Seguina67fe9f90aad
diff --git a/src/Updater.zig b/src/Updater.zig
index 1e044f432..da3122617 100644
--- a/src/Updater.zig
+++ b/src/Updater.zig
@@ -17,9 +17,6 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
const std = @import("std");
-const json = std.json;
-const SemanticVersion = std.SemanticVersion;
-const Allocator = std.mem.Allocator;
const lp = @import("lightpanda");
const Network = @import("network/Network.zig");
@@ -27,7 +24,8 @@ const http = @import("network/http.zig");
const libcurl = @import("sys/libcurl.zig");
const crypto = @import("sys/libcrypto.zig");
const Config = @import("Config.zig");
-const log = @import("log.zig");
+
+const Allocator = std.mem.Allocator;
/// Sole purpose of this client is to do updates; hence, its very minimal.
const Updater = @This();
diff --git a/src/agent/save.zig b/src/agent/save.zig
index 68c8ba494..d2f212009 100644
--- a/src/agent/save.zig
+++ b/src/agent/save.zig
@@ -23,7 +23,6 @@
const std = @import("std");
const lp = @import("lightpanda");
-const Schema = lp.Schema;
/// How a save treats an existing destination file. `update` is synthesis-only:
/// the model merges the saved script with the new material and returns the
diff --git a/src/browser/Page.zig b/src/browser/Page.zig
index 1ced15e51..b34ff0acd 100644
--- a/src/browser/Page.zig
+++ b/src/browser/Page.zig
@@ -30,7 +30,6 @@ const Viewport = @import("Viewport.zig");
const Blob = @import("webapi/Blob.zig");
const SharedWorkerGlobalScope = @import("webapi/SharedWorkerGlobalScope.zig");
-const v8 = js.v8;
const Allocator = std.mem.Allocator;
const IS_DEBUG = builtin.mode == .Debug;
diff --git a/src/browser/js/Function.zig b/src/browser/js/Function.zig
index 49bf7101c..dfb39a320 100644
--- a/src/browser/js/Function.zig
+++ b/src/browser/js/Function.zig
@@ -16,7 +16,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-const std = @import("std");
const lp = @import("lightpanda");
const js = @import("js.zig");
diff --git a/src/browser/js/Promise.zig b/src/browser/js/Promise.zig
index 78a509f9b..1dc531289 100644
--- a/src/browser/js/Promise.zig
+++ b/src/browser/js/Promise.zig
@@ -16,7 +16,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-const std = @import("std");
const js = @import("js.zig");
const v8 = js.v8;
diff --git a/src/browser/webapi/Crypto.zig b/src/browser/webapi/Crypto.zig
index dd00be087..714b89543 100644
--- a/src/browser/webapi/Crypto.zig
+++ b/src/browser/webapi/Crypto.zig
@@ -16,7 +16,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-const std = @import("std");
const lp = @import("lightpanda");
const js = @import("../js/js.zig");
diff --git a/src/browser/webapi/DataTransferItem.zig b/src/browser/webapi/DataTransferItem.zig
index a3c973fec..d62ef7b16 100644
--- a/src/browser/webapi/DataTransferItem.zig
+++ b/src/browser/webapi/DataTransferItem.zig
@@ -16,7 +16,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-const std = @import("std");
const lp = @import("lightpanda");
const js = @import("../js/js.zig");
diff --git a/src/browser/webapi/File.zig b/src/browser/webapi/File.zig
index 6a8b8958a..26f36a77c 100644
--- a/src/browser/webapi/File.zig
+++ b/src/browser/webapi/File.zig
@@ -16,7 +16,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-const std = @import("std");
const lp = @import("lightpanda");
const js = @import("../js/js.zig");
diff --git a/src/browser/webapi/Range.zig b/src/browser/webapi/Range.zig
index 9339fde76..6dc6472ce 100644
--- a/src/browser/webapi/Range.zig
+++ b/src/browser/webapi/Range.zig
@@ -17,17 +17,14 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
const std = @import("std");
-const lp = @import("lightpanda");
const js = @import("../js/js.zig");
const Frame = @import("../Frame.zig");
const Node = @import("Node.zig");
+const DOMRect = @import("DOMRect.zig");
const DocumentFragment = @import("DocumentFragment.zig");
const AbstractRange = @import("AbstractRange.zig");
-const DOMRect = @import("DOMRect.zig");
-
-const String = lp.String;
const Range = @This();
diff --git a/src/browser/webapi/SharedWorker.zig b/src/browser/webapi/SharedWorker.zig
index 991175480..e77d362b1 100644
--- a/src/browser/webapi/SharedWorker.zig
+++ b/src/browser/webapi/SharedWorker.zig
@@ -29,7 +29,6 @@
// goes quiet (entanglement is severed; nothing dangles).
const std = @import("std");
-const lp = @import("lightpanda");
const js = @import("../js/js.zig");
@@ -41,8 +40,6 @@ const EventTarget = @import("EventTarget.zig");
const MessagePort = @import("MessagePort.zig");
const SharedWorkerGlobalScope = @import("SharedWorkerGlobalScope.zig");
-const log = lp.log;
-
const SharedWorker = @This();
_proto: *EventTarget,
diff --git a/src/browser/webapi/SharedWorkerGlobalScope.zig b/src/browser/webapi/SharedWorkerGlobalScope.zig
index ad3456fb3..c3825c822 100644
--- a/src/browser/webapi/SharedWorkerGlobalScope.zig
+++ b/src/browser/webapi/SharedWorkerGlobalScope.zig
@@ -21,7 +21,6 @@ const lp = @import("lightpanda");
const js = @import("../js/js.zig");
-const URL = @import("../URL.zig");
const Frame = @import("../Frame.zig");
const Transfer = @import("../../network/HttpClient.zig").Transfer;
diff --git a/src/browser/webapi/element/Svg.zig b/src/browser/webapi/element/Svg.zig
index 56728991f..bded50374 100644
--- a/src/browser/webapi/element/Svg.zig
+++ b/src/browser/webapi/element/Svg.zig
@@ -16,7 +16,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-const std = @import("std");
const lp = @import("lightpanda");
const js = @import("../../js/js.zig");
diff --git a/src/browser/webapi/event/DeviceMotionEvent.zig b/src/browser/webapi/event/DeviceMotionEvent.zig
index 6da445f79..3b74da8e3 100644
--- a/src/browser/webapi/event/DeviceMotionEvent.zig
+++ b/src/browser/webapi/event/DeviceMotionEvent.zig
@@ -16,7 +16,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-const std = @import("std");
const lp = @import("lightpanda");
const js = @import("../../js/js.zig");
@@ -25,7 +24,6 @@ const Frame = @import("../../Frame.zig");
const Event = @import("../Event.zig");
const String = lp.String;
-const Allocator = std.mem.Allocator;
// https://w3c.github.io/deviceorientation/#devicemotionevent
const DeviceMotionEvent = @This();
diff --git a/src/browser/webapi/event/DeviceOrientationEvent.zig b/src/browser/webapi/event/DeviceOrientationEvent.zig
index 267611c85..b1526fb93 100644
--- a/src/browser/webapi/event/DeviceOrientationEvent.zig
+++ b/src/browser/webapi/event/DeviceOrientationEvent.zig
@@ -16,7 +16,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-const std = @import("std");
const lp = @import("lightpanda");
const js = @import("../../js/js.zig");
@@ -25,7 +24,6 @@ const Frame = @import("../../Frame.zig");
const Event = @import("../Event.zig");
const String = lp.String;
-const Allocator = std.mem.Allocator;
// https://w3c.github.io/deviceorientation/#deviceorientationevent
const DeviceOrientationEvent = @This();
diff --git a/src/browser/webapi/event/DragEvent.zig b/src/browser/webapi/event/DragEvent.zig
index bbca62c9d..fe441bade 100644
--- a/src/browser/webapi/event/DragEvent.zig
+++ b/src/browser/webapi/event/DragEvent.zig
@@ -16,7 +16,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-const std = @import("std");
const lp = @import("lightpanda");
const js = @import("../../js/js.zig");
diff --git a/src/browser/webapi/event/GamepadEvent.zig b/src/browser/webapi/event/GamepadEvent.zig
index 62fe4f75c..cc7ffcd56 100644
--- a/src/browser/webapi/event/GamepadEvent.zig
+++ b/src/browser/webapi/event/GamepadEvent.zig
@@ -16,7 +16,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-const std = @import("std");
const lp = @import("lightpanda");
const js = @import("../../js/js.zig");
@@ -25,7 +24,6 @@ const Frame = @import("../../Frame.zig");
const Event = @import("../Event.zig");
const String = lp.String;
-const Allocator = std.mem.Allocator;
// https://w3c.github.io/gamepad/#gamepadevent-interface
const GamepadEvent = @This();
diff --git a/src/browser/webapi/event/TouchEvent.zig b/src/browser/webapi/event/TouchEvent.zig
index f15da08b7..3876b73ab 100644
--- a/src/browser/webapi/event/TouchEvent.zig
+++ b/src/browser/webapi/event/TouchEvent.zig
@@ -16,7 +16,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-const std = @import("std");
const lp = @import("lightpanda");
const js = @import("../../js/js.zig");
@@ -26,7 +25,6 @@ const Event = @import("../Event.zig");
const UIEvent = @import("UIEvent.zig");
const String = lp.String;
-const Allocator = std.mem.Allocator;
// https://w3c.github.io/touch-events/#touchevent-interface
// There is no touch input source: the touch lists are always empty.
diff --git a/src/browser/webapi/event/WheelEvent.zig b/src/browser/webapi/event/WheelEvent.zig
index 89d5bef5f..b900f812d 100644
--- a/src/browser/webapi/event/WheelEvent.zig
+++ b/src/browser/webapi/event/WheelEvent.zig
@@ -16,7 +16,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-const std = @import("std");
const lp = @import("lightpanda");
const js = @import("../../js/js.zig");
diff --git a/src/browser/webapi/storage/idb/IDBDatabase.zig b/src/browser/webapi/storage/idb/IDBDatabase.zig
index 736d95c03..a5e82b84a 100644
--- a/src/browser/webapi/storage/idb/IDBDatabase.zig
+++ b/src/browser/webapi/storage/idb/IDBDatabase.zig
@@ -17,7 +17,6 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
const std = @import("std");
-const lp = @import("lightpanda");
const js = @import("../../../js/js.zig");
diff --git a/src/browser/webapi/storage/idb/IDBIndex.zig b/src/browser/webapi/storage/idb/IDBIndex.zig
index 4b6c1e7bd..df993cc15 100644
--- a/src/browser/webapi/storage/idb/IDBIndex.zig
+++ b/src/browser/webapi/storage/idb/IDBIndex.zig
@@ -16,7 +16,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-const std = @import("std");
const lp = @import("lightpanda");
const js = @import("../../../js/js.zig");
diff --git a/src/browser/webapi/storage/idb/IDBRequest.zig b/src/browser/webapi/storage/idb/IDBRequest.zig
index 7c18f3838..6999d9a52 100644
--- a/src/browser/webapi/storage/idb/IDBRequest.zig
+++ b/src/browser/webapi/storage/idb/IDBRequest.zig
@@ -16,7 +16,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-const std = @import("std");
const lp = @import("lightpanda");
const js = @import("../../../js/js.zig");
diff --git a/src/browser/webapi/storage/idb/Manager.zig b/src/browser/webapi/storage/idb/Manager.zig
index 0eaecb3b3..17cbbca8a 100644
--- a/src/browser/webapi/storage/idb/Manager.zig
+++ b/src/browser/webapi/storage/idb/Manager.zig
@@ -17,11 +17,9 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
const std = @import("std");
-const lp = @import("lightpanda");
const Engine = @import("Engine.zig");
-const log = lp.log;
const Allocator = std.mem.Allocator;
const Manager = @This();
diff --git a/src/browser/webapi/svg/PointList.zig b/src/browser/webapi/svg/PointList.zig
index 6c9a645a4..da2d06448 100644
--- a/src/browser/webapi/svg/PointList.zig
+++ b/src/browser/webapi/svg/PointList.zig
@@ -6,7 +6,6 @@
// (at your option) any later version.
const std = @import("std");
-const lp = @import("lightpanda");
const js = @import("../../js/js.zig");
const Frame = @import("../../Frame.zig");
diff --git a/src/datetime.zig b/src/datetime.zig
index 52526719b..678eff453 100644
--- a/src/datetime.zig
+++ b/src/datetime.zig
@@ -18,7 +18,6 @@
const std = @import("std");
const lp = @import("lightpanda");
-const builtin = @import("builtin");
const Allocator = std.mem.Allocator;