A lighter codebase without a full app rewrite? Fake it with shims
Devlog: 2026-09
Legacy codebases don't die from one big bug. They die from a thousand tiny dependencies.
For years, g3w-client dragged around heavy libraries from another era: jQuery, moment.js, Select2 and so on.
In PR #981 we went on a massive diet without a risky full rewrite. It merged on October 6.
Lightweight internal shims (src/shims/jquery.js, src/shims/moment.js, src/shims/select2.js) mimic the old APIs, so plugins keep running while the heavy libraries underneath go away.
flowchart TD
subgraph SHIM ["Example: shim for moment.js"]
direction TB
CALL["moment(date, format)"] --> WRAP["Shim Wrapper (src/shims/moment.js)"]
subgraph Internals ["Native JS Implementation"]
direction TB
WRAP -->|".format()"| INTL["Intl.DateTimeFormat"]
WRAP -->|".add() / .subtract()"| DATE["Native Date API"]
WRAP -->|".isValid() / .diff()"| TIMESTAMP["Unix Timestamp Math"]
end
INTL & DATE & TIMESTAMP --> CHAIN["Chainable Shim Instance"]
CHAIN -->|".toDate() / String"| CALLER["Legacy Plugin / Datetimepicker"]
end
We also dropped 7 more dependencies (including jszip, shpjs, and lodash.clonedeep), deprecated 8 form mixins, and moved every input definition into a single <g3w-field> component.
We also removed layersstore across the client and the admin, centralizing layer and TOC state directly under ApplicationState.project.
I also worked on editing changes: the Add/Remove Hole in Polygon tool and showing all vertices in MultiGeometry features.
On the authoring side, I opened a few pull requests on g3w-client: a release workflow, a fix for sidebar positioning inside an iframe, updated instructions for building a minimal plugin, and a finer ordering control for context menu items. I also pushed commits to g3w-admin, g3w-client, the editing plugin, and g3w-admin-panoramax.
The month closed with two new issues: finding out how to deprecate moment.js (closed by #981) and adding g3w-admin v4.0 support to the timeseries plugin. Elsewhere, I worked on a marker height fix in leaflet-elevation, tagged its v2.6.1, and tweaked my own site.