Skip to content

strict ts#190

Merged
seanhess merged 14 commits intoseanhess:mainfrom
fanshi1028:main
Mar 9, 2026
Merged

strict ts#190
seanhess merged 14 commits intoseanhess:mainfrom
fanshi1028:main

Conversation

@fanshi1028
Copy link
Contributor

No description provided.

@seanhess
Copy link
Owner

seanhess commented Feb 9, 2026

@fanshi1028 Thanks for submitting this. Did you run through all the examples to test?

I'm getting a couple Typescript errors on your branch. Can you fix please? Do we have a typescript version mismatch or somethign?

 ➜  hyperbole git:(fanshi1028) cd client
 ➜  client git:(fanshi1028) npx webpack
assets by status 24.4 KiB [cached] 11 assets
orphan modules 31.1 KiB [orphan] 9 modules
cacheable modules 43.5 KiB
  ./src/index.ts + 9 modules 41.2 KiB [built] [code generated]
  ./package.json 381 bytes [built] [code generated]
  ./node_modules/debounce/index.js 2.02 KiB [built] [code generated]

ERROR in /Users/seanhess/code/hyperbole/client/src/events.ts
./src/events.ts 219:11-17
[tsl] ERROR in /Users/seanhess/code/hyperbole/client/src/events.ts(219,12)
      TS2345: Argument of type 'HyperView | undefined' is not assignable to parameter of type 'HyperView'.
  Type 'undefined' is not assignable to type 'HyperView'.
ts-loader-default_e3b0c44298fc1c14
 @ ./src/index.ts 3:0-192 114:4-14 115:4-20 116:4-20 202:4-18 205:4-14 206:4-20 207:4-20 209:4-15 213:4-18 217:4-17 221:4-15 225:4-20 229:4-16 237:4-15

ERROR in /Users/seanhess/code/hyperbole/client/src/index.ts
44:2-17
[tsl] ERROR in /Users/seanhess/code/hyperbole/client/src/index.ts(44,3)
      TS2322: Type 'Timeout' is not assignable to type 'number'.
ts-loader-default_e3b0c44298fc1c14

webpack 5.89.0 compiled with 2 errors in 891 ms

@fanshi1028
Copy link
Contributor Author

@fanshi1028 Thanks for submitting this. Did you run through all the examples to test?

I'm getting a couple Typescript errors on your branch. Can you fix please? Do we have a typescript version mismatch or somethign?

 ➜  hyperbole git:(fanshi1028) cd client
 ➜  client git:(fanshi1028) npx webpack
assets by status 24.4 KiB [cached] 11 assets
orphan modules 31.1 KiB [orphan] 9 modules
cacheable modules 43.5 KiB
  ./src/index.ts + 9 modules 41.2 KiB [built] [code generated]
  ./package.json 381 bytes [built] [code generated]
  ./node_modules/debounce/index.js 2.02 KiB [built] [code generated]

ERROR in /Users/seanhess/code/hyperbole/client/src/events.ts
./src/events.ts 219:11-17
[tsl] ERROR in /Users/seanhess/code/hyperbole/client/src/events.ts(219,12)
      TS2345: Argument of type 'HyperView | undefined' is not assignable to parameter of type 'HyperView'.
  Type 'undefined' is not assignable to type 'HyperView'.
ts-loader-default_e3b0c44298fc1c14
 @ ./src/index.ts 3:0-192 114:4-14 115:4-20 116:4-20 202:4-18 205:4-14 206:4-20 207:4-20 209:4-15 213:4-18 217:4-17 221:4-15 225:4-20 229:4-16 237:4-15

ERROR in /Users/seanhess/code/hyperbole/client/src/index.ts
44:2-17
[tsl] ERROR in /Users/seanhess/code/hyperbole/client/src/index.ts(44,3)
      TS2322: Type 'Timeout' is not assignable to type 'number'.
ts-loader-default_e3b0c44298fc1c14

webpack 5.89.0 compiled with 2 errors in 891 ms

Oops. I just tsc-ed it and didn't even try to build with webpack. But I have just fixed them for webpack build and checked to ensured the demo app's examples do works. Please check again.

Copy link
Owner

@seanhess seanhess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this!

export function listenChange(cb: (target: HyperView, action: string) => void): void {
document.addEventListener("change", function(e) {
let el = e.target as HTMLElement
if (!(e.target instanceof HTMLElement)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. Seems redundant

document.addEventListener("input", function(e) {
let el = e.target as HTMLElement
let source = el.closest("[data-oninput]") as LiveInputElement
if (!(e.target instanceof HTMLElement)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. Seems redundant

export function listenFormSubmit(cb: (target: HyperView, action: string, form: FormData) => void): void {
document.addEventListener("submit", function(e) {
let form = e.target as HTMLFormElement
if (!(e.target instanceof HTMLFormElement)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, seems redundant

@fanshi1028
Copy link
Contributor Author

fanshi1028 commented Mar 7, 2026

@seanhess Please check my replies and changes and tell me what to do next(if any).

@seanhess
Copy link
Owner

seanhess commented Mar 9, 2026

Thanks for your hard work on this!

@seanhess seanhess merged commit 94c7418 into seanhess:main Mar 9, 2026
1 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants