enact
enact copied to clipboard
WRQ-188: Update core/platform and webos/platform
Checklist
- [x] I have read and understand the contribution guide
- [x] A CHANGELOG entry is included
- [x] At least one test case is included for this feature or bug fix
- [x] Documentation was added or is not needed
- [x] This is an API breaking change
Issue Resolved / Feature Added
Some platforms detected by core/platform
and webos/platform
are outdated.
- There are platforms over ten years from their end-of-life.
- Some platforms are not rigorously tested several years.
- Thanks to interop activities of browser vendors, app developers need just a major compatible browser name and version like Chrome, 120.
Some APIs look unclear in a viewpoint of modules' roles and responsibilities.
- core/platform provides 'touch' and 'touchscreen', and it could lead misunderstanding or a human error.
- core/platform's role is to support app devs to cover compatibility issues, so detecting 'webos' is a different kind of feature. It looks better to provide 'webos' info in webos/platform since apps using webOS features should import @enact/webos anyway.
Resolution
core/platform
- Outdated platforms will be deprecated in Enact 5.0.0
- 'type' is added that is one of 'desktop', 'mobile', 'webos', 'node', and 'unknown'
- 'browserName' is added that is of 'chrome', 'safari', or 'firefox' (Note that the value of this new property is different from the existing 'platformName' that will be deprecated in Enact 5.0.0)
- 'browserVersion' is added as a number (Note that its value is a float for 'safari' so that minor numbers can be compared for compatibility issues)
- 'touch' is replaced with 'touchEvent' as its actual meaning
- 'touchscreen' is replaced with 'touchScreen' to match camel case (Note that we're trying to detect touch screen devices, but it can't be perfect.)
core/webos
- 'webos' is added to check if the platform is webOS
- 'version' is added to check webOS version (from 3.x to 23)
- 'chrome' is added to check chrome version (just for detected webOS vrersions; recommend to use core/platform in general purpose)
Additional Considerations
Links
WRQ-188
Comments
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek ([email protected])
Codecov Report
Attention: Patch coverage is 84.28571%
with 11 lines
in your changes are missing coverage. Please review.
Project coverage is 82.32%. Comparing base (
d89daae
) to head (fd07093
).
Additional details and impacted files
@@ Coverage Diff @@
## develop #3208 +/- ##
===========================================
+ Coverage 82.29% 82.32% +0.03%
===========================================
Files 155 155
Lines 7149 7186 +37
Branches 1885 1901 +16
===========================================
+ Hits 5883 5916 +33
- Misses 995 998 +3
- Partials 271 272 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.