Peter Kröner

Defeat that legacy monster! Guerilla refactoring with web standards

Can you defeat a legacy monster with `document.write()`? Learn how to weaponize web standards and incrementally refactor even the most stubborn codebases.

Defeat that legacy monster! Guerilla refactoring with web standards
#1about 2 minutes

Understanding the nature of legacy project monsters

Legacy projects are often more than just broken software; they can be an enemy that grows stronger with every new feature added.

#2about 5 minutes

How good intentions lead to broken legacy projects

Projects become legacy messes over time because initial technology and pattern choices are made with incomplete information about the future.

#3about 2 minutes

Adopting a guerrilla warfare mindset for refactoring

Instead of negotiating with an unmaintainable system, declare a war of attrition to subvert it by exploiting its reliance on web standards.

#4about 4 minutes

Creating modern code islands with web components

Web components allow you to build encapsulated features with private state and DOM, creating a safe space away from the legacy project's influence.

#5about 5 minutes

Weaponizing old and obscure browser features

The browser's commitment to backward compatibility means even ancient features like the BGCOLOR attribute can be used as tools to fight legacy constraints.

#6about 3 minutes

Injecting components using the document.write hack

When a legacy framework blocks custom elements, you can use the ancient `document.write` method inside a script tag to inject them directly into the HTML parser.

#7about 3 minutes

A step-by-step battle plan to defeat legacy monsters

Combine modern web components with old browser hacks to incrementally add new functionality, connect it via message passing, and ultimately replace the old system.

Related jobs
Jobs that call for the skills explored in this talk.

Featured Partners

Related Articles

View all articles
DC
Daniel Cranney
The State of HTML 2024: What can we learn from it?
The results of the State of HTML 2024 survey are in! Though the name suggests it’s HTML-only, the survey focuses on the web platform in a more general sense, giving us some fascinating insights into not only the state of the web, but also some sense ...
The State of HTML 2024: What can we learn from it?
BR
Benjamin Ruschin
The HTML Elements That You’re Probably Over-Engineering
As frameworks have become more and more commonplace in the world of web development, so too has the over-engineering of features made possible by our humble old friend, HTML. The mental models that come with using state management in React, Vue and o...
The HTML Elements That You’re Probably Over-Engineering
DC
Daniel Cranney
Dev Digest 165: "Slopsquatting", Chrome extension tracking and CSS hell
Inside last week’s Dev Digest 165 . 🤖 Microsoft creates light-weight LLM to run on CPUs 💻 The state of Webdev AI 🙅‍♂️ Why you should lie to LLMs and not thank them 🥷 Chrome extensions have hidden tracking code 🔨 How to build and AI Agent 🔒 Slopsquat...
Dev Digest 165: "Slopsquatting", Chrome extension tracking and CSS hell

From learning to earning

Jobs that call for the skills explored in this talk.

Rust and GoLang

Rust and GoLang

NHe4a GmbH
Karlsruhe, Germany

Remote
55-65K
Intermediate
Senior
Go
Rust
Backend Engineer (m/w/d)

Backend Engineer (m/w/d)

fulfillmenttools
Köln, Germany

35-65K
Intermediate
TypeScript
Agile Methodologies
Google Cloud Platform