quidproquo-web-react 0.1.15 → 0.1.17

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
@@ -1,13 +1,41 @@
1
- # quidproquo
1
+ # quidproquo-web-react
2
2
 
3
- JS Library for building web servers using pure functions and generators.
3
+ React bindings for [quidproquo](https://github.com/qpqjs/quidproquo).
4
4
 
5
- ## tsconfig
5
+ This is what a qpq frontend is built on. It runs the qpq runtime in the browser, so the same kind of stories that run on the server can drive your UI, and it provides the state, auth, and connection plumbing around them.
6
6
 
7
- core for quidproquo library packages ~ Should probably not be used by itself
7
+ ```bash
8
+ npm install quidproquo-web-react
9
+ ```
8
10
 
9
- use `quidproquo`
11
+ React 18 or newer is a peer dependency.
10
12
 
11
- ### Note
13
+ ## What is in here
12
14
 
13
- Currently under development ~ Not for production
15
+ | Area | What it gives you |
16
+ | --- | --- |
17
+ | `runtime` | The browser runtime, wired to the web action processors |
18
+ | `store` | The qpq state store: reference-counted, `set_state` only, with an `onInit` hook on the definition and immediate teardown when the last consumer unmounts |
19
+ | `state` | Effect and reducer wiring for state modules, matching the layout `quidproquo-features` uses |
20
+ | `api` | Typed clients for your service apis |
21
+ | `auth` | Sign in, sign out, tokens, and the auth context |
22
+ | `websocket`, `webSocketQueue` | Live connections, including the ordered, reliable queue |
23
+ | `hooks` | The general-purpose hooks, plus `useFieldBinding` for forms and `useSharedQueryParams` for url-backed state |
24
+ | `qpqContext` | Getting qpq config and service info into your components |
25
+ | `dateTime`, `baseUrl` | Formatting and url resolution consistent with the backend |
26
+
27
+ ## How it fits
28
+
29
+ Frontend state is a fold over dispatched effects, the same shape the backend uses for event documents. Components stay presentational: a handler dispatches an effect or runs a story, a reducer produces the next state, and a selector reads it. Data is fetched in the event handler that needs it, not in an effect that fires after render.
30
+
31
+ ## Status
32
+
33
+ Pre-1.0. The whole `quidproquo-*` family releases in lockstep, so versions that share a number were built and tested together. Expect APIs to move between releases, and pin your versions.
34
+
35
+ ## Documentation
36
+
37
+ [docs.quidproquojs.com](https://docs.quidproquojs.com)
38
+
39
+ ## License
40
+
41
+ MIT. See [LICENSE](https://github.com/qpqjs/quidproquo/blob/main/LICENSE).
@@ -1 +1 @@
1
- {"version":3,"file":"getStateDispatchActionProcessor.js","sourceRoot":"","sources":["../../../../src/runtime/actionProcessor/getStateDispatchActionProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAgJ;AAIhJ,MAAM,uBAAuB,GAC3B,CAAC,QAAuB,EAAqC,EAAE,CAC/D,KAAmB,EAAE,4CAAd,EAAE,MAAM,EAAE;IACf,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEjB,OAAO,IAAA,8BAAY,EAAC,SAAS,CAAC,CAAC;AACjC,CAAC,CAAA,CAAC;AAEG,MAAM,kCAAkC,GAC7C,CAAC,QAAuB,EAA+B,EAAE,CACzD,CAAO,UAAU,EAAE,oBAAoB,EAAgC,EAAE;IAAC,OAAA,CAAC;QACzE,CAAC,iCAAe,CAAC,QAAQ,CAAC,EAAE,uBAAuB,CAAC,QAAQ,CAAC;KAC9D,CAAC,CAAA;EAAA,CAAC;AAJQ,QAAA,kCAAkC,sCAI1C","sourcesContent":["import { ActionProcessorList, ActionProcessorListResolver, actionResult, StateActionType, StateDispatchActionProcessor } from 'quidproquo-core';\n\nimport { Dispatch } from 'react';\n\nconst getProcessStateDispatch =\n (dispatch: Dispatch<any>): StateDispatchActionProcessor<any> =>\n async ({ action }) => {\n dispatch(action);\n\n return actionResult(undefined);\n };\n\nexport const getStateDispatchActionListResolver =\n (dispatch: Dispatch<any>): ActionProcessorListResolver =>\n async (_qpqConfig, _dynamicModuleLoader): Promise<ActionProcessorList> => ({\n [StateActionType.Dispatch]: getProcessStateDispatch(dispatch),\n });\n"]}
1
+ {"version":3,"file":"getStateDispatchActionProcessor.js","sourceRoot":"","sources":["../../../../src/runtime/actionProcessor/getStateDispatchActionProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAQyB;AAIzB,MAAM,uBAAuB,GAC3B,CAAC,QAAuB,EAA6C,EAAE,CACvE,KAAmB,EAAE,4CAAd,EAAE,MAAM,EAAE;IACf,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEjB,OAAO,IAAA,8BAAY,EAAC,SAAS,CAAC,CAAC;AACjC,CAAC,CAAA,CAAC;AAEG,MAAM,kCAAkC,GAC7C,CAAC,QAAuB,EAA+B,EAAE,CACzD,CAAO,UAAU,EAAE,oBAAoB,EAAgC,EAAE;IAAC,OAAA,CAAC;QACzE,CAAC,iCAAe,CAAC,QAAQ,CAAC,EAAE,uBAAuB,CAAC,QAAQ,CAAC;KAC9D,CAAC,CAAA;EAAA,CAAC;AAJQ,QAAA,kCAAkC,sCAI1C","sourcesContent":["import {\n ActionProcessorList,\n ActionProcessorListResolver,\n actionResult,\n askStateDispatchBase,\n createActionProcessor,\n ProcessorFor,\n StateActionType,\n} from 'quidproquo-core';\n\nimport { Dispatch } from 'react';\n\nconst getProcessStateDispatch =\n (dispatch: Dispatch<any>): ProcessorFor<typeof askStateDispatchBase> =>\n async ({ action }) => {\n dispatch(action);\n\n return actionResult(undefined);\n };\n\nexport const getStateDispatchActionListResolver =\n (dispatch: Dispatch<any>): ActionProcessorListResolver =>\n async (_qpqConfig, _dynamicModuleLoader): Promise<ActionProcessorList> => ({\n [StateActionType.Dispatch]: getProcessStateDispatch(dispatch),\n });\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"getStateReadActionProcessor.js","sourceRoot":"","sources":["../../../../src/runtime/actionProcessor/getStateReadActionProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA4I;AAE5I,MAAM,mBAAmB,GACvB,CAAQ,eAA4B,EAAiC,EAAE,CACvE,GAAS,EAAE;IACT,OAAO,IAAA,8BAAY,EAAC,eAAe,EAAE,CAAC,CAAC;AACzC,CAAC,CAAA,CAAC;AAEG,MAAM,8BAA8B,GACzC,CAAQ,eAA4B,EAA+B,EAAE,CACrE,CAAO,UAAU,EAAE,oBAAoB,EAAgC,EAAE;IAAC,OAAA,CAAC;QACzE,CAAC,iCAAe,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC,eAAe,CAAC;KAC7D,CAAC,CAAA;EAAA,CAAC;AAJQ,QAAA,8BAA8B,kCAItC","sourcesContent":["import { ActionProcessorList, ActionProcessorListResolver, actionResult, StateActionType, StateReadActionProcessor } from 'quidproquo-core';\n\nconst getProcessStateRead =\n <State>(getCurrentState: () => State): StateReadActionProcessor<any> =>\n async () => {\n return actionResult(getCurrentState());\n };\n\nexport const getStateReadActionListResolver =\n <State>(getCurrentState: () => State): ActionProcessorListResolver =>\n async (_qpqConfig, _dynamicModuleLoader): Promise<ActionProcessorList> => ({\n [StateActionType.Read]: getProcessStateRead(getCurrentState),\n });\n"]}
1
+ {"version":3,"file":"getStateReadActionProcessor.js","sourceRoot":"","sources":["../../../../src/runtime/actionProcessor/getStateReadActionProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAQyB;AAEzB,MAAM,mBAAmB,GACvB,CAAQ,eAA4B,EAAyC,EAAE,CAC/E,GAAS,EAAE;IACT,OAAO,IAAA,8BAAY,EAAC,eAAe,EAAE,CAAC,CAAC;AACzC,CAAC,CAAA,CAAC;AAEG,MAAM,8BAA8B,GACzC,CAAQ,eAA4B,EAA+B,EAAE,CACrE,CAAO,UAAU,EAAE,oBAAoB,EAAgC,EAAE;IAAC,OAAA,CAAC;QACzE,CAAC,iCAAe,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC,eAAe,CAAC;KAC7D,CAAC,CAAA;EAAA,CAAC;AAJQ,QAAA,8BAA8B,kCAItC","sourcesContent":["import {\n ActionProcessorList,\n ActionProcessorListResolver,\n actionResult,\n askStateReadBase,\n createActionProcessor,\n ProcessorFor,\n StateActionType,\n} from 'quidproquo-core';\n\nconst getProcessStateRead =\n <State>(getCurrentState: () => State): ProcessorFor<typeof askStateReadBase> =>\n async () => {\n return actionResult(getCurrentState());\n };\n\nexport const getStateReadActionListResolver =\n <State>(getCurrentState: () => State): ActionProcessorListResolver =>\n async (_qpqConfig, _dynamicModuleLoader): Promise<ActionProcessorList> => ({\n [StateActionType.Read]: getProcessStateRead(getCurrentState),\n });\n"]}
@@ -1,4 +1,4 @@
1
- import { actionResult, StateActionType } from 'quidproquo-core';
1
+ import { actionResult, StateActionType, } from 'quidproquo-core';
2
2
  const getProcessStateDispatch = (dispatch) => async ({ action }) => {
3
3
  dispatch(action);
4
4
  return actionResult(undefined);
@@ -1 +1 @@
1
- {"version":3,"file":"getStateDispatchActionProcessor.js","sourceRoot":"","sources":["../../../../src/runtime/actionProcessor/getStateDispatchActionProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,YAAY,EAAE,eAAe,EAAgC,MAAM,iBAAiB,CAAC;AAIhJ,MAAM,uBAAuB,GAC3B,CAAC,QAAuB,EAAqC,EAAE,CAC/D,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IACnB,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEjB,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,kCAAkC,GAC7C,CAAC,QAAuB,EAA+B,EAAE,CACzD,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAgC,EAAE,CAAC,CAAC;IACzE,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,uBAAuB,CAAC,QAAQ,CAAC;CAC9D,CAAC,CAAC","sourcesContent":["import { ActionProcessorList, ActionProcessorListResolver, actionResult, StateActionType, StateDispatchActionProcessor } from 'quidproquo-core';\n\nimport { Dispatch } from 'react';\n\nconst getProcessStateDispatch =\n (dispatch: Dispatch<any>): StateDispatchActionProcessor<any> =>\n async ({ action }) => {\n dispatch(action);\n\n return actionResult(undefined);\n };\n\nexport const getStateDispatchActionListResolver =\n (dispatch: Dispatch<any>): ActionProcessorListResolver =>\n async (_qpqConfig, _dynamicModuleLoader): Promise<ActionProcessorList> => ({\n [StateActionType.Dispatch]: getProcessStateDispatch(dispatch),\n });\n"]}
1
+ {"version":3,"file":"getStateDispatchActionProcessor.js","sourceRoot":"","sources":["../../../../src/runtime/actionProcessor/getStateDispatchActionProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAIZ,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAIzB,MAAM,uBAAuB,GAC3B,CAAC,QAAuB,EAA6C,EAAE,CACvE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IACnB,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEjB,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,kCAAkC,GAC7C,CAAC,QAAuB,EAA+B,EAAE,CACzD,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAgC,EAAE,CAAC,CAAC;IACzE,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,uBAAuB,CAAC,QAAQ,CAAC;CAC9D,CAAC,CAAC","sourcesContent":["import {\n ActionProcessorList,\n ActionProcessorListResolver,\n actionResult,\n askStateDispatchBase,\n createActionProcessor,\n ProcessorFor,\n StateActionType,\n} from 'quidproquo-core';\n\nimport { Dispatch } from 'react';\n\nconst getProcessStateDispatch =\n (dispatch: Dispatch<any>): ProcessorFor<typeof askStateDispatchBase> =>\n async ({ action }) => {\n dispatch(action);\n\n return actionResult(undefined);\n };\n\nexport const getStateDispatchActionListResolver =\n (dispatch: Dispatch<any>): ActionProcessorListResolver =>\n async (_qpqConfig, _dynamicModuleLoader): Promise<ActionProcessorList> => ({\n [StateActionType.Dispatch]: getProcessStateDispatch(dispatch),\n });\n"]}
@@ -1,4 +1,4 @@
1
- import { actionResult, StateActionType } from 'quidproquo-core';
1
+ import { actionResult, StateActionType, } from 'quidproquo-core';
2
2
  const getProcessStateRead = (getCurrentState) => async () => {
3
3
  return actionResult(getCurrentState());
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"getStateReadActionProcessor.js","sourceRoot":"","sources":["../../../../src/runtime/actionProcessor/getStateReadActionProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,YAAY,EAAE,eAAe,EAA4B,MAAM,iBAAiB,CAAC;AAE5I,MAAM,mBAAmB,GACvB,CAAQ,eAA4B,EAAiC,EAAE,CACvE,KAAK,IAAI,EAAE;IACT,OAAO,YAAY,CAAC,eAAe,EAAE,CAAC,CAAC;AACzC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,8BAA8B,GACzC,CAAQ,eAA4B,EAA+B,EAAE,CACrE,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAgC,EAAE,CAAC,CAAC;IACzE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC,eAAe,CAAC;CAC7D,CAAC,CAAC","sourcesContent":["import { ActionProcessorList, ActionProcessorListResolver, actionResult, StateActionType, StateReadActionProcessor } from 'quidproquo-core';\n\nconst getProcessStateRead =\n <State>(getCurrentState: () => State): StateReadActionProcessor<any> =>\n async () => {\n return actionResult(getCurrentState());\n };\n\nexport const getStateReadActionListResolver =\n <State>(getCurrentState: () => State): ActionProcessorListResolver =>\n async (_qpqConfig, _dynamicModuleLoader): Promise<ActionProcessorList> => ({\n [StateActionType.Read]: getProcessStateRead(getCurrentState),\n });\n"]}
1
+ {"version":3,"file":"getStateReadActionProcessor.js","sourceRoot":"","sources":["../../../../src/runtime/actionProcessor/getStateReadActionProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAIZ,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,mBAAmB,GACvB,CAAQ,eAA4B,EAAyC,EAAE,CAC/E,KAAK,IAAI,EAAE;IACT,OAAO,YAAY,CAAC,eAAe,EAAE,CAAC,CAAC;AACzC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,8BAA8B,GACzC,CAAQ,eAA4B,EAA+B,EAAE,CACrE,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAgC,EAAE,CAAC,CAAC;IACzE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC,eAAe,CAAC;CAC7D,CAAC,CAAC","sourcesContent":["import {\n ActionProcessorList,\n ActionProcessorListResolver,\n actionResult,\n askStateReadBase,\n createActionProcessor,\n ProcessorFor,\n StateActionType,\n} from 'quidproquo-core';\n\nconst getProcessStateRead =\n <State>(getCurrentState: () => State): ProcessorFor<typeof askStateReadBase> =>\n async () => {\n return actionResult(getCurrentState());\n };\n\nexport const getStateReadActionListResolver =\n <State>(getCurrentState: () => State): ActionProcessorListResolver =>\n async (_qpqConfig, _dynamicModuleLoader): Promise<ActionProcessorList> => ({\n [StateActionType.Read]: getProcessStateRead(getCurrentState),\n });\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-web-react",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -9,6 +9,9 @@
9
9
  "files": [
10
10
  "lib/**/*"
11
11
  ],
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
12
15
  "scripts": {
13
16
  "test": "echo \"Error: no test specified\" && exit 1",
14
17
  "clean": "npx rimraf lib && npx rimraf node_modules",
@@ -22,31 +25,31 @@
22
25
  },
23
26
  "repository": {
24
27
  "type": "git",
25
- "url": "git+https://github.com/joe-coady/quidproquo.git"
28
+ "url": "git+https://github.com/qpqjs/quidproquo.git"
26
29
  },
27
30
  "keywords": [],
28
31
  "author": "",
29
32
  "license": "MIT",
30
33
  "bugs": {
31
- "url": "https://github.com/joe-coady/quidproquo/issues"
34
+ "url": "https://github.com/qpqjs/quidproquo/issues"
32
35
  },
33
- "homepage": "https://github.com/joe-coady/quidproquo#readme",
36
+ "homepage": "https://github.com/qpqjs/quidproquo#readme",
34
37
  "devDependencies": {
35
38
  "@testing-library/dom": "^10.4.1",
36
39
  "@testing-library/react": "^16.3.2",
37
- "quidproquo-core": "0.1.15",
38
- "quidproquo-tsconfig": "0.1.15",
40
+ "quidproquo-core": "0.1.17",
41
+ "quidproquo-tsconfig": "0.1.17",
39
42
  "typescript": "^5.8.2"
40
43
  },
41
44
  "peerDependencies": {
42
45
  "react": ">=18.3.1"
43
46
  },
44
47
  "dependencies": {
45
- "quidproquo-actionprocessor-node": "0.1.15",
46
- "quidproquo-actionprocessor-web": "0.1.15",
47
- "quidproquo-features": "0.1.15",
48
- "quidproquo-web": "0.1.15",
49
- "quidproquo-webserver": "0.1.15",
48
+ "quidproquo-actionprocessor-node": "0.1.17",
49
+ "quidproquo-actionprocessor-web": "0.1.17",
50
+ "quidproquo-features": "0.1.17",
51
+ "quidproquo-web": "0.1.17",
52
+ "quidproquo-webserver": "0.1.17",
50
53
  "symbol-observable": "^4.0.0"
51
54
  }
52
55
  }