Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
name: Benchmarks
needs: build_test
if: ${{ needs.filter_jobs.outputs.jsChanged == 'true' }}
uses: ./.github/workflows/benchmarks.yml
uses: ./.github/workflows/benchmarks.yml
2 changes: 1 addition & 1 deletion .github/workflows/pr-reporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ jobs:
path: results/**/*.json
base-bench-name: preact-main
pr-bench-name: preact-local
summarize: 'duration, usedJSHeapSize'
summarize: 'duration, usedJSHeapSize'
2 changes: 1 addition & 1 deletion .github/workflows/run-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ jobs:
with:
name: ${{ steps.log-artifact-name.outputs.artifact_name }}
path: benchmarks/out/${{ inputs.benchmark }}_logs.tgz
if-no-files-found: ignore
if-no-files-found: ignore
2 changes: 1 addition & 1 deletion .github/workflows/single-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ jobs:
with:
benchmark: ${{ inputs.benchmark }}
trace: ${{ inputs.trace }}
# timeout: ${{ inputs.timeout }}
# timeout: ${{ inputs.timeout }}
2 changes: 1 addition & 1 deletion .github/workflows/size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
# Our `prepare` script already builds the app post-install,
# building it again would be redundant
build-script: 'npm run --if-present noop'
build-script: 'npm run --if-present noop'
46 changes: 46 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"endOfLine": "lf",
"insertFinalNewline": true,
"useTabs": true,
"tabWidth": 2,
"printWidth": 80,
"singleQuote": true,
"jsxSingleQuote": false,
"quoteProps": "as-needed",
"trailingComma": "none",
"semi": true,
"arrowParens": "avoid",
"bracketSameLine": false,
"bracketSpacing": true,
"singleAttributePerLine": false,
"experimentalSortPackageJson": false,
"ignorePatterns": [
"benchmarks/**",
"**/.DS_Store",
"**/node_modules",
"**/npm-debug.log",
"**/dist",
"*/package-lock.json",
"**/yarn.lock",
"**/.vscode",
"**/.idea",
"test/ts/**/*.js",
"**/coverage",
"**/*.sw[op]",
"**/*.log",
"**/package/",
"**/preact-*.tgz",
"**/preact.tgz",
"**/package-lock.json"
],
"overrides": [
{
"files": ["*.json", ".*rc", "*.yml"],
"options": {
"useTabs": false,
"tabWidth": 2
}
}
]
}
50 changes: 0 additions & 50 deletions biome.json

This file was deleted.

26 changes: 14 additions & 12 deletions compat/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,23 @@ declare namespace React {
export function startTransition(cb: () => void): void;

// HTML
export interface HTMLAttributes<T extends EventTarget>
extends JSXInternal.HTMLAttributes<T> {}
export interface HTMLAttributes<
T extends EventTarget
> extends JSXInternal.HTMLAttributes<T> {}
export interface HTMLProps<T extends EventTarget>
extends JSXInternal.AllHTMLAttributes<T>,
preact.ClassAttributes<T> {}
export interface AllHTMLAttributes<T extends EventTarget>
extends JSXInternal.AllHTMLAttributes<T> {}
extends JSXInternal.AllHTMLAttributes<T>, preact.ClassAttributes<T> {}
export interface AllHTMLAttributes<
T extends EventTarget
> extends JSXInternal.AllHTMLAttributes<T> {}
export import DetailedHTMLProps = JSXInternal.DetailedHTMLProps;
export import CSSProperties = JSXInternal.CSSProperties;

export interface SVGProps<T extends EventTarget>
extends JSXInternal.SVGAttributes<T>,
preact.ClassAttributes<T> {}
extends JSXInternal.SVGAttributes<T>, preact.ClassAttributes<T> {}

interface SVGAttributes<T extends EventTarget = SVGElement>
extends JSXInternal.SVGAttributes<T> {}
interface SVGAttributes<
T extends EventTarget = SVGElement
> extends JSXInternal.SVGAttributes<T> {}

interface ReactSVG extends JSXInternal.IntrinsicSVGElements {}

Expand Down Expand Up @@ -260,8 +261,9 @@ declare namespace React {
displayName?: string;
}

export interface ForwardRefExoticComponent<P>
extends preact.FunctionComponent<P> {
export interface ForwardRefExoticComponent<
P
> extends preact.FunctionComponent<P> {
defaultProps?: Partial<P> | undefined;
}

Expand Down
6 changes: 4 additions & 2 deletions compat/src/internal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ export interface SuspenseState {
_suspended?: null | VNode<any>;
}

export interface SuspenseComponent
extends PreactComponent<SuspenseProps, SuspenseState> {
export interface SuspenseComponent extends PreactComponent<
SuspenseProps,
SuspenseState
> {
_pendingSuspensionCount: number;
_suspenders: Component[];
_detachOnNextRender: null | VNode<any>;
Expand Down
2 changes: 1 addition & 1 deletion compat/test/browser/forwardRef.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,5 +509,5 @@ describe('forwardRef', () => {
const Forwarded = forwardRef(Foo);

expect(Forwarded.render).to.equal(Foo);
});
});
});
2 changes: 1 addition & 1 deletion compat/test/ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
}
},
"include": ["./**/*.ts", "./**/*.tsx"]
}
}
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
4 changes: 3 additions & 1 deletion demo/people/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@
background-size: 10000%;
content: '';
opacity: 0;
transition: opacity 700ms, background 300ms;
transition:
opacity 700ms,
background 300ms;
}

> nav li > a:active::after {
Expand Down
8 changes: 6 additions & 2 deletions demo/people/styles/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
font-weight: 600;
letter-spacing: 0.08em;
text-transform: uppercase;
transition: background 300ms, color 200ms;
transition:
background 300ms,
color 200ms;
white-space: nowrap;
}

Expand Down Expand Up @@ -56,7 +58,9 @@
background-size: 20000%;
content: '';
opacity: 0;
transition: opacity 700ms, background 400ms;
transition:
opacity 700ms,
background 400ms;
}

button:active:not(:disabled)::after {
Expand Down
4 changes: 3 additions & 1 deletion demo/people/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@
height: var(--spinner-size);
animation: zoom 250ms 500ms forwards ease-out;
opacity: 0;
transition: opacity 200ms, transform 200ms ease-in;
transition:
opacity 200ms,
transform 200ms ease-in;
}

.spinner.exit {
Expand Down
8 changes: 6 additions & 2 deletions demo/style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
html,
body {
font: 14px system-ui, sans-serif;
font:
14px system-ui,
sans-serif;
}
.list {
list-style: none;
Expand All @@ -13,7 +15,9 @@ body {
}
@keyframes fadeIn {
0% {
box-shadow: inset 0 0 2px 2px red, 0 0 2px 2px red;
box-shadow:
inset 0 0 2px 2px red,
0 0 2px 2px red;
}
}
.list > .odd {
Expand Down
8 changes: 6 additions & 2 deletions demo/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ body {
height: 100%;
margin: 0;
background: #eee;
font: 400 16px/1.3 'Helvetica Neue', helvetica, sans-serif;
font:
400 16px/1.3 'Helvetica Neue',
helvetica,
sans-serif;
text-rendering: optimizeSpeed;
color: #444;
}
Expand All @@ -16,7 +19,8 @@ body {
> header {
flex: 0;
background: #f9f9f9;
box-shadow: inset 0 -0.5px 0 0 rgba(0, 0, 0, 0.2),
box-shadow:
inset 0 -0.5px 0 0 rgba(0, 0, 0, 0.2),
0 0.5px 0 0 rgba(255, 255, 255, 0.6);

nav {
Expand Down
13 changes: 9 additions & 4 deletions hooks/src/internal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
VNode as PreactVNode,
PreactContext,
HookType,
ErrorInfo,
ErrorInfo
} from '../../src/internal';
import { Reducer, StateUpdater } from '.';

Expand Down Expand Up @@ -32,7 +32,10 @@ export interface ComponentHooks {
_pendingEffects: EffectHookState[];
}

export interface Component extends Omit<PreactComponent<any, any>, '_renderCallbacks'> {
export interface Component extends Omit<
PreactComponent<any, any>,
'_renderCallbacks'
> {
__hooks?: ComponentHooks;
// Extend to include HookStates
_renderCallbacks?: Array<HookState | (() => void)>;
Expand Down Expand Up @@ -80,8 +83,10 @@ export interface MemoHookState<T = unknown> extends BaseHookState {
_factory?: () => T;
}

export interface ReducerHookState<S = unknown, A = unknown>
extends BaseHookState {
export interface ReducerHookState<
S = unknown,
A = unknown
> extends BaseHookState {
_nextValue?: [S, StateUpdater<S>];
_value?: [S, StateUpdater<S>];
_component?: Component;
Expand Down
12 changes: 4 additions & 8 deletions hooks/test/browser/useImperativeHandle.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,10 @@ describe('useImperativeHandle', () => {

function Comp({ a }) {
ref = useRef({});
useImperativeHandle(
ref,
() => {
createHandleSpy();
return { test: () => 'test' + a };
},
[a]
);
useImperativeHandle(ref, () => {
createHandleSpy();
return { test: () => 'test' + a };
}, [a]);
return <p>Test</p>;
}

Expand Down
Loading
Loading