Real World PureScript+React

Hi,

I was inspired by @thomashoneyman 's implementation (https://github.com/thomashoneyman/purescript-halogen-realworld) of the Real World spec using Halogen.

I work professionally in PureScript, but we’re using React instead of Halogen. So I wanted to create a PureScript+React version of the RealWorld spec.

I have finished the implementation of the spec, but so far it has not been reviewed by anyone besides myself. If anybody wants to go over the code I would ever be so grateful.

You can find the repository here: https://github.com/jonasbuntinx/purescript-react-realworld

I also created a ticket on the realworld repo: https://github.com/gothinkster/realworld/issues/544

13 Likes

This is really cool!

A first and quick review point from my side is that purescrip-wire and purescript-react-basic-hooks-store are missing a basic README file :stuck_out_tongue:

Sorry, at first glance I thought that you are the author of these two mentioned libraries :wink:

2 Likes

Oh, wow, that’s cool. It does definitely look very helpful.
I also like how you started your text with the same inspiration like I did here :smiley: Create-react-app integration with PureScript

1 Like

Thanks for the quick review!

Those libraries are maintained by my good friend @robertdp . I’ll let him know about the missing README files.

Small update.
I created the PR for PureScript+React in the realworld repo:

3 Likes

After a more in depth review I can only say that the code base of this app looks amazing :slight_smile:

3 Likes

I really like this, thanks for sharing!

3 Likes

Another small update.
I have set up a hosted demo: https://purescript-react-realworld.netlify.app/

1 Like

Here’s a summary of what to expect for the 2021 framework comparison (based on 2020 post):

Bundle (KB) Lighthouse performance LOC
This App 82 70 3140
Median 100 91 2050
Best 15 99 638
1 Like

If you want to try for a super tiny bundle size (which would probably improve the lighthouse score as well), you could swap React for Preact and then see if Zephyr adds any extra benefit :slight_smile:

2 Likes

Already doing that :slight_smile:

1 Like

Thanks :+1:

What are your settings when running lighthouse?

Oh nice, I should have checked :sweat_smile:

Hmm… now I’m kind of curious where the extra size is coming from. Or, if it’s just from the views, how there are a few with significantly smaller sizes :thinking:

Same as the article. “Performance” and “Mobile”

Ah, mobile. I was using desktop and was getting 98 :sweat_smile:

Most page components are about 20~25kb in the bundle. Another big chunk is Data.Map.Internal.

1 Like