Skip to content

Conversation

@nhunzaker
Copy link
Contributor

After @philipp-spiess's last PR, I found myself wishing that browser testing recommendations were easier to find. This commit adds a home page to the DOM fixtures that includes testing information.

Also, we're getting a lot of fixtures! I've changed the fixture switch component to asynchronously load fixtures as needed. If we ever publish the fixtures officially, this should cut the payload size a fair bit.

Finally, the fixture styles were never build to accommodate long-form text content. This PR also adds a general style update to make text a bit nicer.

Test plan

Take a look at http://react-dom-home.surge.sh


screenshot 2018-08-10 at 8 35 40 pm

This commit adds a homepage to the DOM fixtures that includes browser
testing information and asynchronously loads fixtures.

This should make it easier to find DOM testing information and keep
the payload size in check as we add more components to the fixtures.
Copy link
Contributor

@philipp-spiess philipp-spiess left a comment

Choose a reason for hiding this comment

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

Awesome!

</table>
</section>
<section>
<h2>How do I test browsers I don't have access to?</h2>
Copy link
Contributor

Choose a reason for hiding this comment

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

I like that section a lot! Maybe we can also list some free options if money is an issue. For example:

I guess that's it. For Safari you'd need a VM to an old macOS version which will require running macOS as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those are all great ideas! I'll update this section with these recommendations.

const {fixturePath} = this.props;

try {
let module = await import(`.${fixturePath}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

We need suspense 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haha, yeah... Though we still need to support React 14/15 for this page (but maybe only 15, we should talk about that).

Copy link
Contributor

@aweary aweary left a comment

Choose a reason for hiding this comment

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

Great improvement! LGTM with a couple non-blocking nits 👍

<tr>
<th>Browser</th>
<th>Versions</th>
<th>Why/Notes</th>
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor UX nit: this "Why/Notes" column is mostly empty. The few notes we have would likely be better as footnotes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great idea. Done.

</li>
</ul>
<p>
These services cost money, however a few maintainers have access to a
Copy link
Contributor

Choose a reason for hiding this comment

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

We should really make sure all maintainers have access to a subscription. @sophiebits is there a way we can get a shared account for one of these services that external collaborators can also use?

Copy link
Contributor

Choose a reason for hiding this comment

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

BrowserStack is free for selected open source projects: https://www.browserstack.com/open-source/

Since Angular qualifies we might as well?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I’m not sure if we have a team account now but if it would be helpful to y’all we can get one. @gaearon?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we had one but we cancelled the plan for automation. We can probably go on a different plan?

Copy link
Contributor

Choose a reason for hiding this comment

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

@philipp-spiess I reached out to BrowserStack about it awhile ago, and they require projects to include an endorsement/link in the README to get the free option. Which, at least at the time, wasn't something we were able to do.

A team account would be great! We just need the Live functionality for manual testing.

const {Fixture, error, isLoading} = this.state;

if (isLoading) {
return <p>Awaiting fixture...</p>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Switching between pages is a little jarring with this. Since we do full page reloads every time you select a new fixture it always flashes "Awaiting fixture..." before rendering. It might be better to just render null

}

if (error) {
return <p>Fixture at path {fixturePath} could not be loaded.</p>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Include error.message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, 69b89ca

screenshot 2018-08-11 at 2 43 37 pm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I debated back and forth with including the stack trace too, but it felt noisy when this is more or less a 404 every time

<p>
These services cost money, however a few maintainers have access to a
subscription. There is no obligation to subscribe to these services;
feel free to ping a maintainer or mention that more testing is
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder if ping is widely understood. Changing this too.

@nhunzaker
Copy link
Contributor Author

Updated with everyone's feedback

const {fixturePath} = this.props;

try {
let module = await import(`.${fixturePath}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use const 🙂?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

@nhunzaker
Copy link
Contributor Author

Will merge after CI

@nhunzaker
Copy link
Contributor Author

Thanks everyone!

@nhunzaker nhunzaker merged commit e3d5b5e into facebook:master Aug 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants