Skip to content

Commit

Permalink
šŸ«” Retire the old template engine, use jsx solely
Browse files Browse the repository at this point in the history
  • Loading branch information
KimlikDAO-bot committed Dec 27, 2024
1 parent cc09514 commit a060656
Show file tree
Hide file tree
Showing 18 changed files with 8 additions and 423 deletions.
2 changes: 0 additions & 2 deletions kastro/compiler/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ const computeDepHash = (props) => {
* @const {TargetFunction}
*/
const forceBuildTarget = (targetName, props) => {
console.log("forceBuildTarget()", targetName);

populateChildTargets(props);
const targetFunc = getTargetFunction(targetName);
if (!targetFunc) console.error("targetFunc not found", targetName);
Expand Down
261 changes: 0 additions & 261 deletions kastro/compiler/component.js

This file was deleted.

4 changes: 4 additions & 0 deletions kastro/compiler/jsx-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ const resolveProps = (props, lang) => {
for (const key in props)
if (key != "children" && typeof props[key] == "object" && (lang in props[key]))
props[key] = props[key][lang];
else if (key.startsWith("data-")) {
if (key == "data-" + lang) props.children = [props[key]];
delete props[key];
}
return props;
}

Expand Down
4 changes: 2 additions & 2 deletions kastro/compiler/page.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { minify } from "html-minifier";
import { getDir } from "../../util/paths";
import compiler from "./compiler";
import { compileComponent } from "./component";
import HtmlMinifierConfig from "./config/htmlMinifierConfig";
import { initGlobals } from "./pageGlobals";

Expand Down Expand Up @@ -42,7 +41,8 @@ const pageTarget = (targetName, props) => {
props.SharedCss = new Set();
props.PageCss = new Set();
initGlobals(props);
return compileComponent("ana", {}, props)
return import(`${targetName.slice(7, -5)}.jsx`)
.then((jsx) => jsx.default(props))
.then((html) => getStyleSheets(targetName, props).then((styleSheets) => {
html = "<!DOCTYPE html>" + html.replace("</head>", styleSheets + "</head>");
return props.BuildMode == 0
Expand Down
4 changes: 0 additions & 4 deletions kastro/compiler/test/ana/image.svg

This file was deleted.

Empty file removed kastro/compiler/test/ana/sayfa.css
Empty file.
33 changes: 0 additions & 33 deletions kastro/compiler/test/ana/sayfa.html

This file was deleted.

5 changes: 0 additions & 5 deletions kastro/compiler/test/birim/cĆ¼zdan/birim.html

This file was deleted.

17 changes: 0 additions & 17 deletions kastro/compiler/test/birim/jsxcomp/comp.jsx

This file was deleted.

Empty file.
Empty file.
5 changes: 0 additions & 5 deletions kastro/compiler/test/birim/kpass/birim.html

This file was deleted.

23 changes: 0 additions & 23 deletions kastro/compiler/test/birim/logo.svg

This file was deleted.

Loading

0 comments on commit a060656

Please sign in to comment.