Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Add a way to easily display a single component in a browser window #3

Open
@roryokane

Description

@roryokane

I’m summarizing here what we talked about after the meetup last night.

I suggested, in addition to the automated tests, a way to make rails server work so I could inspect the components I was writing as I went along. I find viewing the resulting page, and looking at it with the browser Developer Tools, more tangible than running pre-written tests and having them tell me my code is correct. Being able to view components as I write them would also let me be creative and experiment by editing the components according to my ideas and seeing the results in the browser.

Since making the standard command rails server would be difficult to keep working throughout every step of the tutorial, you had the idea of adding to the tutorial a command-line script mount_component SomeComponent that would launch a browser window showing the component, like the automated tests do, but the window would not run tests, but rather stay open for the user to interact with.

For performance and convenience, you could also have the server for that component keep running in the background after running the script, and have it close itself when the browser tab is detected to have closed. You could allow inspecting multiple components at once in multiple browser tabs. The browser could be only closed after all component-viewing tabs were closed, to save time waiting for the browser to relaunch.

This tool could even be made non-browser-specific and added to the actual React.rb, not just this tutorial for it. I think it could be useful in general.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions