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

Support for RTL text plugin 0.3.0 #4860

Merged
merged 8 commits into from
Oct 21, 2024
Merged

Support for RTL text plugin 0.3.0 #4860

merged 8 commits into from
Oct 21, 2024

Conversation

HarelM
Copy link
Collaborator

@HarelM HarelM commented Oct 20, 2024

Launch Checklist

  • mapbox-gl-rtl-text v0.3.0 support #4850
  • This allows loading the script in a async form as 0.3.0 plugin is now loading a wasm in ansyc manner.
  • This moves all the RTL logic into the relevant class and reduce API surface.
  • Remove some unwanted console log in tests
  • This code supports both 0.2.3 and 0.3.0 as far as I've tested.

Fixes #4850

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Add an entry to CHANGELOG.md under the ## main section.

@codecov-commenter
Copy link

codecov-commenter commented Oct 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.00%. Comparing base (86ed382) to head (17e3663).
Report is 3 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4860      +/-   ##
==========================================
+ Coverage   87.66%   88.00%   +0.33%     
==========================================
  Files         265      265              
  Lines       37937    37946       +9     
  Branches     2407     2409       +2     
==========================================
+ Hits        33257    33393     +136     
+ Misses       3608     3495     -113     
+ Partials     1072     1058      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

expect(workerResult.pluginURL).toBe(originalUrl);
});

test('should do a full cycle of rtl loading synchronously', async () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how 0.2.3 works

expect(workerResult.pluginURL).toBe(originalUrl);
});

test('should do a full cycle of rtl loading asynchronously', async () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how 0.3.0 works.
I've added both tests to make sure both option will be supported in the future.

@@ -302,6 +302,7 @@ describe('GeoJSONSource#update', () => {
}));

test('forwards Supercluster options with worker request, ignore max zoom of source', () => new Promise<void>(done => {
jest.spyOn(console, 'warn').mockImplementation(() => {});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unrelated to this PR, maybe we should move it to another cleanup PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted

@@ -3502,7 +3502,6 @@ describe('#flyTo globe projection', () => {
});

camera.on('moveend', () => {
console.log(leastZoom);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the previous message. I'd leave only the RTL text plugin changes to this PR and move all these things to a test cleanup PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted

Copy link
Collaborator

@ibesora ibesora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a bunch of changes that seem unrelated to what's being done in this PR which I'd move to another PR but feel free to ignore
Since examples and tests all work, I'd say this is ready to go!
Good job!

@HarelM HarelM enabled auto-merge (squash) October 21, 2024 09:48
@HarelM HarelM merged commit a2f1450 into main Oct 21, 2024
15 checks passed
@HarelM HarelM deleted the rtl-0.3.0 branch October 21, 2024 09:59
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.

mapbox-gl-rtl-text v0.3.0 support
3 participants