thoughts on extensible custom tags
- Dominant language
- JavaScript
- Stars
- 688
- Forks
- 48
- PR merge metrics
- No merged PRs in 30d
Description
So this may not be in the philosophy of bel, but how/should/can I easily create an extensible module for bel/yoyo (the module I use) that allows for custom tags/props that just render functions.
Here is what I'm thinking:
```
const Button = function (opts) {
return bel`my ${opts.name} button`
}
const Col = function (_yield, opts) {
return bel`
}
const customtagsuse = bel`
`// which is actually just
const customtagsuse = bel`
// or
const customtagsuse2 = bel`
// which is actually
const customtagsuse2 = bel`
```
Kinda reactish, but all it's doing is regexing the string, and replacing it with the element.
I'm thinking of providing a layer to bel.
so something like:
```
var extensible = require("bel-custom")
var bel = extensible(require("bel))
bel.customElements = {"Button": Button}; // sort of thing
```
Any thoughts on design patterns, approaches, potential pitfalls, potential benefits @shama?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.