Skip to content

Commit

Permalink
More cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdotdesign committed Dec 30, 2023
1 parent 95eb46a commit d031a2a
Show file tree
Hide file tree
Showing 111 changed files with 455 additions and 412 deletions.
1 change: 1 addition & 0 deletions runtime/src/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ export const toArray = (...args) => {
}
};

export const access = (field) => (value) => value[field]
export const identity = (a) => a;
4 changes: 2 additions & 2 deletions spec/compilers2/component_global
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ import {

const
A = () => {
return B("div", {}, [a.value])
return B(`div`, {}, [a.value])
},
b = (c) => {
return c
},
C = () => {
return B("div", {}, [b(`Hello`)])
return B(`div`, {}, [b(`Hello`)])
},
d = D(``),
a = E(() => {
Expand Down
4 changes: 2 additions & 2 deletions spec/compilers2/component_instance_access
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const
const a = E(() => {
return `Instance`
});
return F("div", {})
return F(`div`, {})
},
G = () => {
const
Expand All @@ -66,7 +66,7 @@ const
]
])
};
return F("div", {
return F(`div`, {
"onClick": c
}, [F(D, {
ref: (e) => {
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/component_namespaced_with_style
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { createElement as B } from "runtime";

const
A = () => {
return B("div", {
return B(`div`, {
className: `Ui·Dropdown_base`
}, [`test`])
},
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/component_readonly
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const
A = ({
a = false
}) => {
return B("div", {})
return B(`div`, {})
},
C = () => {
return B(A, {
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/component_with_provider
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ const
},
false
]]);
return F("div", {})
return F(`div`, {})
};

Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ const
},
false
]]);
return H("div", {})
return H(`div`, {})
};
2 changes: 1 addition & 1 deletion spec/compilers2/component_with_provider_and_store
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ const
},
false
]]);
return F("div", {})
return F(`div`, {})
};
2 changes: 1 addition & 1 deletion spec/compilers2/constant_global_component
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ const
},
a = `ASD`,
B = () => {
return C("div", {}, [a])
return C(`div`, {}, [a])
};
2 changes: 1 addition & 1 deletion spec/compilers2/constant_module
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ import { createElement as B } from "runtime";
const
a = `ASD`,
A = () => {
return B("div", {}, [a])
return B(`div`, {}, [a])
};

2 changes: 1 addition & 1 deletion spec/compilers2/constant_store
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ import { createElement as B } from "runtime";
const
a = `ASD`,
A = () => {
return B("div", {}, [a])
return B(`div`, {}, [a])
};

2 changes: 1 addition & 1 deletion spec/compilers2/constant_store_exposed
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ import { createElement as B } from "runtime";
const
a = `ASD`,
A = () => {
return B("div", {}, [a])
return B(`div`, {}, [a])
};
2 changes: 1 addition & 1 deletion spec/compilers2/css_definition
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const A = () => {
};
return _
};
return C("div", {
return C(`div`, {
className: `Main_test`,
style: D([b()])
})
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_font_face
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ component Main {
import { createElement as B } from "runtime";

const A = () => {
return B("div", {
return B(`div`, {
className: `Main_test`
})
};
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_font_face_with_quotes
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ component Main {
import { createElement as B } from "runtime";

const A = () => {
return B("div", {
return B(`div`, {
className: `Main_test`
})
};
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_keyframes
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const A = () => {
};
return _
};
return C("div", {
return C(`div`, {
className: `Main_test`,
style: D([b()])
})
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_media
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const A = () => {
};
return _
};
return C("div", {
return C(`div`, {
className: `Main_test`,
style: D([b()])
})
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_media_with_if
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const A = () => {
}) : null);
return _
};
return B("div", {
return B(`div`, {
className: `Main_test`,
style: C([a()])
})
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_selector
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const A = () => {
};
return _
};
return C("div", {
return C(`div`, {
className: `Main_test`,
style: D([b()])
})
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_selector_multiple
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const A = () => {
};
return _
};
return C("div", {
return C(`div`, {
className: `Main_test`,
style: D([b()])
})
Expand Down
4 changes: 2 additions & 2 deletions spec/compilers2/css_string
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ const A = () => {
};
return _
};
return C("div", {
return C(`div`, {
className: `Main_unicode`,
style: D([b()])
}, [C("span", {})])
}, [C(`span`, {})])
};

.Main_unicode span::after {
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_supports
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const A = () => {
};
return _
};
return C("div", {
return C(`div`, {
className: `Main_test`,
style: D([b()])
})
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_with_ands
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ component Main {
import { createElement as B } from "runtime";

const A = () => {
return B("div", {
return B(`div`, {
className: `Main_test`
})
};
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_with_arguments
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const A = () => {
};
return _
};
return B("div", {
return B(`div`, {
className: `Main_test`,
style: C([a(`red`)])
})
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_with_case
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const A = () => {
]);
return _
};
return C("div", {
return C(`div`, {
className: `Main_test`,
style: D([a()])
})
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_with_else_if
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const A = () => {
}) : null));
return _
};
return C("div", {}, [C("div", {
return C(`div`, {}, [C(`div`, {
className: `Main_base`,
style: D([a(`blue`)])
})])
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_with_if
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const A = () => {
}));
return _
};
return B("div", {
return B(`div`, {
className: `Main_test`,
style: C([a()])
})
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_with_if_and_case
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const A = () => {
}));
return _
};
return C("div", {
return C(`div`, {
className: `Main_test`,
style: D([a()])
})
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_with_if_same_condition
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const A = () => {
}));
return _
};
return B("div", {
return B(`div`, {
className: `Main_test`,
style: C([a()])
})
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/css_with_if_with_interpolation
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const A = () => {
}));
return _
};
return B("div", {
return B(`div`, {
className: `Main_test`,
style: C([a()])
})
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/dce_remove_component_computed_property
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ component Main {
import { createElement as B } from "runtime";

const A = () => {
return B("div", {})
return B(`div`, {})
};
2 changes: 1 addition & 1 deletion spec/compilers2/dce_remove_component_function
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ component Main {
import { createElement as B } from "runtime";

const A = () => {
return B("div", {})
return B(`div`, {})
};
2 changes: 1 addition & 1 deletion spec/compilers2/dce_style
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ component Main {
import { createElement as B } from "runtime";

const A = () => {
return B("div", {})
return B(`div`, {})
};
2 changes: 1 addition & 1 deletion spec/compilers2/destructuring
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const
return F(a, [
[
G(C, H([[
"content",
`content`,
I
]])),
(b) => {
Expand Down
12 changes: 7 additions & 5 deletions spec/compilers2/directives/svg
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ component Main {
import { createElement as B } from "runtime";

const A = () => {
return B("svg", {
dangerouslySetInnerHTML: { __html: `<path d="M24 10h-10v-10h-4v10h-10v4h10v10h4v-10h10z"/>` },
viewBox: "0 0 24 24",
height: "24",
width: "24"
return B(`svg`, {
dangerouslySetInnerHTML: {
__html: `<path d="M24 10h-10v-10h-4v10h-10v4h10v10h4v-10h10z"/>`
},
viewBox: `0 0 24 24`,
height: `24`,
width: `24`
})
};
2 changes: 1 addition & 1 deletion spec/compilers2/field
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ const A = () => {
a: `Hello`,
b: 0
};
return B("div", {})
return B(`div`, {})
};
2 changes: 1 addition & 1 deletion spec/compilers2/for
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const A = () => {
let _i = -1;
for (let a of _1) {
_i++;
_0.push(B("div", {}, [a]))
_0.push(B(`div`, {}, [a]))
};
return _0
})()
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/for_with_index
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const A = () => {
if (!_2) {
continue
};
_0.push(C("div", {}, [a]))
_0.push(C(`div`, {}, [a]))
};
return _0
})()
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/for_with_index_2
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const A = () => {
for (let a of _1) {
_i++;
const b = _i;
_0.push(B("div", {}, [a]))
_0.push(B(`div`, {}, [a]))
};
return _0
})()
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/here_doc_markdown_with_interpolation
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const A = () => {
return B(C, {}, [
B('h2', {}, [`Hello There`]),
B('p', {}, [
B("div", {}, [`Hello`]),
B(`div`, {}, [`Hello`]),
`
`,
`World`,
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/html_attribute_class
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ component Main {
import { createElement as B } from "runtime";

const A = () => {
return B("div", {
return B(`div`, {
className: `something`
})
};
2 changes: 1 addition & 1 deletion spec/compilers2/html_attribute_class_with_style
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ component Main {
import { createElement as B } from "runtime";

const A = () => {
return B("div", {
return B(`div`, {
className: `something` + ` Main_base`
})
};
Expand Down
2 changes: 1 addition & 1 deletion spec/compilers2/html_attribute_html_expression
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const
A = ({
a = null
}) => {
return B("div", {})
return B(`div`, {})
},
C = () => {
return B(A, {
Expand Down
Loading

0 comments on commit d031a2a

Please sign in to comment.