dvargas92495 / roam-client

MIT License
26 stars 5 forks source link

Explorations towards l2 interfaces for blocks & pages #33

Closed Stvad closed 3 years ago

Stvad commented 3 years ago

This is explorations towards #30, I've been using this in https://github.com/Stvad/iroam

It's a bunch of code and it's in a bit raw state, bust just wanted to open a discussion:

dvargas92495 commented 3 years ago

How would you describe L2? From what I understand, it looks like a second layer to create an object-oriented API around Blocks and Pages

Stvad commented 3 years ago

The analogy I was calling out to is CDK L1 and L2 interfaces (https://docs.aws.amazon.com/cdk/latest/guide/constructs.html). But basically - it's higher level interfaces for blocks/pages with the related functionality grouped in an easy to discover way and better integrated internally

dvargas92495 commented 3 years ago

right, so I think I would prefer this in a separate l2 package. The pattern roam-client was striving for was something along the lines of date-fns or lodash - a collection of functional utilities. Now I agree that there needs to be a migration to splitting to different namespaces to get there so that it's less intensive on consumer's bundles.

Interfaces are a more object-oriented in by creating classes, instantiating witn new and chaining methods off of each other. This is similar to the RestClient/WindowClient classes that are here and I'd actually like to remove/refactor into the functional approach.

Because these approaches are different I think it makes sense for them to live in separate packages

Stvad commented 3 years ago

👌 I'm curious about whether you had a chance to look at the interfaces themselves/what are you impressions/do you have any feedback?

Stvad commented 2 years ago

I appreciate the comments! will get around publishing this as a separte package one of these days 😅