Skip to content

Instantly share code, notes, and snippets.

View manu-unter's full-sized avatar

Manuel Unterhofer manu-unter

View GitHub Profile
@manu-unter
manu-unter / RSC-Talk.json
Created April 15, 2021 18:34
React Server Components Talk - download and import into https://excalidraw-slides.netlify.app/
[
{
"id": "0.1691686211006762",
"elements": [
{
"type": "text",
"version": 259,
"versionNonce": 1352857840,
"isDeleted": false,
"id": "MZyh7alpYuPh7Mq_CFURb",
@manu-unter
manu-unter / Component-Based Layout and Drawing.md
Last active June 1, 2020 17:40
Thoughts and ideas around possible component-based APIs for layout and drawing in revery (WIP)

Component-Based Layout and Drawing

This is a work in progress and it should serve as a basis for continuing brainstorming and for bouncing ideas with others. The code should be considered pseudocode and it doesn't necessarily compile in ReasonML or any language for that matter.

Assumptions

  • Layout deals with screen space in Cartesian coordinates: x and y, width and height
  • There is a matrix stack which transforms all coordinates prior to drawing. This stack is hidden to the components but it will be used by the renderer to implement layout decisions along the tree.
  • Drawing is done using the painter's algorithm and the target is an immediate medium. The element tree will be drawn following a depth-first traversal strategy, meaning every element will be able to paint over its parents and any siblings that came before itself, along with their children.

Goals

C:\Users\manuhornung\Repositories\skia-msvc-makefiles-ocaml\ocaml>make myapp.exe
cl /nologo /c /I ../esy-skia /I C:\Users\manuhornung\AppData\Roaming\OCamlPro\OCPWin\4.02.1+ocp1-msvc64-20160113\lib skia_stubs.c
skia_stubs.c
ocamlc -c main.mli
ocamlopt -c main.ml
ocamlopt -o myapp.exe main.cmx -ccopt ..\esy-skia\out\Static\skia.lib -ccopt skia_stubs.obj
** Cannot resolve symbols for ..\esy-skia\out\Static\skia.lib(obj/src/core/skia.SkRasterPipeline.obj/
obj/src/core/skia.SkRasterPipelineBlitter.obj/
obj/src/core/skia.SkReadBuffer.obj/
obj/src/core/skia.SkRecord.obj/
const styles = theme => ({
root: {
flexGrow: 1,
height: 250,
},
input: {
display: 'flex',
padding: 0,