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

[RFC] Testing Browser Compatibility #8583

Closed
3 of 12 tasks
nhunzaker opened this issue Dec 15, 2016 · 19 comments
Closed
3 of 12 tasks

[RFC] Testing Browser Compatibility #8583

nhunzaker opened this issue Dec 15, 2016 · 19 comments
Assignees

Comments

@nhunzaker
Copy link
Contributor

nhunzaker commented Dec 15, 2016

Testing browser quirks is challenging. What if we set up a page or site local to the React repository that made it easier to isolate browser differences and document known issues:

For example:
http://natehunzaker.com/react-issue-reproducer/cases/input-kitchen-sink/index.html

We could start with some of the outstanding input issues (like #7359), and work our way backward to historical decision points for adding additional rules to support specific browsers.

Speaking with @gaearon and @aweary about this. We see a couple of outstanding tasks:

  • Add a page/site local to the React repository that includes test cases for reproducing specific browser quirks
  • Make it easy to switch between versions of React via CDN references and local builds
  • Catalog existing fixes and outstanding issues, start building test cases
  • Modify React flags via query strings, or some other mechanism to quickly switch between the Fiber and and standard DOM renderer.

Eventually, this could also be a great resource for how React handles DOM manipulation, obscure DOM API concepts, and reference notes for implementors of other DOM rendering libraries.

Test cases

@nhunzaker
Copy link
Contributor Author

cc @jquense, you've done a lot of work in this area too. What do you think?

@aweary
Copy link
Contributor

aweary commented Dec 15, 2016

A few thoughts/questions on the high-level structure of the page(s):

  • How should we group test cases? Should each case have its own page and we maintain a central directory for navigating between them, or should we keep the page count down and put all related tests on a single page?

  • We'll want to include exact steps on what to do to reproduce and check the behavior we're looking to validate. It should be easy for a new contributor to look at it, follow the steps, and know if its working or not.

  • We can potentially use paths to load any arbitrary version of React from unpkg on any page. For example /15.4.1/input-test would load the test with React 15.4.1. This would make it very easy + quick to test regressions.

@gaearon
Copy link
Collaborator

gaearon commented Dec 15, 2016

I would put everything on a single page and have a switch at the top that points to CDN versions or local build, and refreshes the part of the page below when you change them.

@bvaughn
Copy link
Contributor

bvaughn commented Dec 15, 2016

Make it easy to switch between versions of React via CDN references and local builds

I have a small set of in-browser tests for react-virtualized that read query param and toggle between different versions of react (by version number) and react-virtualized (either a version number pulled from CDN or "local" which runs against the local build). Very useful when checking for regressions or perf changes.

+1 to Dan's in-page switch suggestion. The most common case is probably to compare between local and latest release on NPM.

@jquense
Copy link
Contributor

jquense commented Dec 15, 2016

this sounds really helpful in general. So much of that knowledge now is either lost, or trapped in tons of jsfiddles in many different issues. I'd love if the many many browser decisions made to attend to browser quirks was better documented, ITs always tough to try and understand even the starting point for addressing DOM issues without that knowledge. I'd also add that documenting the minimal reqs for certain changes would be really helpful. Such as input components needing to work with imperative sets to value on the DOM node, as well as prop changes.

Would this also be a tool for new issues? I wonder what adding to such a page would look like? Changes accompany associated fixes? Is it possible to leverage an existing code iteration tool (codepen/jsbin/jsfiddle) for this? That might make it more helpful for the beginning bits of identifying new issues.

@aweary
Copy link
Contributor

aweary commented Dec 15, 2016

As I see it, the process would look something like:

  1. User identifies new issue and shares a case reproducing it (JSFiddle or whatever)

  2. We verify the issue

  3. Someone fixes it and includes the changes to the test page in the PR just like they do now with unit tests

  4. We now use the test page to validate the fix in our supported browsers

@aweary
Copy link
Contributor

aweary commented Dec 15, 2016

This is a long term stretch goal, but automatic deployment of the test page when a PR is opened that affects DOM code would be amazing.

@nhunzaker
Copy link
Contributor Author

One other item, though I'd be okay with excluding it as a core part of this issue, is base line browser compatibility.

  • What browsers do we target?
  • Should there be an effort to strip fixes for unsupported browsers, such as IE8?
  • If not, should we consider a compatibility package? I think this primarily pertains to the event plugin system, though I could be wrong.

@aweary
Copy link
Contributor

aweary commented Jan 9, 2017

#8589 has been merged! The DOM fixtures application is in place and functioning, now we need to focus on writing up all the fixture test cases and designing the UI for them

@jquense
Copy link
Contributor

jquense commented Jan 10, 2017

Some outstanding DOM issues, i'm personally familiar with are ('ill try and collect others as well)

  1. Mouse enter and leave work consistently with disabled elements #5762 (I had an offline chat with @jimfb awhile ago about this and I believe it was left at "looks fine but we are all to scared to make such a big change to the mouse enter logic", so probably a good fit here.

  2. Backport input fix #8575 Really is a collection of undocumented input behavior that needs documentation.

  3. Change event does not fire in IE and Edge under certain circumstances #4672

@aweary
Copy link
Contributor

aweary commented Jan 18, 2017

A few issues that will make good fixtures: #7027, #4457, #8308

@jquense
Copy link
Contributor

jquense commented Jan 18, 2017

We still need to write the fixture components yeah? I could take a stab at that if its not in process somewhere

@aweary
Copy link
Contributor

aweary commented Jan 18, 2017

@jquense yupp, go for it! ping me when you've got a PR open and I'll review

@nhunzaker
Copy link
Contributor Author

Started to catalog a check list of test cases in the issue description.

@nhunzaker
Copy link
Contributor Author

I'm a bit stuck on this one:

Modify React flags via query strings, or some other mechanism to quickly switch between the Fiber and and standard DOM renderer.

Does React expose the ability to touch feature flags with the UMD build?

@nhunzaker
Copy link
Contributor Author

@jquense @aweary I added your names next to the checklist of test cases to write based on the work progress. If I just created work for you, feel free to remove your names :).

@aweary
Copy link
Contributor

aweary commented Mar 29, 2017

@nhunzaker sounds good, I claimed the unclaimed ones 😃

@gaearon
Copy link
Collaborator

gaearon commented Jul 12, 2017

Can we close this now? 😃

@nhunzaker
Copy link
Contributor Author

Yes. I think we certainly can.

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

5 participants