Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What are the downsides of this approach? #58

Open
Eugleo opened this issue Jan 29, 2021 · 2 comments
Open

What are the downsides of this approach? #58

Eugleo opened this issue Jan 29, 2021 · 2 comments

Comments

@Eugleo
Copy link

Eugleo commented Jan 29, 2021

Hey, concur looks very interesting (I just had a quick read through the docs), however, due to it being such a unique idea, I'm unable to accurately assess its pros and cons in solving different problems. That could lead me (and probably a bunch of others) towards the more traditional "safer" libraries, like Halogen.

The pros I can somehow extract from the docs (but I'd still prefer a concise head-to-head comparison with the other frameworks, similarly to what you've done for FRP in the FAQ), but the cons, the problems? No mention of them anywhere. Not only does it make me immediately suspicious, but it hinders my decision process. The examples are great, but as a Purescript newbie, they can only take me so far (plus to ensure readability they're fairly small, so maybe not representative of Concur as a whole).

For example, in an old Reddit thread I read that it's complicated to maintain local state and return a value to parent. It seems that signals are now the way work around this. What about their drawbacks, though? And more importantly, are there any other things one would expect to be easy to do, but which aren't?

To conclude, I think a general document comparing the popular web frameworks (Concur, Halogen, react-simple-hooks, maybe others?) would be tremendously helpful. 1 I propose you start with the passages mentioning use-cases and examples where concur doesn't work so well (yet), especially if it's unintuitive that it is so.

Footnotes

  1. That's a really big undertaking, of course, especially because you probably don't have much experience with all of the other frameworks. But even a concur vs [other framework you know] would be very useful.

@Eugleo Eugleo changed the title Comparison with other approaches? Comparison with other frameworks? Jan 29, 2021
@Eugleo Eugleo changed the title Comparison with other frameworks? What are the downsides of this approach? Jan 30, 2021
@prescientmoon
Copy link

From my own experience,

Cons:

  • Running some action on mount/unmount is harder than you'd expect it to be.

  • Halogen makes subscribing to external events (eg: window resizing) a lot easier

  • Something concur doesn't have yet (afaik) is strongly typed props: for example you can add a href attribute to a div element.

  • Having the ability to include effects inside your render function can lead to spaghetti code (eg: refs and whatnot). I wonder if a good way to disallow this exists.

Pros:

  • Less boilerplate (no sproxies + row types required for children, no queries, etc) (perhaps partially solved by halogen hooks as well)
  • Using existing react components becomes a lot easier (not sure about components which require you to pass them some children tho)
  • Being able to switch react out in favor of preact, leading to amazing bundle sizes

@Eugleo
Copy link
Author

Eugleo commented Jan 30, 2021

Thanks, that's an amazing answer. I'd love to gather more opinions here. I find it rather weird that in a strongly typed language we don't have typed props. I guess it's more a fault of purescript-react than concur's, but still.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants