Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macro nodes #78

Merged
merged 9 commits into from
Jan 4, 2024
Merged

macro nodes #78

merged 9 commits into from
Jan 4, 2024

Conversation

GabiGrin
Copy link
Contributor

@GabiGrin GabiGrin commented Dec 31, 2023

This PR adds support for a new type of Node - the Macro

Macro nodes address 2 issues:

  1. the only way to pass configuration to a node was using an input pin. While this makes Flyde flexible and powerful, has everything is a dynamic "argument", this approach was not ergonomic and caused nodes to be cluttered with static values.
  2. Nodes with different structures (i.e. inputs/outputs) had to be separated, although they had very similar purposes. For example, Round Robin 2, and Round Robin 3, both "round robin" values, with the only difference in the amount of outputs, had to be duplicated. This caused the stdlib to be bloated with many duplicates. It works great for textual languages such as Haskell, but we can leverage better UI for such controls when moving to a visual paradigm
    Another great example is the "Switch" node - nowadays, it requires the user to feed a value, and individual cases, all as inputs. With macro nodes, the user can configure the amount of cases needed, and receive a dynamic number of outputs based on the cases inputed.

Authors of a macro node can provide a custom React component that will be in charge of rendering UI control for the macro's value. The UI control should be bundled using the example webpack config and will be dynamically loaded into the flyde editor once the macro node is edited.

Macro node will also enable dropping the "Inline value" support in core, and move it out to the user-world, in the standard library, which is another nice win.

@GabiGrin GabiGrin merged commit 6604db4 into main Jan 4, 2024
1 check passed
@GabiGrin GabiGrin deleted the macro-nodes branch January 4, 2024 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant