Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Compatibility #73

Open
DrSensor opened this issue Jul 15, 2023 · 1 comment
Open

Syntax Compatibility #73

DrSensor opened this issue Jul 15, 2023 · 1 comment
Labels
meta thread Spec and Draft but in several comments. Mostly this kind of issue are locked to keep it clean.

Comments

@DrSensor
Copy link
Owner

DrSensor commented Jul 15, 2023

Templating

✅ HTML
✅ XHTML
❌ JSX (JavaScript)
❌ templ (Go) 1
❔ Laravel Blade (PHP)
✅ Django (Python)
✅ ERB (Ruby)
html/template (Hugo|Go) 2
❌ WebC (11ty|JavaScript)
✅ Tera (Zola|Rust)
✅ Eta / EJS (JavaScript)
✅ Liquid
✅ Jinja / Nunjucks / ...
✅ Svelte (JavaScript)
❌ Vue (JavaScript)
❔ Astro (JavaScript)
❔ Angular (JavaScript)

Processor

✅ Lambda Soup (Soupault|OCaml)
❔ parse5 (JavaScript)
✅ lxml (Python)
❔ lol-html (Rust, HTMLRewriter|JavaScript)

Workaround

  • Vue: namespace mode
  • JSX: namespace mode
  • WebC: prefix mode? 🤔
  • Laravel Blade: most likely work on native mode 🤔
  • html/template: most likely work on native mode but it's best to use namespace mode [^1]

Footnotes

  1. Currently templ only support attr with prefix @ _ : a-z (source). Looking at their git history, seems they open for changes 🤔

  2. Go standard html templating sanitize attribute value except attribute name with namespace or data- prefix. The sanitizer may break the micro-syntax. For example, .value="prop.count~>my.count" may transform into .value="prop.count~>my.count" 🤔

@DrSensor DrSensor added the meta thread Spec and Draft but in several comments. Mostly this kind of issue are locked to keep it clean. label Jul 15, 2023
@DrSensor
Copy link
Owner Author

DrSensor commented Sep 23, 2023

This has been in my mind and I think I will settle on this idea.

Make the attribute-prefix configurable!

<script type=attrprefix>{
  "propAttr": "this.",
  "justAttr": "attr:",
  "toggleAttr": "!",
  "listener": "on:",
  "builtin": "#",
  "marker": "~",
  "bakedin": "-"
}</script>

Alternatively use inbuilt prefixset

<script src="//esm.run/nusa/prefixset/laravel-blade" async></script>
<script src="//esm.run/nusa" defer></script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta thread Spec and Draft but in several comments. Mostly this kind of issue are locked to keep it clean.
Projects
None yet
Development

No branches or pull requests

1 participant