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

client: remove public class fields #335

Merged
merged 2 commits into from
Feb 12, 2023
Merged

Conversation

fscherf
Copy link
Member

@fscherf fscherf commented Feb 12, 2023

This PR removes public class fields from both JavaScript clients, because this feature is not supported in Safari<14.1.
This produced issues on iPhone 6 and iPad mini 2, reported by @markusgritsch in #334.

JavaScript public field declarations are not supported in Safari versions
lower than 14.1. This caused problems on iPhone 6 and iPad mini 2.

This patch replaces all public field declarations with simple, object scoped
variables, set from the constructor, and replaces the `Lona` class, used as
a global namespace, with an object of the class `LonaNamespace`.
The renaming was done to prevent naming collisions between the class, and the
global object.

Further readings:
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields#browser_compatibility

Signed-off-by: Florian Scherf <mail@florianscherf.de>
JavaScript public field declarations are not supported in Safari versions
lower than 14.1. This caused problems on iPhone 6 and iPad mini 2.

This patch replaces all public field declarations with simple, object scoped
variables, set from the constructor, and replaces the `Lona` class, used as
a global namespace, with an object of the class `LonaNamespace`.
The renaming was done to prevent naming collisions between the class, and the
global object.

Further readings:
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields#browser_compatibility

Signed-off-by: Florian Scherf <mail@florianscherf.de>
@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2023

Codecov Report

Base: 68.52% // Head: 68.58% // Increases project coverage by +0.05% 🎉

Coverage data is based on head (7b3e5e2) compared to base (9a64ce6).
Patch has no changes to coverable lines.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #335      +/-   ##
==========================================
+ Coverage   68.52%   68.58%   +0.05%     
==========================================
  Files          68       68              
  Lines        5163     5163              
  Branches     1163     1163              
==========================================
+ Hits         3538     3541       +3     
+ Misses       1349     1347       -2     
+ Partials      276      275       -1     
Impacted Files Coverage Δ
lona/server.py 69.67% <0.00%> (+0.87%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@markusgritsch
Copy link
Contributor

Thanks a lot @fscherf for your fast fix! I can verify that it works fine on my iPhone 6 now.

@fscherf fscherf merged commit ad22079 into master Feb 12, 2023
@fscherf fscherf deleted the fscherf/topic/safari-fix branch February 12, 2023 19:39
@fscherf
Copy link
Member Author

fscherf commented Feb 12, 2023

@markusgritsch: I released 1.12.3, so you can use the fix in your project

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

Successfully merging this pull request may close these issues.

3 participants