|
| 1 | +1. useStorage should be exported for plugin authors |
| 2 | + |
| 3 | +The recordings plugin has ~20 lines of boilerplate for storageKey(), loadStorage(), saveStorage() — reimplementing |
| 4 | +the navigator*{namespace}*{instanceId} convention that useStorage already handles internally. If useStorage were |
| 5 | +exported (like useUI and getMapInstance), the plugin shrinks significantly and the key convention stays |
| 6 | +consistent. |
| 7 | + |
| 8 | +2. Export a useMap() composable |
| 9 | + |
| 10 | +Components currently need two steps: inject('navigatorId') → getMapInstance(id). A useMap() composable that |
| 11 | +resolves both internally would be more Vue-idiomatic and less error-prone. The internal composable already exists |
| 12 | +— it just needs an external-facing export. |
| 13 | + |
| 14 | +3. Document the @vitejs/plugin-vue prerequisite |
| 15 | + |
| 16 | +The feature example shows .vue SFC files but doesn't mention that consumers need @vitejs/plugin-vue in their Vite |
| 17 | +config. This was a build-breaking blocker with no clear error message. A note in the extending docs (or a Vite |
| 18 | +plugin preset) would prevent this. |
| 19 | + |
| 20 | +4. Document available SVG sprite icons |
| 21 | + |
| 22 | +RecordButton.vue uses <use href="#record-btn-fill" /> — but there's no list of available icon names anywhere. |
| 23 | +Plugin authors are guessing. A simple icon reference (even just a list) in the docs would help. |
| 24 | + |
| 25 | +5. Add once to the plugin context |
| 26 | + |
| 27 | +NavigatorInstance exposes once(), but the plugin install context only gets on/off/emit. Plugins that need one-time |
| 28 | +setup (like map:ready) would benefit from once too. |
| 29 | + |
| 30 | +6. Add a plugin cleanup lifecycle |
| 31 | + |
| 32 | +There's no destroy/teardown hook for plugins. If the instance is unmounted, plugins can't clean up timers, |
| 33 | +geolocation watches, or map layers. A on('destroy', fn) event or a return-value convention (install returns a |
| 34 | +cleanup function) would prevent leaks. |
| 35 | + |
| 36 | +7. Minimum version annotations in docs |
| 37 | + |
| 38 | +useUI was added in 1.0.20, but the feature docs referenced it while the package was at 1.0.19. Adding @since |
| 39 | +annotations to the API tables would save debugging time. |
0 commit comments