Skip to content

Bump webpack-cli from 4.10.0 to 5.1.0 #25

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

Open
wants to merge 27 commits into
base: noact
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/.agp
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Auto Github Push (AGP)
https://github.com/ms-jpq/auto-github-push

---
2022-12-18 00:46
2023-05-07 01:01
Empty file added excel/index.ts
Empty file.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"sass-loader": "^13",
"ts-loader": "^9",
"webpack": "^5",
"webpack-cli": "^4"
"webpack-cli": "^5"
},
"description": "_",
"devDependencies": {
Expand Down
24 changes: 11 additions & 13 deletions src/noact.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type Props<T> = Partial<Omit<T, "style" | "dataset" | "classList">> & {
style?: Partial<CSSStyleDeclaration>
dataset?: Record<string, string | number>
style?: Extract<Partial<CSSStyleDeclaration>, string>
dataset?: Record<string, string | number | boolean>
txt?: string
}
type E = HTMLElementTagNameMap & Record<string, HTMLElement>
Expand All @@ -12,12 +12,10 @@ export const Render = <T extends keyof E>(tagName: T) => (p: Props<E[T]> = {}, .
const { style = {}, dataset = {}, ..._p } = props
const children = c.filter((c) => c) as NNode[]
const render = ((element?: E[T]) => () => {
if (element) {
return element
}
if (element) return element
const e = (element = document.createElement(tagName))
Object.entries(_p).forEach(([k, v]) => (e[k] = v))
Object.entries(style).forEach(([k, v]) => (e.style[k] = v))
Object.entries(_p).forEach(([k, v]) => ((<any>e)[k] = v))
Object.entries(style).forEach(([k, v]) => ((<any>e.style)[k] = v))
Object.entries(dataset).forEach(([k, v]) => (e.dataset[k] = v as string))
children.forEach((child) => e.append(child()))
return e
Expand All @@ -29,10 +27,10 @@ const patchProps = (prev: NNode, next: NNode) => {
const e = prev()
const { style: pStyle = {}, dataset: pData = {}, ...pProps } = prev.props
const { style: nStyle = {}, dataset: nData = {}, ...nProps } = next.props
Object.entries(pProps).forEach(([k]) => nProps[k] === undefined && (e[k] = undefined))
Object.entries(nProps).forEach(([k, v]) => pProps[k] !== v && (e[k] = v))
Object.entries(pStyle).forEach(([k]) => nStyle[k] === undefined && e.style.removeProperty(k))
Object.entries(nStyle).forEach(([k, v]) => pStyle[k] !== v && (e.style[k] = v))
Object.entries(pProps).forEach(([k]) => (<any>nProps)[k] === undefined && ((<any>e)[k] = undefined))
Object.entries(nProps).forEach(([k, v]) => (<any>pProps)[k] !== v && ((<any>e)[k] = v))
Object.entries(pStyle).forEach(([k]) => (<any>nStyle)[k] === undefined && e.style.removeProperty(k))
Object.entries(nStyle).forEach(([k, v]) => (<any>pStyle)[k] !== v && ((<any>e.style)[k] = v))
Object.entries(pData).forEach(([k]) => nData[k] === undefined && Reflect.deleteProperty(e.dataset, k))
Object.entries(nData).forEach(([k, v]) => pData[k] !== v && (e.dataset[k] = v as string))
}
Expand All @@ -54,7 +52,7 @@ const reconciliate = (prev: NNode, next: NNode): NNode => {
export const NewRNode = (element: HTMLElement, props: Record<string, unknown> = {}, ...children: MaybeNNode[]): NNode =>
Object.assign(() => element, { tagName: element.tagName, props, children: children.filter((c) => c) as NNode[] })

export const NewMountPoint = (root: HTMLElement | ShadowRoot) => {
let prev = NewRNode(root as any)
export const NewMountPoint = (root: HTMLElement) => {
let prev = NewRNode(root)
return (...children: MaybeNNode[]) => (prev = reconciliate(prev, NewRNode(root as any, {}, ...children)))
}
5 changes: 2 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
"removeComments": true,
"sourceMap": true,
"strict": true,
"suppressImplicitAnyIndexErrors": true,
"target": "esnext"
},
"exclude": ["node_modules/**", "dist/**"],
"include": ["**/*.ts", "**/*.mjs"]
"exclude": ["node_modules", "artifacts"],
"include": ["."]
}