foxact 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,39 @@
2
2
 
3
3
  # foxact
4
4
 
5
- React Hooks/Utils done right. For browser, SSR, and React Server Components.
5
+ React Hooks/Utils done right. For Browser, SSR, and React Server Components.
6
+
7
+ ## Documentation
8
+
9
+ Under construction.
10
+
11
+ ## Features
12
+
13
+ #### React 18 Safe
14
+
15
+ All hooks and utils are React 18+ Concurrent Rendering resilient.
16
+
17
+ **foxact** strictly follows React best practices, e.g. never read and write ref during the render phase, unlike many other open-sourced React Hooks libraries.
18
+
19
+ You can use **foxact** with `<Suspense />`, `startTransition`, `<OffScreen />` without worrying about app falling apart.
20
+
21
+ #### SSR Friendly
22
+
23
+ Works perfectly with server-side rendering, incremental static generation, and static site generation.
24
+
25
+ Supports [Next.js](https://nextjs.org) (both Pages Directory and App Router), [Waku](https://github.com/dai-shi/waku), [Gatsby](https://www.gatsbyjs.com/), [Remix](https://remix.run/), and [Shopify Hydrogen](https://hydrogen.shopify.dev/).
26
+
27
+ #### Type Safe and Sound
28
+
29
+ Written in TypeScript with TSDocs, supports TypeScript 4.8+.
30
+
31
+ #### Super Lightweight
32
+
33
+ The entire **foxact** library has zero dependencies and is **less than 5 KiB gzipped in sum**. And what's more...
34
+
35
+ #### Fully Tree Shakable
36
+
37
+ Feel free to take what you want from **foxact** without worrying about client bundle size.
6
38
 
7
39
  ## License
8
40
 
@@ -1,5 +1,6 @@
1
1
  import * as react from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
3
 
3
- declare function createContextState<T>(initialState: T): readonly [({ children }: React.PropsWithChildren) => react.JSX.Element, () => T, () => react.Dispatch<react.SetStateAction<T>>];
4
+ declare function createContextState<T>(initialState: T): readonly [({ children }: React.PropsWithChildren) => react_jsx_runtime.JSX.Element, () => T, () => react.Dispatch<react.SetStateAction<T>>];
4
5
 
5
6
  export { createContextState };
@@ -0,0 +1 @@
1
+ "use strict";var e=require("../context-state/index.cjs");require("react/jsx-runtime"),require("client-only"),require("react"),require("../noop/index.cjs"),exports.createContextState=e.createContextState;
@@ -0,0 +1 @@
1
+ export { createContextState } from '@/context-state';
@@ -0,0 +1 @@
1
+ "use strict";var e=require("../context-state/index.js");require("react/jsx-runtime"),require("client-only"),require("react"),require("../noop/index.js"),exports.createContextState=e.createContextState;
@@ -0,0 +1 @@
1
+ export{createContextState}from"../context-state/index.mjs";import"react/jsx-runtime";import"client-only";import"react";import"../noop/index.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foxact",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "React Hooks/Utils done right. For browser, SSR, and React Server Components.",
5
5
  "sideEffects": false,
6
6
  "files": [
@@ -46,6 +46,16 @@
46
46
  },
47
47
  "exports": {
48
48
  "./package.json": "./package.json",
49
+ "./sizes.json": "./sizes.json",
50
+ "./create-context-state": {
51
+ "types": "./create-context-state/index.d.ts",
52
+ "import": {
53
+ "types": "./create-context-state/index.d.ts",
54
+ "default": "./create-context-state/index.mjs"
55
+ },
56
+ "require": "./create-context-state/index.cjs",
57
+ "default": "./create-context-state/index.js"
58
+ },
49
59
  "./context-state": {
50
60
  "types": "./context-state/index.d.ts",
51
61
  "import": {
@@ -82,15 +92,6 @@
82
92
  "require": "./typescript-happy-forward-ref/index.cjs",
83
93
  "default": "./typescript-happy-forward-ref/index.js"
84
94
  },
85
- "./use-clipboard": {
86
- "types": "./use-clipboard/index.d.ts",
87
- "import": {
88
- "types": "./use-clipboard/index.d.ts",
89
- "default": "./use-clipboard/index.mjs"
90
- },
91
- "require": "./use-clipboard/index.cjs",
92
- "default": "./use-clipboard/index.js"
93
- },
94
95
  "./use-array": {
95
96
  "types": "./use-array/index.d.ts",
96
97
  "import": {
@@ -100,6 +101,15 @@
100
101
  "require": "./use-array/index.cjs",
101
102
  "default": "./use-array/index.js"
102
103
  },
104
+ "./use-clipboard": {
105
+ "types": "./use-clipboard/index.d.ts",
106
+ "import": {
107
+ "types": "./use-clipboard/index.d.ts",
108
+ "default": "./use-clipboard/index.mjs"
109
+ },
110
+ "require": "./use-clipboard/index.cjs",
111
+ "default": "./use-clipboard/index.js"
112
+ },
103
113
  "./use-error-boundary": {
104
114
  "types": "./use-error-boundary/index.d.ts",
105
115
  "import": {
package/sizes.json ADDED
@@ -0,0 +1 @@
1
+ {"total":{"raw":5028,"gzip":3341},"exports":{"create-context-state":{"raw":146,"gzip":119},"context-state":{"raw":369,"gzip":240},"noop":{"raw":32,"gzip":52},"request-idle-callback":{"raw":407,"gzip":229},"typescript-happy-forward-ref":{"raw":83,"gzip":91},"use-array":{"raw":329,"gzip":241},"use-clipboard":{"raw":850,"gzip":504},"use-error-boundary":{"raw":172,"gzip":157},"use-intersection":{"raw":1214,"gzip":649},"use-isomorphic-layout-effect":{"raw":177,"gzip":143},"use-map":{"raw":330,"gzip":240},"use-retimer":{"raw":197,"gzip":165},"use-set":{"raw":331,"gzip":236},"use-uncontrolled":{"raw":391,"gzip":275}}}