Skip to content

Comments

Lazy loading of RTL plugin#8

Merged
pirxpilot merged 12 commits intomainfrom
rtl-plugin-lazy
Jan 25, 2026
Merged

Lazy loading of RTL plugin#8
pirxpilot merged 12 commits intomainfrom
rtl-plugin-lazy

Conversation

@melitele
Copy link
Contributor

  • remove unnecessary test setup
  • remove obsolete worker config options
  • Expose mapboxgl.getRTLTextPluginStatus method (#8864)
  • Add deferred option setRTLTextPlugin to load the plugin only when the first time RTL text is encountered. (#8865)
  • Remove stringContainsRTLText dependency from within style-spec. (#9088)
  • Deferred loading of RTL text plugin detects labels rendered from GeoJSON sources (#9091)
  • Don't reload raster sources when RTL text plugin loads to avoid flicker. (#2381)
  • Refactor RTL plugin loading code (#3418)
  • Overhaul of RTL plugin loading sequence (#3728)
  • Support for RTL text plugin 0.3.0 (#4860)
  • refactor RTL plugin to mapwhit coding conventions
  • remove triggering RTL plugin lazy load from tile

melitele and others added 12 commits January 21, 2026 22:48
Original commit: 036ddc4fefc0374fb0cae1b3b698b7164575ec79:
… the first time RTL text is encountered. (#8865)

Original commit: d69e24420d9ef4e69315d5dc590ee7e047706aa2:
…088)

Original commit: 2e53e7c5ef8654f4ab7162c25103abece00919dc:
…SON sources (#9091)

 create mode 100644 test/util/create_symbol_layer.js

Original commit: d9e9ffe39a823b2f4a790b805b4fd2859c363cc4:
…er. (#2381)

* Don't reload raster sources when RTL text plugin loads to avoid flicker.
Fixes issue https://github.com/maplibre/maplibre-gl-js/issue/2380

* Test fixes:
 - Make clearRTLTextPlugin also clear the _completionCallback
   - Having a completion callback for an old plugin run is bad in general
   - It specifically messed up the style tests by running during later tests
 - Call clearRTLTextPlugin when last plugin test is done
 - Set the stubMap style object -- this is a subtle one, but two frames _after_ this test runs, loadTileJSON triggered by this loadJSON will fail if the map doesn't have its style set, and the exception will get passed to a later style test.

* Add changelog entry.

Original commit: 3df594864bdf3f8713eafa6b573251dda9d89061:
* Initial commit to split rtl to worker and main thread implementations.

* Finish all fixes for rtl plugin split

* Fix the tests that fail, add proper idle event handling

* Changelog, lint, build and render

* Improve render test

* Fix changelog, add idle console logging

* Return a promise from the public API

* Add more logs to tests

* More logs, more timeout

* Fix lint

* Clean error for failed tests

* Fix typo

 delete mode 100644 src/source/rtl_text_plugin.ts
 create mode 100644 src/source/rtl_text_plugin_main_thread.test.ts
 create mode 100644 src/source/rtl_text_plugin_main_thread.ts
 create mode 100644 src/source/rtl_text_plugin_status.ts
 create mode 100644 src/source/rtl_text_plugin_worker.ts

Original commit: d68b919b04864d1c11491ddbc75d3f16dc2838e0:
* fire pluginStateChange only if at least one receiver changed plugin status

* draft

* fixes

* all ut pass

* test cases

* change log

* worker tests

* add change in style.ts

* update style test

* update UT

* Update src/source/rtl_text_plugin_main_thread.test.ts

* PR comments

* PR comments

* dup lazyLoad() calls

* multiple

* PR

* replace exception with console.error

* update comment to be more accurate

* do not download from main thread

* remove extra try/catch

* remove extra throw

* remove extra import

* exception handling

* correct version

* all UT

* UT

* add tests (#7)

* all UT

* UT

* Add FT

* remove extra import

* clean up comments

* test update

---------

Co-authored-by: Harel M <harel.mazor@gmail.com>
Original commit: 82dce2b2e57abbadffa0fdaf2452ade1ce4f11ec:
* Allow loading rtl plugin async

* Allow loading rtl plugin async

* Add changelog

* Fix typecheck and code

* Add tests to make sure both 0.2.3 and 0.3.0 are supported

* Improve test name

* Change to use latest version everywhere.

* Revert unrelated changes

 create mode 100644 src/source/rtl_text_plugin_worker.test.ts

Original commit: a2f1450549c9e977f6d4fcb0f249c4ffe1d6e11b:
- collate in one module
- replace classes by functions
- distinguish between `loader` and `plugin` instead of `main thread` and `worker`
- remove unnecessary methods and rename according to intended use
it's already triggered when processing text for symbols
@pirxpilot pirxpilot merged commit a9234b8 into main Jan 25, 2026
1 of 2 checks passed
@melitele melitele deleted the rtl-plugin-lazy branch January 25, 2026 19:39
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.

5 participants