Skip to content

Commit f4f3ba2

Browse files
committed
bun boys
1 parent bac656c commit f4f3ba2

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

packages/plexus-core/src/computed.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// import { isServer } from "@plexusjs/utils/dist/shared"
21
import {
32
AlmostAnything,
43
PlexusWatchableValueInterpreter,
@@ -71,7 +70,6 @@ export class ComputedStateInstance<
7170
this.mount()
7271
}
7372
private mount() {
74-
// if (isServer()) return
7573
if (!this.instance()._computedStates.has(this)) {
7674
this.instance()._computedStates.add(this)
7775
this.instance().runtime.log(

packages/plexus-core/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"lib": ["dom"],
55
"types": ["bun-types"],
66
"rootDir": "./src",
7-
"outDir": "./dist/src",
7+
"outDir": "./dist",
88
"emitDeclarationOnly": true
99
},
1010
"include": ["./src/**/*"]

packages/plexus-next/src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/// <reference lib="dom" />
2+
/// <reference lib="dom.iterable" />
3+
14
import {
25
instance,
36
PlexusCollectionSelector,
@@ -126,7 +129,9 @@ export function loadServerState(
126129
}
127130

128131
export function isServer() {
129-
return typeof process !== 'undefined' && process?.release?.name === 'node'
132+
return (
133+
typeof process !== 'undefined' && (process.env.SERVER_SOFTWARE || !window)
134+
)
130135
}
131136

132137
const PlexusNext = createPlexusPlugin('NextJS', () => {

packages/plexus-react/src/usePlexusElementEffect.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ type HTMLDivElementPropKeys = keyof HTMLProps<HTMLElement>
1414
export function usePlexusElementEffect<
1515
ElementType extends HTMLElement,
1616
PlexusType = any,
17-
PropertyKey extends HTMLProps<HTMLElement>[HTMLDivElementPropKeys] = HTMLProps<HTMLElement>[HTMLDivElementPropKeys]
17+
PropertyKey extends
18+
HTMLProps<HTMLElement>[HTMLDivElementPropKeys] = HTMLProps<HTMLElement>[HTMLDivElementPropKeys],
1819
>(
1920
elRef: MutableRefObject<ElementType>,
2021
plexusState: Watchable<PlexusType>,

packages/plexus-utils/src/shared/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
/// <reference lib="dom" />
2+
/// <reference lib="dom.iterable" />
3+
14
export * from './itemManipulation'
5+
26
export function isServer() {
3-
return typeof process !== 'undefined' && process?.release?.name === 'node'
7+
return (
8+
typeof process !== 'undefined' && (process.env.SERVER_SOFTWARE || !window)
9+
)
410
}
511
export const genUID = () =>
612
Math.random().toString(36).substring(2, 15) +

0 commit comments

Comments
 (0)