finds.dev

ming1016/HTN

HTML to Native like swift and objective-c

View on GitHub

★ 494SwiftApache-2.0updated Jul 2018

// the take

HTN is an experimental Swift/Objective-C framework that parses HTML, CSS and JS and renders the result as native iOS views instead of a WebView — the same 'dynamic native UI from markup' idea behind things like React Native or Weex, but driven by actual HTML/CSS source. It's aimed at iOS engineers who want server-driven UI without shipping a web runtime.

It builds its own pipeline from scratch rather than wrapping WebKit: a real HTML tokenizer/tree builder, a CSS parser with its own selector and stylesheet model, and a JS parser built on the babylon AST with a JS-to-Objective-C code generator plus a small OC interpreter and static analyzer. That's a surprisingly complete toy compiler/runtime for anyone curious how HTML-to-native rendering actually works under the hood. It also ships a CLI (HTNCLI) and a visual editor (H5Editor) rather than just a bare library, and flexbox-style layout is implemented directly rather than deferred to a third-party engine.

No commits since mid-2018, so this is roughly eight years unmaintained with no Swift concurrency, SwiftUI, or modern iOS SDK compatibility to speak of. Hand-rolled HTML/CSS/JS parsers almost certainly cover a small, informal subset of each spec rather than anything close to full compliance, so real-world pages or scripts will likely break it in ways that are hard to diagnose. There's no visible test suite for any of the parsing/interpretation layers, which is exactly where silent correctness bugs hide. And architecturally, rendering remotely-fetched HTML/JS through a custom interpreter into native views is a nontrivial attack surface (effectively dynamic code execution) with no mention of sandboxing or input validation.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
494
Forks
45
Language
Swift
License
Apache-2.0
Last commit
13 Jul 2018

// nearby

If HTN isn't quite it.

All repos →