Functional reactive UI library

Overview

reflex NPM version Build Status Gitter styled with prettier

Reflex is a functional reactive UI library that is heavily inspired by (pretty much is a port of) elm and it's amazingly simple yet powerful architecture where "flux" in react terms is simply a byproduct of a pattern. In order to keep a major attraction of elmalgebraic data types & type safety — the library uses flow, a static type checker for JS. All types are separated from implementation though, so it's your call if you want to take advantage of it or just ignore it.

The library is designed such that view drivers (react, virtual-dom & possibly more in the future) can be swapped without any changes to the application code base. In fact there is not a built-in view driver, so it's up to the user to choose one. In fact it's pretty easy to write a driver that would directly manipulate DOM.

Install

npm install reflex

Examples

For examples check out examples directory of either virtual-dom or react drivers, in fact examples are identical only diff is one line which is path of imported driver.

Comments
  • Implementation of component

    Implementation of component

    Implementation of the component notion that we drafted yesterday. In addition I also changed few things here and there as they seemed to make more sense, like having accumulated state instead of dummy hash of changes.

    I also realized that at the moment component has no clue how to create view of itself, or rather how to create a container for it's nested entities. Either way I'm leaving this out for now.

    opened by Gozala 17
  • Example of time widget

    Example of time widget

    We talked yesterday about how great it is to have a central app-state stream, one of the most exciting things about it was an ability to buffer updates and state snapshots so that you could interactively manipulate timeline. Well we should do it! We should make a timeline widget that does exactly that, to show off how easy and great it is.

    It should be pretty simple to implement too, it will just take an app state as an argument, and keep buffer of last n deltas when slider moves, inverse delta will be pushed to the app state that's all about it. Maybe it should even have a save /load button to let you save it in form of JSON or load in that form.

    opened by Gozala 8
  • Version 0.4

    Version 0.4

    Overview of the changes

    1. Fix regression introduced by 4e13b24 & ba21bbb that cause misbehaviors on synchronous tasks.
    2. Factor out requestAnimationFrame scheduler from Effects library and expose it via tasks instead. Having it part of Effects did not really made much sense.
    3. Renamed Effects.task(task) to Effects.perform(task) as former was pretty confusing.
    4. Changed API for creating cancellable tasks so they won't perform extra allocations on execution. Most relevant for requestAnimationFrame task that are used a lot during animations.
    5. Change class hierarchies to avoid passing own methods to super calls.
    6. Add Task.prototype.recover API so that task failures can more efficiently & intuitively be translated to error actions.
    opened by Gozala 6
  • Bundled, minified distribution without node dependency?

    Bundled, minified distribution without node dependency?

    Is it possible to create a bundled flat file that you can link in with a simple <script> tag? The goal would be to avoid Node/babel dependency for development.

    opened by gordonbrander 6
  • Create API for an app state

    Create API for an app state

    As outlined yesterday at #mozspace

    At the core of everything is a central stream "app state" to which you can pipe inputs and fork from off to get an updates!

    API needs to provide consumers with: previousState, currentState and delta, ideally it will be a stream of current state. That way reduction on it will provide consumer with previousState as an accumulated value and currentState as an item to be accumulated. With that app-state will be just a regular stream with all the composeability benefits of all other streams.

    opened by Gozala 6
  • Implement expample of ractor for a item collection

    Implement expample of ractor for a item collection

    Create a reactor component for the collection of items, where state model is:

    {
       "id1": { "text": "foo" },
       "id2": { "text": "bar" }
    }
    

    Text of the item should be editable, patching the app state.

    Maybe also create sortable list, and filterable list.

    opened by Gozala 5
  • Create `widget` function for creating widgets

    Create `widget` function for creating widgets

    reflex should have a function for defining interactive, self contained widgets, that take input source and produce stream of changes. Probably we need some way of creating nested widgets too!

    opened by Gozala 5
  • node() does not support namespacing for SVG elements

    node() does not support namespacing for SVG elements

    The node function interface used by Reflex and Reflex drivers does not allow setting a namespace. virtual-dom and our VirtualNode class both support namespaces via a namespace property. (I don't really care about namespaces from an aesthetic standpoint, but they are required for svg elements to work).

    opened by gordonbrander 4
  • Streaming reflex

    Streaming reflex

    I'm iterating on the ideas of what the basic components of reflex are.

    For simplicity and speed I've implemented the ideas using streams instead of reducers. They will be merged eventually.

    I'll document parts that I've written

    Written

    Todo

    Merge ideas into reflex

    opened by Raynos 4
  • Effects.batch should complain if it doesn't get called with an array

    Effects.batch should complain if it doesn't get called with an array

    Currently calling Effects.batch(Effect, Effect, Effect) will fail silently. We should make this accidental call an exception or otherwise notify the developer.

    opened by gordonbrander 3
  • Is it production ready yet ?

    Is it production ready yet ?

    I came across this framework while searching for FRP JS frameworks such as Cycle.js, Mercury.js etc. Just wanted to know is this library production ready yet ? Does it have all features of elm-lang ? If it is not complete, would there be any breaking changes in upcoming version ?

    opened by corporatepiyush 3
  • Bump qs from 6.4.0 to 6.4.1

    Bump qs from 6.4.0 to 6.4.1

    Bumps qs from 6.4.0 to 6.4.1.

    Changelog

    Sourced from qs's changelog.

    6.4.1

    • [Fix] parse: ignore __proto__ keys (#428)
    • [Fix] fix for an impossible situation: when the formatter is called with a non-string value
    • [Fix] use safer-buffer instead of Buffer constructor
    • [Fix] utils.merge: avoid a crash with a null target and an array source
    • [Fix] utils.merge`: avoid a crash with a null target and a truthy non-array source
    • [Fix] stringify: fix a crash with strictNullHandling and a custom filter/serializeDate (#279)
    • [Fix] utils: merge: fix crash when source is a truthy primitive & no options are provided
    • [Fix] when parseArrays is false, properly handle keys ending in []
    • [Robustness] stringify: avoid relying on a global undefined (#427)
    • [Refactor] use cached Array.isArray
    • [Refactor] stringify: Avoid arr = arr.concat(...), push to the existing instance (#269)
    • [readme] remove travis badge; add github actions/codecov badges; update URLs
    • [Docs] Clarify the need for "arrayLimit" option
    • [meta] fix README.md (#399)
    • [meta] Clean up license text so it’s properly detected as BSD-3-Clause
    • [meta] add FUNDING.yml
    • [actions] backport actions from main
    • [Tests] remove nonexistent tape option
    • [Dev Deps] backport from main
    Commits
    • 486aa46 v6.4.1
    • 727ef5d [Fix] parse: ignore __proto__ keys (#428)
    • cd1874e [Robustness] stringify: avoid relying on a global undefined (#427)
    • 45e987c [readme] remove travis badge; add github actions/codecov badges; update URLs
    • 90a3bce [meta] fix README.md (#399)
    • 9566d25 [Fix] fix for an impossible situation: when the formatter is called with a no...
    • 74227ef Clean up license text so it’s properly detected as BSD-3-Clause
    • 35dfb22 [actions] backport actions from main
    • 7d4670f [Dev Deps] backport from main
    • 0485440 [Fix] use safer-buffer instead of Buffer constructor
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump path-parse from 1.0.5 to 1.0.7

    Bump path-parse from 1.0.5 to 1.0.7

    Bumps path-parse from 1.0.5 to 1.0.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump hosted-git-info from 2.5.0 to 2.8.9

    Bump hosted-git-info from 2.5.0 to 2.8.9

    Bumps hosted-git-info from 2.5.0 to 2.8.9.

    Changelog

    Sourced from hosted-git-info's changelog.

    2.8.9 (2021-04-07)

    Bug Fixes

    2.8.8 (2020-02-29)

    Bug Fixes

    • #61 & #65 addressing issues w/ url.URL implmentation which regressed node 6 support (5038b18), closes #66

    2.8.7 (2020-02-26)

    Bug Fixes

    • Do not attempt to use url.URL when unavailable (2d0bb66), closes #61 #62
    • Do not pass scp-style URLs to the WhatWG url.URL (f2cdfcf), closes #60

    2.8.6 (2020-02-25)

    2.8.5 (2019-10-07)

    Bug Fixes

    • updated pathmatch for gitlab (e8325b5), closes #51
    • updated pathmatch for gitlab (ffe056f)

    2.8.4 (2019-08-12)

    ... (truncated)

    Commits
    • 8d4b369 chore(release): 2.8.9
    • 29adfe5 fix: backport regex fix from #76
    • afeaefd chore(release): 2.8.8
    • 5038b18 fix: #61 & #65 addressing issues w/ url.URL implmentation which regressed nod...
    • 7440afa chore(release): 2.8.7
    • 2d0bb66 fix: Do not attempt to use url.URL when unavailable
    • f2cdfcf fix: Do not pass scp-style URLs to the WhatWG url.URL
    • e1b83df chore(release): 2.8.6
    • ff259a6 Ensure passwords in hosted Git URLs are correctly escaped
    • 624fd6f chore(release): 2.8.5
    • Additional commits viewable in compare view
    Maintainer changes

    This version was pushed to npm by nlf, a new releaser for hosted-git-info since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump lodash from 4.17.15 to 4.17.21

    Bump lodash from 4.17.15 to 4.17.21

    Bumps lodash from 4.17.15 to 4.17.21.

    Commits
    • f299b52 Bump to v4.17.21
    • c4847eb Improve performance of toNumber, trim and trimEnd on large input strings
    • 3469357 Prevent command injection through _.template's variable option
    • ded9bc6 Bump to v4.17.20.
    • 63150ef Documentation fixes.
    • 00f0f62 test.js: Remove trailing comma.
    • 846e434 Temporarily use a custom fork of lodash-cli.
    • 5d046f3 Re-enable Travis tests on 4.17 branch.
    • aa816b3 Remove /npm-package.
    • d7fbc52 Bump to v4.17.19
    • Additional commits viewable in compare view
    Maintainer changes

    This version was pushed to npm by bnjmnt4n, a new releaser for lodash since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump y18n from 3.2.1 to 3.2.2

    Bump y18n from 3.2.1 to 3.2.2

    Bumps y18n from 3.2.1 to 3.2.2.

    Commits
    Maintainer changes

    This version was pushed to npm by oss-bot, a new releaser for y18n since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump ini from 1.3.4 to 1.3.7

    Bump ini from 1.3.4 to 1.3.7

    Bumps ini from 1.3.4 to 1.3.7.

    Commits
    Maintainer changes

    This version was pushed to npm by isaacs, a new releaser for ini since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(1.1.0)
  • 1.1.0(Jul 3, 2017)

    Upgrade to [email protected]

    Switched to flow syntax

    New version no longer uses flow comment and separate .js.flow files for interface definitions. Instead interface definitions have moved to same named .js files and standard type syntax is used for type annotations.

    Switched to never type

    [email protected] introduced empty as a "bottom type" that actually does what our custom Never type used to do. This release removes Never in favor of empty.

    Better code coverage

    In this release flow code coverage has being greatly improved so expect a lot more errors cough than in older versions.

    Driver interface moved to reflex-driver

    In this release driver interface got greatly simplified to reduce requirements for the driver implementer. In addition built-in driver got replaced by one that just throws exception if used, this would make sure that built-in driver isn't used initially and then re-rendered with actual driver. This implies that you can't create nodes outside of the view function, but given that it greatly simplifies API we decided it was worth it. If you do happen to create nodes outside of regular application loop, you still can do that but instead you'd have to create those with a actual driver instead of API exposed by reflex.

    node got renamed to element

    In the past reflex referred to elements nodes as nodes and to nodes as virtual nodes it also enforced very specific interface for every node type. In this release reflex no longer distinguishes between node types, but functions node got renamed to element for more clarity.

    A Farewell to FRP

    In this release we're finally catching up with Elm making signals unnecessary (Linked article does a great job explaining why). In this release reflex no longer has notion of signals and all of the associated constructs had being removed.

    Simpler application bootstrap

    Removal of signals required a breaking API change as signal subscriptions used to be a way to wire DOM and Effect drivers:

    import {init, update, view} from "./main"
    import {start, Effects} from "reflex"
    import {Renderer} from "reflex-virtual-dom-driver"
    
    const rederer = new Renderer({ target: document.body })
    const app = start({ init, update, view })
    app.view.subscribe(renderer.address)
    app.task.subscribe(Effects.driver(app.address))
    

    API that replaced it is as follows:

    import {init, update, view} from "./main"
    import {start, Task} from "reflex"
    import {Renderer} from "reflex-virtual-dom-driver"
    
    const rederer = new Renderer({ target: document.body })
    const app = start({ init, update, view }, ({view, task}) => {
      renderer.render(view)
      Task.perform(task)
    })
    

    Experimental support for subscriptions

    This release contains experimental and undocumented support for subscriptions which were a major missing piece from Elm. Unlike subscriptions Elm, reflex will have no special "effect manager" modules that get wired up at compile time, instead there will be notion of services that have API somewhat similar to application (but without view) that components will be able to subscribe to. For this reason we'll take few more cycles to iron out the API before finalizing it. So if you want to play and provide feedback, feel free otherwise wait until they're fully baked.

    Source code(tar.gz)
    Source code(zip)
  • 0.4.1(May 18, 2016)

  • 0.4.0(May 10, 2016)

    1. Fix regression introduced by 4e13b24 & ba21bbb that cause misbehaviors on synchronous tasks.
    2. Factor out requestAnimationFrame scheduler from Effects library and expose it via tasks instead. Having it part of Effects did not really made much sense.
    3. Renamed Effects.task(task) to Effects.perform(task) as former was pretty confusing.
    4. Changed API for creating cancellable tasks so they won't perform extra allocations on execution. Most relevant for requestAnimationFrame task that are used a lot during animations.
    5. Change class hierarchies to avoid passing own methods to super calls.
    6. Add Task.prototype.recover API so that task failures can more efficiently & intuitively be translated to error actions.
    Source code(tar.gz)
    Source code(zip)
  • 0.3.1(Apr 19, 2016)

  • 0.3.0(Apr 19, 2016)

    This version introduced performance optimizations:

    1. Now Task scheduler is no longer implemented in pure functional style as number of allocations caused by it was in top 5 for browser.html code base. Instead now forking a task creates a mutable Process instance that attempts to do almost no allocations while stepping through tasks.
    2. Several code paths used try / finally blocks which hit unoptimized path on spider-monkey. Use of try / catch on the other hand is optimized, there for with this change we should hit the optimized path.

    Breaking API changes

    1. Now Task.create is deprecated in favor of new Task
    2. Task.fork(task) now returns Process instance (it used return void)
    3. Now execute in new Task(execute) may return an abort function which scheduler may use to abort running task.
    Source code(tar.gz)
    Source code(zip)
  • 0.1.1(Jul 3, 2017)

    What's new

    Migration to [email protected] proper

    While back library started using flow type checker, but opted into via comment style annotations. At this point it made little sense to continue using commented syntax if anything it just made things more difficult for no benefit.

    Factoring out driver

    Interface definition between reflex and it's drivers has being part of reflex library itself, but that only made things difficult as driver implementations had to depend on reflex itself & update every time thing changed there. By factoring driver interface into own package allows for less frequent synchronization requirements between reflex & it's drivers.

    Driver interface has also being simplified greatly. Reflex used to over-specify structure of the nodes but that provided no benefit for increased complexity. Now drivers have much looser interface & are able to represent node implementations as they're pleased.

    A Farewell to FRP

    Catching up with Elm's removing signals. Signals were always internal implementation details except they were used to bootstrap application event loops:

    Before

    import {init, update, view} from "./app"
    import {start, Effects} from "reflex"
    import {Renderer} from "reflex-virtual-dom-driver"
    
    const renderer = new Renderer({target:document.body})
    const app = start({init, update, view, flags:null})
    
    app.view.subscribe(renderer.address)
    app.task.subscribe(Effects.driver(app.address))
    

    After

    import {init, update, view} from "./app"
    import {start, Task} from "reflex"
    import {Renderer} from "reflex-virtual-dom-driver"
    
    const renderer = new Renderer({target:document.body})
    const app = start({init, update, view, flags:null}, ({view, task}) => {
      renderer.render(view)
      Task.perform(task)
    })
    

    Experimental support of subscriptions has also being added, but for now they're not documented as the API is not fully fleshed out, but you can look at the source & start playing around with them if you like.

    Breaking changes

    Startup API has changed

    Before

    import {init, update, view} from "./app"
    import {start, Effects} from "reflex"
    import {Renderer} from "reflex-virtual-dom-driver"
    
    const renderer = new Renderer({target:document.body})
    const app = start({init, update, view, flags:null})
    
    app.view.subscribe(renderer.address)
    app.task.subscribe(Effects.driver(app.address))
    

    After

    import {init, update, view} from "./app"
    import {start, Task} from "reflex"
    import {Renderer} from "reflex-virtual-dom-driver"
    
    const renderer = new Renderer({target:document.body})
    const app = start({init, update, view, flags:null}, ({view, task}) => {
      renderer.render(view)
      Task.perform(task)
    })
    

    No more signals

    If you used to create your own signals or map / reduce them they are gone, so you'll need to stop doing that.

    No more driver

    If you used reflex driver code you should look at reflex-driver it has being factored out.

    Better type inference

    Before we used to have our own Never type which got replaced by flow built-in empty type, migration will require some work but mostly should be smooth. New flow also catches far more errors and code has being updated to provide better code coverage which means far more errors maybe caught after update.

    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Dec 16, 2015)

  • 0.0.51(Dec 16, 2015)

    Up until now tasks scheduled via Effects used to run sequentially, meaning if one task was blocked next task would not run until first one was complete. With this change each task is spawned concurrently.

    Source code(tar.gz)
    Source code(zip)
  • 0.0.50(Oct 20, 2015)

    • Made significant changes to the (mostly internal) API to have Virtual Node, Text & Thunk types compatible with different drivers.
    • render is called thunk now.
    • application now has view, model, task properties in form of signals that drivers / services can subscribe to do associated IO.
    Source code(tar.gz)
    Source code(zip)
  • 0.0.28(Sep 11, 2015)

    Reflex had issue with hot reloading namely when view function got swapped, reflex would end up generating new Thunk components for those causing react to remount (see facebook/react#4826 for further details).

    This release employees caching for generated Thunk components so that react component types will match up even across code hot swaps (assuming same react is used).

    Source code(tar.gz)
    Source code(zip)
Owner
Mozilla
This technology could fall into the right hands.
Mozilla
Inventory App - a SPA project developed with Angular using Reactive Forms and VMware's Clarity components.

Inventory App - a SPA (Single Page Application) project developed with Angular using Reactive Forms and VMware's Clarity components.

null 11 Oct 5, 2022
Typescript library for functional programming.

Sa Lambda Typescript library for functional programming. Document TODO Either Maybe Iterator Pipe & Flow Task (Promise-Like) some math utils Installat

SoraLib 9 Dec 6, 2022
A functional library for watermarking images in the browser

A functional library for watermarking images in the browser. Written with ES6, and made available to current browsers via Babel. Supports urls, file inputs, blobs, and on-page images.

Brian Scaturro 1.7k Dec 27, 2022
A functional, immutable, type safe and simple dependency injection library inspired by angular.

func-di English | 简体中文 A functional, immutable, type safe and simple dependency injection library inspired by Angular. Why func-di Installation Usage

null 24 Dec 11, 2022
validation-first schema library with a functional api

zap ⚡ zap is a validation-first schema library with a functional Api. Some major features are Flexible refinement and validation API Transformation, C

Spaceteams GmbH 19 Dec 5, 2022
Jargon from the functional programming world in simple terms!

Functional Programming Jargon Functional programming (FP) provides many advantages, and its popularity has been increasing as a result. However, each

hemanth.hm 18.1k Jan 4, 2023
a full functional discord bot to send moomoo.io bots

MooMooBot a discord bot which does moomoo.io stuff commands !send <server> <name> ex: !send 8:0:0 Nuro !token (generates a token to test if there's n

Nuro 4 Jun 1, 2022
Firebase Angular Skeleton - Quickly create an application with a fully functional authentication, authorization and user management system.

FAngS - Firebase Angular Skeleton FAngS lets you quickly create an application with a fully functional authentication, authorization and user manageme

Ryan Lefebvre 7 Sep 21, 2022
A fun and functional way to write regular expressions (RegExp)

funexp A fun and functional way to write regular expressions (RegExp). FunExp is a useful tool for larger projects that depends on RegExp to do heavy

Matheus Giovani 2 Feb 7, 2022
Fun λ functional programming in JS

fp-js JavaScript Functional Programming Motivation This purposed for learning functional programming (just that). Features Auto-Curry Option Tooling s

RiN 6 Feb 4, 2022
A featherweight, functional frontend JS framework

flub.js With inspiration from React and Flutter, flub is a minimal JS framework (core sits little over 1 kB) for quickly prototyping basic JS frontend

Loren Kuich 7 Dec 9, 2022
A repository demonstrating functional techniques with C# 10 and the similarities between JavaScript, TypeScript, and C#.

Building up from JavaScript to TypeScript to C# 10 and .NET 6 This repository is meant to highlight some of the various functional techniques availabl

Charles Chen 67 Dec 30, 2022
This is a (pretty broken, but mostly functional) organic-shaped jigsaw generator with custom border support

OrganicPuzzleJs This is a (pretty broken, but mostly functional) organic-shaped jigsaw generator with custom border support. It relies on two linbrari

null 6 Dec 10, 2022
Functional Programming with NestJS, Prisma. immutable, pure, stateless

Functional-NestJS Functional Programming with NestJS, Prisma. immutable, pure, stateless. 1. Introduction A production ready typescript backend reposi

y0on2q 40 Dec 6, 2022
🤠 Functional utilities using object property paths with wildcards and regexps 🌵

?? Functional utilities using object property paths with wildcards and regexps. ?? Available functional methods include: ??️ Mapping: map() ?? Merging

ehmicky 29 Dec 15, 2022
A RabbitMQ client for TypeScript, with functional programming in mind.

RabbitMQ-fp Lets feed our Rabbit' nicely ?? This repository contains a wrapper over amqplib written in Typescript with an accent of functionnal progra

MansaGroup 3 Sep 6, 2022
This is a fully functional DAO, a Web3 project made using Solidity, Hardhat, JS, Next.js, Openzeppelin, CSS, HTML, using the Rinkerby network!

My First DAO! This is made for a DAO-Tutorial via learnweb3.io This is a DAO, a decentralised autonomous organisation, essentially a more collective a

Kell (K42) 3 Jun 20, 2022
A utility for creating toggleable items with JavaScript. Inspired by bootstrap's toggle utility. Implemented in vanillaJS in a functional style.

LUX TOGGLE Demo: https://jesschampion.github.io/lux-toggle/ A utility for creating toggleable dom elements with JavaScript. Inspired by bootstrap's to

Jess Champion 2 Oct 3, 2020
Collection of benchmarks of functional programming languages and proof assistants.

Functional Benchmarks This repository contains a collection of benchmarks of functional programming languages and proof assistants. It is split in two

null 22 Dec 12, 2022