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

Refactor to prepare for release #14

Merged
merged 32 commits into from
Jul 21, 2022
Merged

Refactor to prepare for release #14

merged 32 commits into from
Jul 21, 2022

Conversation

robertdp
Copy link
Owner

@robertdp robertdp commented Jul 20, 2022

This is a long-overdue clean up of parts of the routing logic and underlying implementation.

@jonasbuntinx Care to give this a look-over?

The downstream changes are pretty mild: https://github.com/robertdp/purescript-web-router-example/pull/2/files#diff-eb73bc89dc00e8262fee8eaa74c28d14d54c2d71c3275faddd28870baa9370ea

README.md Outdated
@@ -1,30 +1,9 @@
# purescript-web-router

A basic pushstate router for React with support for asynchronous routing logic, built using [react-basic-hooks](https://github.com/spicydonuts/purescript-react-basic-hooks). I recommend [routing-duplex](https://github.com/natefaubion/purescript-routing-duplex) for easy parsing and printing.
A basic pushstate router for React with support for asynchronous routing logic. I recommend [routing-duplex](https://github.com/natefaubion/purescript-routing-duplex) for easy parsing and printing.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A basic pushstate router for React with support for asynchronous routing logic. I recommend [routing-duplex](https://github.com/natefaubion/purescript-routing-duplex) for easy parsing and printing.
A basic pushstate router with support for asynchronous routing logic. I recommend [routing-duplex](https://github.com/natefaubion/purescript-routing-duplex) for easy parsing and printing.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The readme looks... a little different now 🙂

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README looks great :-)

Do you think that making a README part of a "test suite" (so we verify whether it still compiles) is feasible and desired?

I mean I use this strategy across my libs just by using something like:
https://github.com/paluh/purescript-homogeneous/blob/master/package.json#L10 (litps is really a tool written by @Thimoteus).

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If PS supported literate code I'd consider it, but I don't think it's worth the extra effort. The example project using React has also been updated and it compiles, so most of the code in the updated readme was tested there first.

Some unit tests would be good, but can come a bit later.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This litps provides support for "literate PS". Maybe I will play around that idea in my... spare time ;-)


let overrides = {=}

let additions = {=}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to drop these spago comments all together because they clutter the actual diffs :-P

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a fair point. I've stripped them out.

Copy link

@paluh paluh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Robert!

Sorry for jumping ahead and commenting your PR but I want to say that I really like these changes. From a user perspective I can say that:

  • RouterM and Routing is much cleaner naming convention than Transition and Transitioning
  • The same goes for RouterState vs RouterEvent
  • As a consequence the surface API of mkRouter is now beautiful and easy to understand :-)

Thanks a lot for this update!

@jonasbuntinx
Copy link
Contributor

LGTM 👍

@robertdp robertdp merged commit 7341821 into master Jul 21, 2022
@robertdp robertdp deleted the 0.15-upgrade branch July 21, 2022 08:36
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

Successfully merging this pull request may close these issues.

3 participants