splitbee / react-notion

A fast React renderer for Notion pages
https://react-notion.com
MIT License
2.86k stars 151 forks source link

Full support for collection views #23

Closed transitive-bullshit closed 3 years ago

transitive-bullshit commented 4 years ago

Let's track progress in this issue. Higher priority items listed first.

Note that none of these items have been merged or released yet.

transitive-bullshit commented 4 years ago

I found a solid WIP implementation here by @logicalicy.

Here's what his version currently looks like:

Screen Shot 2020-07-22 at 6 51 02 AM

@logicalicy would you be open to joining a zoom call at some point to discuss collaborating and share knowledge?

tobiaslins commented 4 years ago

Looks cool!

I think supporting all types of views would be cool and also switching between them. Filtering/search+ sorting is a nice to have

transitive-bullshit commented 4 years ago

Here's a kitchen sink type test page for table views: https://www.notion.so/saasifysh/Collection-Tests-2fea615a97a7401c81be486e4eec2e94

logicalicy commented 4 years ago

@logicalicy would you be open to joining a zoom call at some point to discuss collaborating and share knowledge?

Hey @transitive-bullshit I haven't been advertising the project so very cool that you've found it! Happy to join a zoom, sure. What's the best way? (Feel free to DM me on Twitter, same handle)

transitive-bullshit commented 4 years ago

Awesome - it looks like your twitter DMs aren't open to the public, so would you mind pinging me on this open slack workspace? https://slack.saasify.sh

Tobias and Timo are also on there in the #react-notion channel, so it could be useful to discuss things going forwards.

logicalicy commented 4 years ago

in the #react-notion channel

Have joined!

transitive-bullshit commented 4 years ago

Update

I've added support for 95% of collection views, but it required a lot of changes.

I've also refactored the Notion API and types into their own, isolated packages, notion-client and notion-types which you can find here: https://github.com/saasify-sh/notion-kit

One of the main changes is instead of changing the shape of the data that's returned from the API and injecting collection data into blocks, it's much, much easier to work with and debug these use cases if we retain the exact same structure as the original Notion API. So now NotionRenderer takes in an ExtendedRecordMap instead of a simple BlockMap.

Supported Views

The only missing collection view at the moment is calendars.

Demo

Here's a quick side-by-side demo video of the progress.

lukebennett commented 3 years ago

What's the latest on this? I can't see a branch anywhere, how would I have a play with it? If it's mostly there, what's the possibility of pushing an alpha package or something?

transitive-bullshit commented 3 years ago

@lukebennett you can check out a full working version of my fork at react-notion-x.

Due to the large amount of changes needed to support collections as well as many other block types and fixes, I decided to release it as a separate project for now. My hope is that react-notion and react-notion-x can eventually be merged back together, but either way I wanted to get all the work I've done improving react-notion over the past few months back in the land of open source. See #36 for more context.

lukebennett commented 3 years ago

Aha great, thanks for making that available! I'd already migrated to notion-client so hopefully react-notion-x will slot right in alongside it - collections is one of the key things I need. I'll take a gander at #36 as well, would be great to consolidate everything back together.

transitive-bullshit commented 3 years ago

Yep; react-notion-x goes hand-in-hand with notion-client.