Skip to content

Commit

Permalink
feat(website): swap to node-inspect-extracted (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerAberbach authored Nov 30, 2024
1 parent 38f6ca9 commit db9edf6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
12 changes: 9 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion website/docs/concepts/concurrent-iterable.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const withLfi = await pipe(
)
console.timeEnd(`with lfi`)
// NOTE: This duration may vary slightly between runs
//=> with lfi: 6011 ms
//=> with lfi: 6000 ms

// Takes 10 seconds! The first item is a bottleneck because `p-map` waits for all callbacks
console.time(`without lfi`)
Expand Down
7 changes: 6 additions & 1 deletion website/docs/recipes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,12 @@ console.log(
//=> 1
//=> 0
// NOTE: This order may change between runs
//=> [ 'kind strawberry', 'humble max', 'great bitsy', 'beautiful tommy' ]
//=> [
//=> 'kind strawberry',
//=> 'humble max',
//=> 'great bitsy',
//=> 'beautiful tommy'
//=> ]
```

## How do I reduce an iterable to more than one result in one pass?
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"lfi": "link:..",
"limit-concur": "^3.0.0",
"monaco-editor": "^0.52.0",
"object-inspect": "^1.13.3",
"node-inspect-extracted": "^3.0.2",
"p-filter": "^4.1.0",
"p-map": "^7.0.2",
"prettier": "^3.4.1",
Expand Down
8 changes: 6 additions & 2 deletions website/src/pages/playground/_helpers/console.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { join, map, pipe } from 'lfi'
import type { ReactElement } from 'react'
import inspect from 'object-inspect'
import { inspect } from 'node-inspect-extracted'
import type { Log } from './use-sandbox.ts'

const Console = ({ logs }: { logs: Log[] }) => {
Expand Down Expand Up @@ -144,7 +144,11 @@ const extractLabel = (args: unknown[]): string => {
const formatArgs = (args: unknown[]): string =>
pipe(
args,
map(arg => (typeof arg === `string` ? arg : inspect(arg, { indent: 2 }))),
map(arg =>
typeof arg === `string`
? arg
: inspect(arg, { breakLength: 50, depth: 5 }),
),
join(` `),
)

Expand Down

0 comments on commit db9edf6

Please sign in to comment.