(299) commits
783202c
(v0.14.5)
Vlad
·
2025-06-15
Refactor matcher for correct predicate and action handling (#62) - Brand action creators using a cheap, non-enumerable _starfx property for precise detection. - Refactor matcher logic to clearly separate branded action creators from custom predicates and all other cases. - This ensures only the intended actions are matched, fixes the failing test, and makes the matcher safe for userland/test usage and advanced patterns. - Additionally added matcher.test.ts to outline matcher behavior and edge cases, ensuring future changes remain safe. - Also added index signature to ActionWithPayload to ensure that is compatible with react-redux UnknownAction type [type.ts]
Eric Bower
·
2025-06-06
deno to node (#60) This changes the language runtime from deno to node. The reason for this change is because the target of this library is the browser and node has the best compatibility with it. Further we were running into a bunch of issues with the deno tooling for creating npm packages (e.g. dnt). deno is also pretty good at loading npm packages into its runtime so starting in deno doesn't help us that much. Ultimately there's just a few too many layers in between us and the npm release and at this point deno is not really serving us. --------- Co-authored-by: Vlad <vladmarginean@softwiz.ro>
Vlad
·
2025-04-19
Merge pull request #58 from neurosnap/preview-package-workflow preview package creation on PR
Jacob Bolda
·
2025-01-04
confirm tests assert when run within an generator function (#55) --------- Co-authored-by: Vlad Marginean <vladmarginean@softwiz.ro>
d0a8540
(v0.13.4)
Vlad
·
2024-11-14
feat: support multiple stores registering the same thunk (#51) * feat(thunk): enable multiple stores to register thunks with unique identifiers * refactor(store): remove unused getStoreId function
Vlad
·
2024-10-03
refactor(persist): update persist.ts (#50) Refactor persist.ts to improve code organization and readability. - Add support for transform functions to modify the state before storing and after retrieving from storage. - Implement inbound and outbound transformers to handle state transformations. - Handle errors thrown by transformers and log them to the console. - Use the transformed state when reconciling and persisting the store. - Update persistStoreMdw function to use the transformed state when saving to storage. - Add tests for persist transformers
2a61af0
(v0.13.2)
Eric Bower
·
2024-08-16
fix(thunk): run thunk supervisors immediately on register For whatever reason, dispatching actions to register all the supervisor thunks was too slow and causing a regression with prod systems. This reverts part of the register function to how it used to work. To be more specific, it calls the supervisor functions immediately in a `parallel` call.
Eric Bower
·
2024-08-16
chore(thunk): use `console.warn` instead of `console.error`
6ca0a85
(v0.13.0)
Eric Bower
·
2024-07-30
refactor: enhanced thunk registry system (#44) The current registry system for thunks works like this: - User calls `const thunks = createThunks()` - User creates **all** thunks `const go = thunks.create("go")` - User registers thunks `store.run(thunks.bootup)` However, there's a caveat with this implementation: all thunks must be created before `store.run` is called. Further, since thunks are created at the module-level, if the module that exports those thunks isn't loaded before `thunk.bootup` is called then those thunks are silently ignored. This change will make it so it doesn't matter when a thunk is created, we will "lazy load" it. We still require `store.run(thunks.bootup)` to be called -- because we need access to the store and won't have it when creating a thunk. We are also sending an error whenever a thunk is dispatched without it being registered which should help ensure thunks get properly registered. We also changed the name of `thunks.bootup` to `thunks.register` to make it more clear that this is a registry system.
6313833
(v0.10.0)
Eric Bower
·
2024-03-05
refactor: remove Result.data BREAKING CHANGE: `ctx.json` no longer has a `.data` property
Eric Bower
·
2024-03-04
refactor: merge `starfx/store` into `starfx` (#43) I'm looking for ways to simplify the API in order to make this lib more ergonomic. DEPRECATED: `configureStore` is now `createStore` BREAKING CHANGE: removed `starfx/store`
Eric Bower
·
2024-02-23
feat: clear timers (#41) feat: use `race` from `effection` BREAKING CHANGE: replace `race` with `raceMap`
ed75824
(v0.7.2)
Eric Bower
·
2024-02-23
chore: deprecate `slice.loader` Use `slice.loaders` instead
072dd5b
(v0.7.1)
Eric Bower
·
2024-02-22
fix: reset loader when task is cancelled (#40) This issue happens when: - User runs a task with a loader - Loading is in "loading" state - Task gets halted - Loader does not get cleaned up - Loader stays in "loading" state
e582179
(v0.6.0)
Eric Bower
·
2024-02-07
chore: dont prefix action types BREAKING CHANGE: we removed `@@starfx:` from all action types
Eric Bower
·
2024-02-05
fix(thunk): `toString` must return `type` instead of `name`
Jacob Bolda
·
2024-01-29
ecosystem CI tests (#36) * initial CI setup * fix CI workflow name * consistent CI workflow name with file name * script to symlink and CI workflow update to run build * fix folder name in example dir * try --refresh-lockfile * try with npm * try with --no-lockfile * try with npm including build * npm run build * run as matrix * don't fail fast * skip remove of ./npm/node_modules * do file: install for parcel instead * keep node_modules for parcel * matrix out path chunks * lint fix * another lint fix * fix CI name * install both examples * dynamically pull matching branch * nested folder * quiet script * throw on failed reponse * pass branch * more error context * bad boop * name branch step * lint * build and test examples * remove GITHUB_TOKEN * directly append in script * add logs * dump output * dump output file * dump step * .outputs * lint * really need to fix my local linter * add a bit to the readme * rename .scripts/ to scripts/ * update script references
Eric Bower
·
2024-01-22
refactor: remove `log` (#35) refactor: removed wrapped spawn from take helpers BREAKING CHANGE: take helper fn signatures are different BREAKING CHANGE: no more log or `LogContext`
7fa2483
(v0.5.2)
Eric Bower
·
2024-01-21
fix: parcel bundler import export destructuring For whatever reason, parcel doesn't like that we are importing from "thunk" and exporting at the same time.
531fbae
(v0.4.1)
Eric Bower
·
2024-01-11
refactor(query): better extract types from endpoints - fix(query): pick correct `ApiError` type inside `createApi` - `useCache` will automatically pull success type from endpoint.
9775bca
(v0.3.10)
Eric Bower
·
2024-01-08
fix(loader): dont save derived data inside slice
93fb0c8
(v0.3.3)
Eric Bower
·
2023-12-14
refactor(log): generalize for any logging not just errors
8c23451
(v0.3.0)
Eric Bower
·
2023-12-12
feat(store): `reset` updater to revert store to initialState provided by user
059dd3b
(v0.2.1)
Eric Bower
·
2023-12-01
refactor(store): `slice.table` `empty` is now optional (#28)
Eric Bower
·
2023-12-01
feat(query): thunk and api thunks can simply accept payload (#29)
Eric Bower
·
2023-12-01
feat: `createBatchMdw` for batching store listener events (#22)
4842df8
(v0.0.30)
Eric Bower
·
2023-09-17
refactor(redux): take strat Trying to think about performance considerations with implementation
0ba8393
(v0.0.28)
(v0.0.29)
Eric Bower
·
2023-09-16
refactor(redux): use signal for middleware
e0dffb4
(v0.0.20)
Eric Bower
·
2023-09-15
chore: update deps chore: update `saga-query` changes
e1ff96d
(v0.0.19)
Vlad
·
2023-09-12
refactor(store/slice): rename `obj.patch` to `obj.update`
f2722e4
(v0.0.17)
Eric Bower
·
2023-09-09
Merge pull request #13 from neurosnap/create-table --------- Co-authored-by: Vlad <vladmarginean@softwiz.ro>
Vlad
·
2023-07-29
feat: schema concept Schema is like a database schema: you specify what tables you want and their shape. The goal of this feature is to help users build an immutable data store that resembles a database, with ways to change the data being store as well as query it. New features: - `createSchema` which will generate the `initialState` for `createStore` - `table()` which will create a table slice - `str()` which will create a string slice - `num()` which will create a number slice - `any()` which will create a generic slice with any type - `obj()` which will create an object slice ```ts import { createSchema, configureStore, slice, select } from 'starfx/store'; import { main } from 'starfx'; interface User { id: string; name: string; } const { db, initialState } = createSchema({ users: slice.table<User>({ empty: { id: "", name: "" } }), }); const store = configureStore({ initialState }); main(function*() { yield* schema.update(db.users.add({ "1": { id: "1", name: "bob" } })); const user = yield* select(db.users.selectById, { id: "1" }); }); ```
Eric Bower
·
2023-08-28
Toolkit 2.0 (#11) feat: added `prepareStore()` BREAKING CHANGE: refactored `configureStore()` from `starfx/redux`
cdc5721
(v0.0.11)
Eric Bower
·
2023-07-30
fix: event inside takeEvery can trigger same event (#5) This is a regression from `saga-query`. This is an issue that came up in `redux-saga`. [See ref to original issue.](https://github.com/redux-saga/redux-saga/issues/277) [Discussion in discord](https://discordapp.com/channels/700803887132704931/1108053742835736636)
6d5ec93
(v0.0.10)
Eric Bower
·
2023-07-30
fix: ensure compose mdw returns aggregate `Result` (#6) There was a regression compared to `saga-query` for `createPipe()` where we were swallowing errors in the mdw pipeline. This is largely because we are experimenting with the idea of ensuring all operations inside `starfx` are safe-by-default and return a `Result` instead of `throw`. This effort is a design decision to treat errors-as-data. In order to support safe-by-default inside our `compose()` function, we need to aggregate the `Result` of every mdw call and then attach an aggregate `Result` onto the `ctx` provided to `compose()`. So now we require at least one field to always exist on `ctx` which is `ctx.result` which returns `Result<any[]>`. If an error exists inside the aggregate results, we return it unwrapped as an error. If no error exists in the results then we return a single `Result` with a list of values unwrapped. Here is a test that demonstrates the new behavior: ```ts it(tests, "error inside endpoint mdw", async () => { let called = false; const query = createPipe(); query.use(function* (ctx, next) { yield* next(); if (!ctx.result.ok) { called = true; } }); query.use(query.routes()); const fetchUsers = query.create( `/users`, { supervisor: takeEvery }, function* processUsers() { throw new Error("some error"); }, ); const store = await configureStore({ initialState: { ...createQueryState(), users: {}, }, }); store.run(query.bootup); store.dispatch(fetchUsers()); asserts.assertEquals(called, true); }); ```
a57267b
(v0.0.8)
Eric Bower
·
2023-07-14
refactor: switch default createPipe() supervisor to redux
Eric Bower
·
2023-05-20
feat(query): Data synchronization using a middleware system for front-end apps (#1)