-
Notifications
You must be signed in to change notification settings - Fork 34
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
🚑 app does not work on older iPhones due to modern javascript #924
Comments
on iOS 13, changing that to
works. But that is not enough for iOS12. On iOS 12, we get the following error
Do I even want to do this or should we just say that iOS 12 is unsupported? |
The problem is that iOS12 is the last supported version; all iOS13+ has been upgraded to iOS15 So either we support this, or we drop support for at least some iPhone6. The error is
Unfortunately, there are 17 of them. That's not too terrible, but enough that I want to see if there is an alternative to fixing them manually. Is there a polyfill for this feature? |
No polyfill, have to use a transpiler since this is syntax. |
Found the 17 files
So transpiling appears to work but generates extremely messy code
The start of the file looks like
|
Let's try a specific target
doesn't change it Using
At this point, it is going to be faster to make the changes manually, From the transpiler, |
or should I just check in the messy code - we are not going to merge this anyway. |
This is the list of files
|
Converted all of them using
|
There are two |
iOS13 does not support `||=`, so launching the app on iOS13 results in a WSOD. There are only three instances of this, so we fix it by replacing all of them with compatible code. like so ``` - timelineEntry.additionsList ||= []; + if (timelineEntry.additionsList === undefined) { + timelineEntry.additionsList = []; + } ``` This is a partial fix for e-mission/e-mission-docs#924 In the long term, we will not need this, since webpack will automatically enforce whatever compatibility we want. So this is throwaway code which will never be merged to master. Testing done: - Before this fix, app got WSOD on 13.x emulator - After this fix, app launched 13.x emulator
There were more of these files, so I tried to use babel to automatically transpile. Using the `--presets "@babel/preset-env"` generated very crappy code. But I couldn't find a config that fixed only this issue in a targeted fashion ` "targets": "iOS 12"` doesn't change anything `ios-saf 12` results in an error `targets: {"safari": 12.5}` also failed (don't remember why) Since this is a workaround, let's just check in the transpiled files separately and change the index.html to load the new values Note that there were two `launch.js` files, so we renamed one of them as `ext-launch.js` Testing done: - without these changes, the app would generate a WSOD on iOS 12 - with these changes, it does This fixes e-mission/e-mission-docs#924
Fixed in https://github.com/e-mission/e-mission-phone/tree/hack_to_support_old_iphones |
n.b. to determine these errors, which occur before loading is complete and we can connect the debugger, I add a breakpoint to
When the app stops there, I can connect the debugger and then continue the load. |
Report from a user:
We are not supporting iPhone 5 any more, but we should support iPhone 6 and above if possible. It looks like some iPhone 6 phones can be upgraded but others are not. If it is too hard to support, we should make that clear in our docs. From an native code perspective, we support iOS 11+.
I tried running on an iOS 13 emulator and I get the following errors
It looks like it doesn't like statements of the form
The text was updated successfully, but these errors were encountered: