I am having some issue with frontity in IE11 (not exciting I know). The problem initially presented itself as all react functionality not working. Only frontity links would provide any ability to interact with the app. Not a single onClick would execute any react hook.
Looking at the console with a production build, the debugger was throwing the error Accessing the 'caller' property of a function or arguments object is not allowed in strict mode. I don’t know if this is the culprit for my app not working fully in IE11 but its the only error I get. I then tested this with your deployed demo of the mars theme and found the same error in the IE11 debugger.
As a side note, when testing the same pattern in dev mode for both app I get syntax errors in the IE11 console but havne’t gone down that path yet :).
Any help would be greatly appreciated. I can launch without IE11 support so Im a little stuck.
Thanks for the quick response! Ok that might explain it. Might be a problem then for myself.
I’ll take a look at the support functions you gave above but I’m not sure it will solve my issue. For me the functionality I need it to be able to use react inside the app in IE11.
For example at the base of my landing page I have a button that when clicked it uses a hook to load more posts. In IE11 this doesn’t trigger anything.
var nextPageLink = window.location.pathname + "/page/2";
if (/\/page\/\d+/.test(window.location.pathname)) {
var nextPageNumber = parseInt((/\/page\/(\d+)/.exec(window.location.pathname) || ["", "1"])[1]) + 1;
nextPageLink = window.location.pathname.replace(/\/\d+/, "/" + nextPageNumber);
}
document.getElementById("Load More").href = nextPageLink;
Again, please accept my apologies for not clearly stating this in our docs.
The approach of Frontity is to prioritize modern browser performance and user experience, while keeping only moderate compatibility with old browsers. We don’t expect feature parity between the SSRed version and the hydrated version.
By old browsers, I basically mean IE11 and by moderate compatibility, I mean that the page loads and can be read.
If you need to give some support to IE11, think of the SSRed-only version as something similar to Google AMP. It’s an alternative version of your page, without the enhanced experience of React.
By the way, once we release the @frontity/amp package, if you are thinking about adding support for AMP, we were thinking about adding an option like this:
Thanks for the detailed info. I understand your approach.
For myself it might be a deal breaker. I have components that open drop downs in my header and other JS driven interactions that if all JS is ignored on IE11 then it is kind of pointless to let it render there for our users. All of my dependancies support IE11 so it is a shame to lose that option.
Is there anyway I can disable the IE11 SSR only build and add custom babel/webpack support for this? It would be a nice option to have control over this.
The problem is that the polyfill of the ES6 Proxy is not feature complete, so there is no guarantee that it will replicate the exact behavior of the real Proxy and therefore is not safe to use.
If you were planning to add support for Google AMP, you can use that version for IE11. If not, and the footer option with all the links doesn’t suit your needs, you can show a pop-up warning people that they may not enjoy the full experience, and encourage them to update to the latest Microsoft Edge version, which has a IE11 support mode for compatibility with old websites, but uses Chromium for the rest.
I’m really sorry I can’t be of more help here. If you let me know what other features apart from dropdown links you need, I may be able to think about some ideas.
I’ll investigate AMP and have a think about how I might solve this. Appreciated IE11 is a real pain. Supporting it makes life rather difficult some days.
Thank you for your help, I really appreciate it. I love the project and very grateful you are solving all the tricky problems with headless Wordpress. Glad I could help improve the docs somewhat too
Hey @e.j.a.brett I’ve been checking your repo and I can see that you finally launched the project using Frontity so I guess you were able to fix the IE11 issues.
Could you explain what was your approach? I think this information will be really useful for the community