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

Browser requirements / lockout support #152

Closed
amcclain opened this issue Apr 10, 2018 · 6 comments
Closed

Browser requirements / lockout support #152

amcclain opened this issue Apr 10, 2018 · 6 comments
Assignees

Comments

@amcclain
Copy link
Member

In Hoist Core we have io.xh.hoist.browser.Utils.browserSupported() to match the request userAgent against a configurable list of browser requirements. Need to determine how to translate this into hoist-react world with an independent JS client.

  • Could replicate in part at the nginx proxy layer - https://nginx.org/en/docs/http/ngx_http_browser_module.html
  • Could look at libraries or utills that would somehow be included on the page prior to our bundled source (which might include unsupported / not-polyfilled code) that would detect unsupported browsers and do....something...

Pretty big gap as right now a Hoist React app will fail completely and silently if e.g. opened in IE11 - we don't need to make that work, but we need some kind of basic warning in place.

@lbwexler
Copy link
Member

tough problem. Seems like it would be nice if we could modify our index.html to just do this in the javascript.

Would need to somehow prevent the script from loading, or redirect to the lockout page.

@amcclain amcclain self-assigned this May 2, 2018
@cnrudd
Copy link
Member

cnrudd commented May 2, 2018

if (!Boolean(window.chrome)) document.write('use chrome') will rewrite the document and prevent the script from loading/rendering.
https://developer.mozilla.org/en-US/docs/Web/API/Document/write
https://developer.mozilla.org/en-US/docs/Web/API/Document/open#Notes

a little script in the index.html should do the trick.

@amcclain amcclain assigned cnrudd and unassigned amcclain May 8, 2018
@amcclain
Copy link
Member Author

amcclain commented May 8, 2018

Hi - routing this over to you, Colin. Would be great to get something in place.

We should think just a bit ahead towards support for mobile access as well where we could use one approach. That might require things to be a bit more complex in terms of a list of browsers or something with the user agent, although I would still be perfectly fine with us have a hard-coded list of what we accept in hoist-react or the dev-utils and not have it be something that we plan to configure or tweak with each app.

My only other requirement would be that the warning message end up appearing reasonable / professional with just a bit of styling to keep with the rest of the framework. But clearly the point is we're not loading the JS toolkits, so I'm just talking about some kind of basic centering, sans-serif font, etc.

Let me know if you want to talk through anything on the dev-utils side as I think that's where this will likely live. I have been using yarn link when I want to test using a local dev-utils.

@cnrudd
Copy link
Member

cnrudd commented May 8, 2018

starting work on this.

cnrudd added a commit that referenced this issue May 9, 2018
cnrudd pushed a commit that referenced this issue May 10, 2018
@cnrudd
Copy link
Member

cnrudd commented May 10, 2018

browser lockout has been implemented by doing feature tests:
testing for support of native Promise (IE11 does not support) and of
Promise finally (EdgeHTML 16.16299 does not support).

This thread(chakra-core/ChakraCore#3520) suggests that 'finally' support will be coming to Edge soon, so we may want to retest Edge in a few months to see if there are other features we use that it does not support.

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