Matteo Tosi

👋 hello fellow humans

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.

Pilot ID · SWE

Software Engineer @ g3w-suite

Over a decade fighting enterprise maps. Day job: getting QGIS projects to fly on the web.

Station
g3w-suite · client, server, Docker, plugins
On board since
2012
Side missions
Leaflet plugins, brownfield code
Motto
Peace, love, and lean code.

Callsign · Raruto

This is Raruto.

Just another human in the loop. The helmet does most of the work.

Callsign
Raruto
Name
Matteo Tosi
Home base
github.com/Raruto
Flight log
Debriefs →

Stencil · 01

No step

On a real airframe it marks the panels your boot would punch through. Here it marks the parts held together with duct tape. Tread lightly.

Stencil · 02

Mach 3+ inside

SR-71 cruise speed. This site gets close by shipping almost nothing: plain HTML, one stylesheet, no framework.

Mach 3
Not included.

Stencil · 04

Open hatch

Most of my open-source mileage is Leaflet plugins. Maps that rotate, draw elevation profiles, and lately go 3D.

Hangar
42 airframes →

Stencil · 03

Rust free

No theme, no page builder. Markdown in, HTML out, one small Node script in between. Hand-rolled HTML, like it's 1999.

Source
Raruto/raruto.github.io

Stencil · 05

Best viewed @ 85,000 ft

Roughly where the SR-71 cruised. Down here, any browser from this decade will do.

Ground crew

GitHub Pages

The runway. Markdown in, HTML out, one small Node script in between, pushed to a repo and served from there. No servers to babysit.

Source
Raruto/raruto.github.io
Service
pages.github.com