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

fix(types): remove slow types #3147

Merged
merged 1 commit into from
Jul 16, 2024
Merged
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
4 changes: 2 additions & 2 deletions src/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export const compose = <C extends ComposeContext, E extends Env = Env>(
middleware: [[Function, unknown], ParamIndexMap | Params][],
onError?: ErrorHandler<E>,
onNotFound?: NotFoundHandler<E>
) => {
return (context: C, next?: Function) => {
): ((context: C, next?: Function) => Promise<C>) => {
return (context, next) => {
let index = -1
return dispatch(0)

Expand Down
3 changes: 2 additions & 1 deletion src/jsx/dom/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Provide hooks used only in jsx/dom
*/

import type { Context } from '../../context'
import { useContext } from '../../context'
import { createContext } from '../context'
import { useCallback, useState } from '../../hooks'
Expand All @@ -20,7 +21,7 @@ type FormStatus =
method: 'get' | 'post'
action: string | ((formData: FormData) => void | Promise<void>)
}
export const FormContext = createContext<FormStatus>({
export const FormContext: Context<FormStatus> = createContext<FormStatus>({
pending: false,
data: null,
method: null,
Expand Down
2 changes: 1 addition & 1 deletion src/jsx/dom/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ const findChildNodeIndex = (
return
}

const cancelBuild = Symbol()
const cancelBuild: symbol = Symbol()
const applyNodeObject = (node: NodeObject, container: Container): void => {
const next: Node[] = []
const remove: Node[] = []
Expand Down
7 changes: 5 additions & 2 deletions src/jsx/intrinsic-element/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,8 @@ const formActionableElement = (
}
return newJSXNode(tag, props)
}
export const input = (props: PropsWithChildren) => formActionableElement('input', props)
export const button = (props: PropsWithChildren) => formActionableElement('button', props)

export const input: (props: PropsWithChildren) => unknown = (props) =>
formActionableElement('input', props)
export const button: (props: PropsWithChildren) => unknown = (props) =>
formActionableElement('button', props)