Skip to content

Commit e43e827

Browse files
docs: update article.
1 parent 4318ef5 commit e43e827

2 files changed

Lines changed: 52 additions & 66 deletions

File tree

docs/article.md

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,78 @@
1-
# Forget The Build Step: Building A Compiler-as-a-Service Playground
1+
# Forget The Build Step: A Browser-Native IDE For JSX + CSS
22

3-
In modern frontend development, we have normalized a heavy local setup cost. Want JSX and modern CSS dialects? Install a large dependency graph, start a dev server, and wait for transpilation loops before you can really iterate.
3+
Frontend tooling has become incredibly capable.
44

5-
I wanted to test a different path: what if we removed the terminal from the inner loop?
5+
It has also become very heavy.
66

7-
That experiment became @knighted/develop, a browser-native playground that treats your tab as a real-time compiler host.
7+
For many UI experiments, the first thing you do is not write code. You install dependencies, run a dev server, wait for transforms, and only then start iterating.
88

9-
## The Core Idea
9+
I wanted to try a different baseline:
1010

11-
Most playgrounds rely on a backend build service. @knighted/develop flips that model:
11+
What if the browser is the dev environment?
1212

13-
- JSX compilation and execution happen in the browser.
14-
- CSS transforms (including CSS Modules, Less, and Sass) run in the browser.
15-
- Compilers are loaded on demand from CDN sources.
13+
That idea became [@knighted/develop](https://github.com/knightedcodemonkey/develop).
1614

17-
The result is a development loop that feels direct: type, compile, render, repeat.
15+
It is a lightweight in-browser IDE built to showcase [@knighted/jsx](https://github.com/knightedcodemonkey/jsx) and [@knighted/css](https://github.com/knightedcodemonkey/css), with dependencies delivered over CDN ESM instead of requiring a local build step in the inner loop.
1816

19-
## The Stack Behind It
17+
## The Loop, In Practice
2018

21-
Two libraries power the runtime:
19+
Open a page, write JSX and styles, switch rendering/style modes, run lint/typecheck, and see results immediately.
2220

23-
- @knighted/jsx: JSX that resolves to real DOM nodes.
24-
- No virtual DOM requirement.
25-
- You can use declarative JSX and imperative DOM APIs in the same flow.
26-
- @knighted/css: A browser-capable CSS compiler pipeline.
27-
- Supports native CSS, CSS Modules, Less, and Sass.
28-
- Uses WASM-backed tooling for modern transforms.
21+
No local bundler needed for that loop.
2922

30-
Under the hood, the app leans on CDN resolution and lazy loading, so it fetches compiler/runtime pieces only when a mode needs them.
23+
## What Makes It Fun To Use
3124

32-
## Why "Compiler-as-a-Service"?
25+
The app is intentionally practical, not just a demo shell:
3326

34-
Compiler-as-a-Service here does not mean a remote build cluster.
27+
- Render mode switch: DOM or React
28+
- Style mode switch: CSS, CSS Modules, Less, Sass
29+
- Live preview with ShadowRoot toggle
30+
- In-browser lint and type diagnostics
31+
- Diagnostics drawer with jump-to-line navigation (mouse or keyboard)
3532

36-
It means the service boundary is split between:
33+
So it is not only "can this compile?" It is closer to "can I actually iterate on a component quickly?"
3734

38-
- global CDN infrastructure (module and WASM delivery), and
39-
- the user device (actual compilation and execution).
35+
## Why `@knighted/jsx` + `@knighted/css` Matter Here
4036

41-
If you switch into Sass mode, the browser loads Sass support. If you stay in native CSS mode, it does not pay that cost. The compiler behaves like an on-demand service, but the work stays local to the tab.
37+
`@knighted/develop` is primarily a showcase app.
4238

43-
## What This Enables
39+
It demonstrates how these libraries behave in a real authoring environment:
4440

45-
- Fast feedback loops
46-
- Rendering updates track edits with minimal overhead.
47-
- Mixed declarative and imperative workflows
48-
- Useful for low-level UI experiments and DOM-heavy component prototypes.
49-
- Isolation testing with ShadowRoot
50-
- Toggle encapsulation to verify style boundary behavior.
51-
- Zero install inner loop
52-
- Open a page and start building.
41+
- `@knighted/jsx` gives you a direct path from JSX to rendered output, including DOM-first workflows.
42+
- `@knighted/css` handles modern style pipelines in-browser, including Modules/Less/Sass.
43+
44+
Using both together in one interface makes the bigger point obvious: modern browsers can do much more of the compile/authoring cycle than we usually ask them to.
45+
46+
## "Compiler-as-a-Service" Without A Backend Build Farm
47+
48+
In this project, Compiler-as-a-Service means:
49+
50+
- CDN handles module and WASM delivery.
51+
- The browser tab does the actual compile, lint, typecheck, and render work.
52+
53+
It is service-oriented distribution, local execution.
54+
55+
And because loading is mode-aware, you only pay for what you use. If you never touch Sass, you never load Sass.
5356

5457
## Why This Matters
5558

56-
The point is not to replace every production build pipeline.
59+
This is not trying to replace production pipelines.
5760

58-
The point is to prove a stronger baseline: modern browsers are now capable enough to host substantial parts of the authoring and compile cycle directly, without defaulting to local toolchain setup for every experiment.
61+
It is about lowering the cost of exploration.
5962

60-
For prototyping and component iteration, that changes the cost model dramatically.
63+
When the setup tax drops, you try more ideas. When feedback is instant, you discover faster. And when the browser is the platform, sharing a repro can be as easy as sharing a URL.
6164

62-
## Try It
65+
For prototyping and component iteration, that is a meaningful shift.
6366

64-
- Live playground: https://knightedcodemonkey.github.io/develop/
65-
- Source repository: https://github.com/knightedcodemonkey/develop
67+
## Try It
6668

67-
## Notes For Publishing
69+
- Live IDE: https://knightedcodemonkey.github.io/develop/
70+
- Source: https://github.com/knightedcodemonkey/develop
6871

69-
If you post this on Medium (or similar), include a short screen recording that shows:
72+
If you are curious, start by toggling:
7073

71-
- switching style modes (CSS -> Modules -> Less -> Sass),
72-
- toggling ShadowRoot on and off, and
73-
- immediate preview updates while typing.
74+
1. DOM -> React render mode
75+
2. CSS -> Modules -> Less -> Sass style mode
76+
3. ShadowRoot on/off
7477

75-
That visual sequence communicates the Compiler-as-a-Service model faster than any architecture diagram.
78+
That sequence tells the story better than any architecture diagram.

docs/next-steps.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,16 @@
22

33
Focused follow-up work for `@knighted/develop`.
44

5-
1. **In-browser lint rules review and expansion**
6-
- Review the currently active Biome lint configuration in `src/modules/lint-diagnostics.js`, including rule groups, severities, and any custom suppression behavior.
7-
- Produce a recommended rule profile for component and style linting that balances signal quality with playground ergonomics.
8-
- Evaluate additional Biome rules to enable (or elevate severity) for:
9-
- correctness and suspicious patterns in component code,
10-
- accessibility and style consistency in JSX output,
11-
- CSS quality checks for style sources currently supported by Biome.
12-
- Revisit existing exceptions (for example unused App/View/render bindings) and document clear criteria for when suppression is acceptable.
13-
- Add/update regression coverage for the chosen rule profile in Playwright so diagnostics button/drawer behavior remains stable as rules evolve.
14-
- Document the finalized lint rule strategy in project docs so contributors can reason about why each rule is enabled, disabled, or downgraded.
15-
- Suggested implementation prompt:
16-
- "Audit the current Biome lint rules used by `@knighted/develop`, propose and apply a refined rule profile for component/styles linting, and add/update Playwright coverage to keep diagnostics UX stable under the new rules. Preserve intentional suppressions only when justified and document the reasoning. Validate with `npm run lint`, `npm run build:esm`, and targeted lint diagnostics Playwright tests."
17-
18-
2. **In-browser component type checking**
19-
- Prioritize first-run performance improvements in CDN/type graph hydration (request ordering, cache reuse, and avoiding redundant fetches) before deeper host refactors.
20-
- Continue improving warm-run typecheck performance for large sources while keeping the preview loop non-blocking.
21-
22-
3. **In-browser component testing**
5+
1. **In-browser component testing**
236
- Explore authoring and running component-focused tests in-browser (for example, a Vitest-compatible flow) using CDN-delivered tooling.
247
- Define a lightweight test UX that supports writing tests, running them on demand, and displaying results in-app.
258

26-
4. **CDN failure recovery UX**
9+
2. **CDN failure recovery UX**
2710
- Detect transient CDN/module loading failures and surface a clear recovery action in-app.
2811
- Add a user-triggered retry path (for example, Reload page / Force reload) when runtime bootstrap imports fail.
2912
- Consider an optional automatic one-time retry before showing recovery controls, while avoiding infinite reload loops.
3013

31-
5. **Deterministic E2E lane in CI**
14+
3. **Deterministic E2E lane in CI**
3215
- Add an integration-style E2E path that uses locally served/pinned copies of CDN runtime dependencies for test execution, while keeping production runtime behavior unchanged.
3316
- Keep the current true CDN-backed E2E path as a separate smoke check, but make the deterministic lane the required gate for pull requests.
3417
- Run this deterministic E2E suite on **every pull request** in CI.

0 commit comments

Comments
 (0)