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/verify-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
pnpm add tailwindcss -w
git restore .
- name: Format
run: pnpm prettier --ignore-path .gitignore --check "**/*.{js,cjs,mjs,jsx,ts,tsx,css,scss,html,json,md,yml,yaml}"
run: pnpm prettier --ignore-path .gitignore --check "**/*.{css,scss,html,json,md,mdx,yml,yaml}"

lint-js:
name: Lint JS
Expand Down
14 changes: 7 additions & 7 deletions examples/hatchet/typescript-connectors/connectors/dropbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const listFolder = dropbox.task({
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token.access_token}`,
'Authorization': `Bearer ${token.access_token}`,
},
body: JSON.stringify({
path: '',
Expand All @@ -82,7 +82,7 @@ const listFolder = dropbox.task({
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token.access_token}`,
'Authorization': `Bearer ${token.access_token}`,
},
body: JSON.stringify({
cursor,
Expand Down Expand Up @@ -113,18 +113,18 @@ const enrichEntries = dropbox.task({
const token = await ctx.parentOutput(getAccessToken);
const { entries } = await ctx.parentOutput(listFolder);

const paperFiles = entries.filter((f) => f.name.endsWith('.paper'));
const paperFiles = entries.filter(f => f.name.endsWith('.paper'));
if (paperFiles.length === 0) return entries;

ctx.logger.info(`Retrieving metadata for ${paperFiles.length} files.`);
const response = await fetch(`${baseUrl}/2/sharing/get_file_metadata/batch`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token.access_token}`,
'Authorization': `Bearer ${token.access_token}`,
},
body: JSON.stringify({
files: paperFiles.map((f) => f.path_lower),
files: paperFiles.map(f => f.path_lower),
}),
});

Expand Down Expand Up @@ -159,7 +159,7 @@ dropbox.task({
const token = await ctx.parentOutput(getAccessToken);
const { entries } = await ctx.parentOutput(enrichEntries);

const paperFiles = entries.filter((f) => f.name.endsWith('.paper'));
const paperFiles = entries.filter(f => f.name.endsWith('.paper'));
if (paperFiles.length === 0) return;

for (let i = 0; i < paperFiles.length; i++) {
Expand All @@ -169,7 +169,7 @@ dropbox.task({
const response = await fetch(`https://content.dropboxapi.com/2/files/export`, {
method: 'POST',
headers: {
Authorization: `Bearer ${token.access_token}`,
'Authorization': `Bearer ${token.access_token}`,
'Dropbox-API-Arg': JSON.stringify({
path: file.path_lower,
export_format: 'markdown',
Expand Down
6 changes: 3 additions & 3 deletions examples/node/basics/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ async function main() {
const [u2] = await measure(usingReadStream);
const [u3] = await measure(usingSharedBuffer);

const t1 = u1.map((u) => u.arrayBuffers / 1_000_000);
const t2 = u2.map((u) => u.arrayBuffers / 1_000_000);
const t3 = u3.map((u) => u.arrayBuffers / 1_000_000);
const t1 = u1.map(u => u.arrayBuffers / 1_000_000);
const t2 = u2.map(u => u.arrayBuffers / 1_000_000);
const t3 = u3.map(u => u.arrayBuffers / 1_000_000);

console.log(
asciichart.plot([t1, t2, t3], {
Expand Down
4 changes: 2 additions & 2 deletions examples/react/server-rendering/scripts/bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ export const options = {
};

const urls = {
vite: 'http://127.0.0.1:3000',
'vite': 'http://127.0.0.1:3000',
'vite-stream': 'http://127.0.0.1:3000',
'next-pages': 'http://127.0.0.1:3000',
'next-app': 'http://127.0.0.1:3000/app',
tss: 'http://127.0.0.1:3000',
'tss': 'http://127.0.0.1:3000',
};

export default function bench() {
Expand Down
2 changes: 1 addition & 1 deletion examples/react/server-rendering/vite/server-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ server.on('request', async function (req, res) {

let renderStream;
if (isDevelopment) {
await new Promise((resolve) => vite.middlewares(req, res, resolve));
await new Promise(resolve => vite.middlewares(req, res, resolve));

template = await fs.readFile(path.resolve(import.meta.dirname, 'index.html'), 'utf8');
template = await vite.transformIndexHtml(url, template);
Expand Down
2 changes: 1 addition & 1 deletion examples/react/server-rendering/vite/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ server.on('request', async function (req, res) {

let render;
if (isDevelopment) {
await new Promise((resolve) => vite.middlewares(req, res, resolve));
await new Promise(resolve => vite.middlewares(req, res, resolve));

template = await fs.readFile(path.resolve(import.meta.dirname, 'index.html'), 'utf8');
template = await vite.transformIndexHtml(url, template);
Expand Down
13 changes: 4 additions & 9 deletions examples/tanstack/start-solid/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@ export default function babel(api) {

return {
plugins: [
[
'@stylexjs/babel-plugin',
{
debug: process.env.NODE_ENV === 'development',
unstable_moduleResolution: {
type: 'commonJS',
},
},
],
['@stylexjs/babel-plugin', {
debug: process.env.NODE_ENV === 'development',
unstable_moduleResolution: { type: 'commonJS' },
}],
],
parserOpts: {
plugins: ['jsx', 'typescript'],
Expand Down
1 change: 0 additions & 1 deletion examples/tanstack/start-solid/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import-x/no-extraneous-dependencies */
import stylex from '@stylexjs/postcss-plugin';
import autoprefixer from 'autoprefixer';

Expand Down
2 changes: 1 addition & 1 deletion examples/tanstack/start-solid/src/StaleClosures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function Signals() {
<div ref={timed_log_ref}>Timed Log: </div>
<div ref={log_ref}>Log: </div>
<div class="mt-1 flex gap-2">
<button onClick={() => set_count((prev) => prev + 1)} {...stylex.props(button_styles.base)}>
<button onClick={() => set_count(prev => prev + 1)} {...stylex.props(button_styles.base)}>
Increment
</button>
<button onClick={handle_click} {...stylex.props(button_styles.base)}>
Expand Down
4 changes: 2 additions & 2 deletions examples/tanstack/start-solid/src/TransitionSignal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ function TransitionSignal() {
const [pending, start_transition] = useTransition();

const handle_click = () => {
set_page((prev) => prev + 1);
set_page(prev => prev + 1);

start_transition(() => {
set_page_slow((prev) => prev + 1);
set_page_slow(prev => prev + 1);
});
};

Expand Down
13 changes: 4 additions & 9 deletions examples/tanstack/start/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@ export default function babel(api) {

return {
plugins: [
[
'@stylexjs/babel-plugin',
{
debug: process.env.NODE_ENV === 'development',
unstable_moduleResolution: {
type: 'commonJS',
},
},
],
['@stylexjs/babel-plugin', {
debug: process.env.NODE_ENV === 'development',
unstable_moduleResolution: { type: 'commonJS' },
}],
],
parserOpts: {
plugins: ['jsx', 'typescript'],
Expand Down
1 change: 0 additions & 1 deletion examples/tanstack/start/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import-x/no-extraneous-dependencies */
import stylex from '@stylexjs/postcss-plugin';
import autoprefixer from 'autoprefixer';

Expand Down
4 changes: 2 additions & 2 deletions examples/tanstack/start/src/Gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const sections = [
label: 'List Virtualization',
children: [
{ to: '/list-virt-fixed-height', label: 'Fixed Height' },
{ to: '/list-virt-fixed-height?variant=content-visibility', label: 'Fixed Height with Content Visibility' }, // prettier-ignore
{ to: '/list-virt-fixed-height?variant=content-visibility', label: 'Fixed Height with Content Visibility' },
{ to: '/list-virt-dynamic-height', label: 'Dynamic Height with uwrap' },
{ to: '/list-virt-dynamic-height?wrap=canvas-hypertxt', label: 'Dynamic Height with canvas-hypertxt' }, // prettier-ignore
{ to: '/list-virt-dynamic-height?wrap=canvas-hypertxt', label: 'Dynamic Height with canvas-hypertxt' },
],
},
{
Expand Down
8 changes: 4 additions & 4 deletions examples/tanstack/start/src/StaleClosures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function DependencyArray() {
<div ref={logRef}>Log:</div>
<div ref={logStaleRef}>Log - Stale:</div>
<div className="mt-1 flex gap-2">
<button onClick={() => setCount((prev) => prev + 1)} {...stylex.props(button_styles.base)}>
<button onClick={() => setCount(prev => prev + 1)} {...stylex.props(button_styles.base)}>
Increment
</button>
<button onClick={handleClick} {...stylex.props(button_styles.base)}>
Expand Down Expand Up @@ -103,7 +103,7 @@ function EffectEvents() {
<div>Count: {count}</div>
<div ref={timedLogRef}>Timed Log:</div>
<div className="mt-1 flex gap-2">
<button onClick={() => setCount((prev) => prev + 1)} {...stylex.props(button_styles.base)}>
<button onClick={() => setCount(prev => prev + 1)} {...stylex.props(button_styles.base)}>
Increment
</button>
</div>
Expand Down Expand Up @@ -133,7 +133,7 @@ function RefSync() {
}, []);

const handleIncrement = useCallback(() => {
setCount((prev) => prev + 1);
setCount(prev => prev + 1);
countRef.current += 1;
}, []);

Expand Down Expand Up @@ -205,7 +205,7 @@ function useStateRef<T>(value: T): [React.RefObject<T>, (newState: T) => void] {
if (Object.is(ref.current, newState)) return;

ref.current = newState;
forceRender((prev) => !prev);
forceRender(prev => !prev);
}

return [ref, setState];
Expand Down
4 changes: 2 additions & 2 deletions examples/tanstack/start/src/TransitionRedux.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function TransitionRedux() {
}

function SettingsPanel() {
const page = useAppSelector((state) => state.posts.page);
const page = useAppSelector(state => state.posts.page);

const dispatch = useAppDispatch();

Expand All @@ -57,7 +57,7 @@ function SettingsPanel() {
}

const Posts = function Posts() {
const page = useAppSelector((state) => state.posts.page_slow);
const page = useAppSelector(state => state.posts.page_slow);

return (
<div className="mt-4">
Expand Down
12 changes: 6 additions & 6 deletions examples/tanstack/start/src/TransitionUseContextSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ function TransitionUseContextSelector() {
}

function SettingsPanel() {
const page = useContextSelector(Context, (v) => v.page);
const set_page = useContextSelector(Context, (v) => v.set_page);
const set_page_slow = useContextSelector(Context, (v) => v.set_page_slow);
const page = useContextSelector(Context, v => v.page);
const set_page = useContextSelector(Context, v => v.set_page);
const set_page_slow = useContextSelector(Context, v => v.set_page_slow);

const update = useContextUpdate(Context);

const [is_pending, start_transition] = useTransition();

const handle_click = () => {
set_page((prev) => prev + 1);
set_page(prev => prev + 1);

start_transition(() => {
update(() => {
set_page_slow((prev) => prev + 1);
set_page_slow(prev => prev + 1);
});
});
};
Expand All @@ -55,7 +55,7 @@ function SettingsPanel() {
}

const Posts = function Posts() {
const page = useContextSelector(Context, (v) => v.page_slow);
const page = useContextSelector(Context, v => v.page_slow);

return (
<div className="mt-4">
Expand Down
4 changes: 2 additions & 2 deletions examples/tanstack/start/src/TransitionUseSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ function TransitionSearch() {

const handle_click = () => {
navigate({
search: (prev) => ({ page: (Number(prev.page) + 1).toString() }),
search: prev => ({ page: (Number(prev.page) + 1).toString() }),
});

start_transition(() => {
set_page_slow((prev) => (prev ? prev + 1 : 1));
set_page_slow(prev => (prev ? prev + 1 : 1));
});
};

Expand Down
4 changes: 2 additions & 2 deletions examples/tanstack/start/src/TransitionUseState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ function TransitionUseState() {
const [is_pending, start_transition] = useTransition();

const handle_click = () => {
set_page((prev) => prev + 1);
set_page(prev => prev + 1);

start_transition(() => {
set_page_slow((prev) => prev + 1);
set_page_slow(prev => prev + 1);
});
};

Expand Down
14 changes: 7 additions & 7 deletions examples/tanstack/start/src/TransitionZustand.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ interface SettingsPanelProps {
}

function SettingsPanel({ store }: SettingsPanelProps) {
const page = store((state) => state.page);
const set_page = store((state) => state.set_page);
const set_page_slow = store((state) => state.set_page_slow);
const page = store(state => state.page);
const set_page = store(state => state.set_page);
const set_page_slow = store(state => state.set_page_slow);

const [is_pending, start_transition] = useTransition();

Expand Down Expand Up @@ -59,7 +59,7 @@ interface PostsProps {
}

const Posts = function Posts({ store }: PostsProps) {
const page = store((state) => state.page_slow);
const page = store(state => state.page_slow);

return (
<div className="mt-4">
Expand Down Expand Up @@ -90,10 +90,10 @@ interface State {
}

const create_store = () => {
return create<State>((set) => ({
return create<State>(set => ({
page: 1,
page_slow: 1,
set_page: () => set((state) => ({ page: state.page + 1 })),
set_page_slow: () => set((state) => ({ page_slow: state.page_slow + 1 })),
set_page: () => set(state => ({ page: state.page + 1 })),
set_page_slow: () => set(state => ({ page_slow: state.page_slow + 1 })),
}));
};
8 changes: 4 additions & 4 deletions examples/tanstack/start/src/external-stores/Redux.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ function Redux() {
function Counter() {
const dispatch = useAppDispatch();

const loading = useAppSelector((state) => state.counter.loading);
const count = useAppSelector((state) => state.counter.value);
const loading = useAppSelector(state => state.counter.loading);
const count = useAppSelector(state => state.counter.value);

return (
<div className="mx-2 my-1">
Expand Down Expand Up @@ -85,7 +85,7 @@ function decrement(): CounterAction {

function increment_async() {
return async (dispatch: AppDispatch) => {
await new Promise((resolve) => setTimeout(resolve, 500));
await new Promise(resolve => setTimeout(resolve, 500));
dispatch(increment_by_amount(2));
};
}
Expand All @@ -96,7 +96,7 @@ function increment_async_a() {
dispatch(increment_by_amount(1));

try {
await new Promise((resolve) => setTimeout(resolve, 500));
await new Promise(resolve => setTimeout(resolve, 500));
dispatch({ type: INCREMENT_FULFILLED, payload: 1 });
} catch {
dispatch({ type: INCREMENT_REJECTED });
Expand Down
Loading