{"id":13605605,"url":"https://github.com/fabiospampinato/flimsy","last_synced_at":"2025-04-10T02:20:11.305Z","repository":{"id":57749275,"uuid":"524419194","full_name":"fabiospampinato/flimsy","owner":"fabiospampinato","description":"A single-file \u003c1kb min+gzip simplified implementation of the reactive core of Solid, optimized for clean code.","archived":false,"fork":false,"pushed_at":"2024-02-07T23:02:51.000Z","size":54,"stargazers_count":191,"open_issues_count":1,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T02:20:06.207Z","etag":null,"topics":["reactivity","simple","solid","tiny"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabiospampinato.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-08-13T14:18:30.000Z","updated_at":"2025-02-14T22:45:36.000Z","dependencies_parsed_at":"2024-01-14T06:19:59.049Z","dependency_job_id":"649116db-fc7c-47b0-83bb-d1f32d60fb10","html_url":"https://github.com/fabiospampinato/flimsy","commit_stats":{"total_commits":14,"total_committers":3,"mean_commits":4.666666666666667,"dds":0.1428571428571429,"last_synced_commit":"b14b547d3a47d241b5dd674e3596378db3087272"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fflimsy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fflimsy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fflimsy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fflimsy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiospampinato","download_url":"https://codeload.github.com/fabiospampinato/flimsy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142990,"owners_count":21054688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["reactivity","simple","solid","tiny"],"created_at":"2024-08-01T19:01:00.682Z","updated_at":"2025-04-10T02:20:11.281Z","avatar_url":"https://github.com/fabiospampinato.png","language":"TypeScript","funding_links":[],"categories":["Uncategorized","State Managers"],"sub_categories":["Uncategorized","Signals"],"readme":"# Flimsy\n\nA single-file \u003c1kb min+gzip simplified implementation of the reactive core of [`Solid`](https://www.solidjs.com), optimized for clean code.\n\nCheck out the [annotated source](/src/flimsy.annotated.ts), if you'd like to more in depth understand how `Solid` works, or if you'd like to write something similar yourself, this should be a good starting point for you.\n\n## Comparison\n\nCompared to how `Solid`'s reactivity system actually works there are the following (known) differences:\n\n- \"Only\" these functions are implemented: `createSignal`, `createEffect`, `createMemo`, `createRoot`, `createContext`, `useContext`, `getOwner`, `runWithOwner`, `onCleanup`, `onError`, `batch` and `untrack`.\n- `createSignal`'s setter doesn't give you the current updated value inside a batch, but instead gives you the same value that the getter would give you.\n- `createEffect` doesn't schedule effects, they are executed immediately just like memos. In `Solid` they are scheduled _if_ they exist inside a root.\n- `createEffect` and `createMemo` don't pass the previous execution's return value to your function, just put the value in a variable outside of the function yourself to remember it, if you need that.\n- `createContext` gives you `get`/`set` functions instead of a `Provider` component, as the `Provider` component only really makes sense in a UI context and `Solid` doesn't expose a lower-level context primitive.\n- `createContext`'s `set` function will register the context value with the parent observer, so you need to create a custom parent observer yourself (which is basically what `Provider` does), if you need that.\n- `Flimsy` uses a [`MobX`](https://github.com/mobxjs/mobx)-like propagation algorithm, where computations in the reactive graph are marked stale/ready, `Solid` should work similarly, but I don't understand it well enough to know what the differences may be.\n- `Flimsy` doesn't care about performance nor memory usage, it instead optimizes for clean code.\n- `Flimsy` is probably buggier, hence the name, though if you report a bug I'll look into it.\n- `Solid`'s reactivity system doesn't do anything on the server by default, you'll have to explicitly use the browser build to make it work, `Flimsy` is isomorphic.\n\n## Install\n\n```sh\nnpm install --save flimsy\n```\n\n## Usage\n\nYou should be able to use these functions pretty much just like you would use `Solid`'s, for example:\n\n```ts\nimport {createSignal, createEffect, createMemo} from 'flimsy';\n\n// Make a counter, a memo from the counter, and log both in an effect\n\nconst [count, setCount] = createSignal ( 0 );\n\nconst double = createMemo ( () =\u003e count () * 2 );\n\ncreateEffect ( () =\u003e {\n\n  console.log ( 'count', count () );\n  console.log ( 'double', double () );\n\n});\n```\n\n## License\n\nMIT © Fabio Spampinato\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fflimsy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiospampinato%2Fflimsy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fflimsy/lists"}