hazelgrove / hazel

Hazel, a live functional programming environment with typed holes
http://hazel.org/
MIT License
684 stars 45 forks source link

Editor Componentization #1297

Open Negabinary opened 2 months ago

Negabinary commented 2 months ago

Editor Componentization

Warning: this is a huge change to the Haz3lweb portion of the codebase. I've tried to provide a guide below for merging this into your branch.

Motivation:

The goal of this refactor is to turn Haz3lWeb into a tree of re-usable, independent components. There is both a short-term, and long-term motivation to do this.

image

In the short-term, being able to re-use the editors, and statics highlighting in particular will allow us to select / edit outputs. This is important for the interactions that will be in the proof stepper but also for the flexibility to copy results back into code etc.

In the long-term, this componentization gets us closer to good coding practices in the hazel codebase. It creates a separation of concerns where each component can consider only its local state/updates, instead of needing to worry about global state/update.

The Big Changes

Design:

Each component is a file that contains four modules:

Open Bugs:

todo: check that I haven't broken: