···11+---
22+title: Just in time documentation is the right documentation
33+illustration: https://cdn.jsdelivr.net/gh/jcalixte/static@master/doc-jit/doc-jit-cover.png
44+layout: post
55+date: 2023-05-29
66+---
77+88+# Just in time documentation is the right documentation
99+1010+## Falling over the same trap again and again
1111+1212+Many times a problem occurs where new developers fall over the same trap again and again despite the fact that the solution has been well documented. How can it be their fault? They didn't even know the documentation existed!
1313+1414+The eternal question of "do we write documentation for our project?"... But if no one read it when it needs to, the documentation becomes waste.
1515+1616+## Just in time
1717+1818+_Just in time_ (`jit`) is a lean concept: the goal for a team is to produce the right amount of value when the client needs it. No less no more.
1919+2020+So I created a VS Code extension doing exactly that: [doc-jit](https://marketplace.visualstudio.com/items?itemName=jcalixte.doc-jit). It provides the right amount of knowledge the exact moment the developper needs it: _just in time documentation_. 🤎
2121+2222+## How does it work?
2323+2424+You set glob patterns that is affiliated with a documentation file and [doc-jit](https://marketplace.visualstudio.com/items?itemName=jcalixte.doc-jit) will propose you when your active file matches at least one of them.
2525+2626+```json
2727+// .doc-jitrc.json
2828+{
2929+ "patterns": {
3030+ "**/*.test.ts, **/*.test.tsx": [
3131+ {
3232+ "label": "Jest documentation",
3333+ "uri": "https://jestjs.io/docs/getting-started"
3434+ },
3535+ {
3636+ "label": "Vitest documentation",
3737+ "uri": "https://vitest.dev/guide/"
3838+ }
3939+ ],
4040+ "**/*.test.tsx": [
4141+ {
4242+ "label": "React Native testing library documentation",
4343+ "uri": "https://callstack.github.io/react-native-testing-library/docs/getting-started"
4444+ }
4545+ ]
4646+ }
4747+}
4848+```
4949+5050+In real life, it looks like this:
5151+5252+<video controls autoplay loop preload="none" playsinline muted>
5353+ <source
5454+ src="https://cdn.jsdelivr.net/gh/jcalixte/static@main/doc-jit/docjit-tuto.webm"
5555+ type="video/webm"
5656+ />
5757+ <source
5858+ src="https://cdn.jsdelivr.net/gh/jcalixte/static@main/doc-jit/docjit-tuto.mp4"
5959+ type="video/mp4"
6060+ />
6161+</video>
6262+6363+It's that simple and you can start with ease. For example, just your dependencies first, it's surprisingly powerful. Then add your own documentation, standards, tutorial, videos, etc. One problem solving at a time. Just in time. 😊