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

[suggestion] move Test module into main library #412

Open
minimapletinytools opened this issue Apr 15, 2020 · 3 comments
Open

[suggestion] move Test module into main library #412

minimapletinytools opened this issue Apr 15, 2020 · 3 comments

Comments

@minimapletinytools
Copy link
Member

The Test.Run module is useful for testing reflex apps as well.

Exposing this test module encourages more modular design where view/controller is cleanly separated from state. For a new reflex developer, finding information on how to test an app w/out rendering it in reflex-dom was a major challenge. Before discovering this, I forked reflex-basic-host and making my own version which is almost identical to whats in Test.Run https://github.com/pdlla/reflex-basic-host

On the plus side I now completely understand how reflex hosts are built. But I think this information should be easier for new developers to find. TBH I'd like to see this documented in quickref.

Also thanks for making such a great package!

@Ericson2314
Copy link
Member

If it brings in too many extra deps we could perhaps make it a "sub library" in the same package.

@minimapletinytools
Copy link
Member Author

minimapletinytools commented Apr 20, 2020

I switched over to copy of this test code for my own stuff and added my own functionality which I think would be very useful for others. Would it be helpful if I made a PR where this module + my additions is moved into the main one?

EDIT: I made a package reflex-test-host that contains my additions.

The main addition was splitting up runApp into getAppFrame which outputs an AppFrame and

tickAppFrame :: (t ~ SpiderTimeline Global, m ~ SpiderHost Global)
       => AppFrame t bIn eIn bOut eOut m
       -> Maybe (These bIn eIn)
       -> m [(bOut, Maybe eOut)]

which allows you to tick/profile each frame individually.

@Ericson2314 doesn't seem like it will bring in any new deps

@minimapletinytools
Copy link
Member Author

created a PR: #450

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

No branches or pull requests

3 participants