Member-only story

Building a TypeScript-Compatible Webpack Loader: A PlantUML Mind Map Example

Hopefully Surprising Blog
Stackademic
Published in
6 min readSep 13, 2023

Originally published at https://hopefullysurprising.com.

In the historical book “The Pragmatic Programmer”, there has always been an entire chapter dedicated to the importance of the ability to process text files of various formats quickly and efficiently (see “The Basic Tools: Text Manipulation”). The ability to use different text formats in various situations has always been essential and likely will continue to be.

For example, while JSON notation is super useful in many contexts, in some use cases, such as creating mind maps, another format might be much better. For example, PlantUML’s mind maps might be a more preferable option for storing serialised trees.

That’s what we will implement — store this tree-structured data as text in PlanUML format and use it in a JS app.

Quick links

  • Custom webpack loader in npm
  • Source code in GitHub

Vision

Although parsing files at runtime might be a good idea, another option might be even more beneficial. If we can integrate loading with the building process, we will be able to ensure that the data required for running the app is a part of the bundle and doesn’t require passing non-common…

--

--

Published in Stackademic

Stackademic is a learning hub for programmers, devs, coders, and engineers. Our goal is to democratize free coding education for the world.

Written by Hopefully Surprising Blog

In the information theory, the more surprising the information is, the more information it contains. What I write about, surprised me. It might surprise you too

No responses yet

What are your thoughts?