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

feat: solid-primitives-parser #276

Merged
merged 29 commits into from
Jan 27, 2023
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e550600
feat: solid-primitives-parser
bigmistqke Dec 31, 2022
c70d34b
add primitives to list
bigmistqke Jan 2, 2023
86aca9c
createParser to scope $TOKEN, spread meta over token
bigmistqke Jan 3, 2023
bd305e8
tokenize-callback, remove Token-type helper
bigmistqke Jan 4, 2023
a5434d3
warning behind DEV, id to warning, optional 2nd param for component-c…
bigmistqke Jan 4, 2023
8e40c76
parser -> jsx-parser
bigmistqke Jan 4, 2023
5e555e1
tokenize -> createToken
bigmistqke Jan 4, 2023
0f3f90c
add --dev tag to package.json
bigmistqke Jan 4, 2023
9d9a420
rename folder parser -> jsx-parser
bigmistqke Jan 4, 2023
c4ffe61
remove useless map in childrenTokens
bigmistqke Jan 4, 2023
e35fac8
add generic accepted TokenTypes to createJSXParser
bigmistqke Jan 4, 2023
513c3d4
childrenTokens: remove typecast, change returnType
bigmistqke Jan 4, 2023
8a1927b
childrenTokens: memo callback and resolveChild
bigmistqke Jan 4, 2023
52e6468
childrenTokens: support arrays, For, Index
bigmistqke Jan 5, 2023
bd1cfc8
createToken: pass owner to token-callback
bigmistqke Jan 6, 2023
b4857d2
remove owner from tokenProperties
bigmistqke Jan 6, 2023
0bbcd9b
createToken: cache to prevent token remounts
bigmistqke Jan 6, 2023
163903f
createToken: tokenProperties rename tokenCallback
bigmistqke Jan 6, 2023
11148d4
createToken: remove cache
bigmistqke Jan 6, 2023
2176c48
isToken: function to check if value is a token
bigmistqke Jan 7, 2023
3667566
update example, simplify types
bigmistqke Jan 23, 2023
4203f05
write documentation
bigmistqke Jan 23, 2023
b9a6133
update readme solid-primitives
bigmistqke Jan 23, 2023
6334e65
Merge branch 'main' into feat/solid-primitives-parser
thetarnav Jan 26, 2023
2db7a2f
Update lockfile
thetarnav Jan 26, 2023
a0f8f3b
Cleanup jsx-parser
thetarnav Jan 26, 2023
42a1453
Make createJSXParser parameters into options object
thetarnav Jan 26, 2023
dd5e8ad
Improve resolving children, add jsdoc
thetarnav Jan 26, 2023
508826c
jsx-parser: Add basic tests
thetarnav Jan 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/jsx-parser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ export function createJSXParser(id: string = "solid-parser") {
function childrenTokens<T>(children: () => JSXElement | JSXElement[] | T | T[]) {
return createMemo(() =>
children
? ([] as any[])
.concat(children())
.filter(child => child && $TOKEN in child)
.map((a: T) => a as T)
? (([] as any[]).concat(children()).filter(child => child && $TOKEN in child) as T[])
: []
);
}
Expand Down