medikoo / domjs Goto Github PK
View Code? Open in Web Editor NEWDOM template engine for client and server
License: MIT License
DOM template engine for client and server
License: MIT License
I compiled(?) this with webmake, but it didn't work.
And it contains too many overhead.
How can I use this for browser?
/cc @mtuchowski
Hi, is there a way for me to add arbitrary custom elements? I like to use semantic tagging and I'd like to be able to do something like:
myCustomElement("content")
--> <my-custom-element>content</my-custom-element>
/cc @kamsi @mtuchowski
At this point DOM generated within templates is auto-magically gathered by domjs internals via collect method.
It was made that way to allow to write templates without need of return [...]
wraps. Still this methods introduces side-effects when we work with non typical domjs element generators e.g. as _if
or
etc. (ones introduced by domjs-ext). They require wrapping their result with insert
function, and that can be confusing to unwary developers, and leads to hard to debug issues if omitted.
We should either resign from that magic or find a solution so it works without need of using insert
in any cases.
After requiring domjs like this:
const domjs = require('domjs/lib/html5')(document);
the global namespace was decorated with constructs such as div
etc. I know this is the intended usage, but I'd still like to be able to use some_namespace.div
, and have domjs not insert div
into the global namespace. This serves two goals:
console.log(some_namespace)
.Right now I use const elem = domjs.map;
for this, but it'd be cool if we had a documented / official method for such a use case.
Hi @medikoo ,
I'm trying to run this in Node and getting:
var domjs = require('domjs/lib/html5')(document);
^
ReferenceError: document is not defined
You say in your README that this will work on the server...how?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.