-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
feat: drop MapLibreGL
naming and deprecate export default
#567
Conversation
BREAKING CHANGE: Remove MapLibreGL default export, use `import * as MapLibreRN` instead
# Conflicts: # docs/components/BackgroundLayer.md # docs/components/CircleLayer.md # docs/components/FillExtrusionLayer.md # docs/components/FillLayer.md # docs/components/HeatmapLayer.md # docs/components/LineLayer.md # docs/components/MapView.md # docs/components/RasterLayer.md # docs/components/SymbolLayer.md # docs/docs.json # packages/examples/src/examples/UserLocation/FollowUserLocationRenderMode.tsx # src/MLRNModule.ts # src/components/MapView.tsx
MapLibreGL
naming and export default
I can understand migrating to named exports and updating the docs accordingly, but I am concerned about the extent of breaking changes, which are more significant than those listed in the migration docs. Because of the gap between 9.0 and 10.0, and the number of people using 10.0 beta in production, doing a patch bump on beta with this extent of breaking changes would break any app using beta in production. That is unacceptable IMO. My preference would be to support both for the 10.0 release. For example:
Would enable the new api, but allow current functionality to work without breaking changes. We can add a deprecation notice if need be, and remove them with the next Major release, but I don't think we can break this much API with a patch. |
I see your concern. These are the points, why it would rather break stuff now:
But I'm also fine to keep old exports as deprecated, just let me know which path you want to go. |
What do we gain from doing this? Other than following builder-bob recommendations. Is it more performant? Is it less error-prone? Does it provide greater functionality? Does it simplify the build configuration? While we have made minor api changes in alpha & beta, there were reasons for each. This breaks literally everything. Not just the methods you mentioned, but also AnimatedShape, Logger, LocationManager, SnapshotManager, etc. Updated exports across hundreds of files. Someone does a patch version bump on 10.0.0.beta, and if they are lucky, CI/CD catches it. It may be an easy migration with a couple find and replaces, but it is completely unnecessary. Why cause this level of frustration? I am sorry. I just don't get it. Why is this necessary? |
To me personally there is a handful of reasons to drop the default export. But I understand, these might be very subjective arguments. Therefore I will revert the breaking changes to deprecations. The following is the reasoning, why I want to deprecate the default exports. Please let me know if you are opposing a deprecation. Sorry, I should have communicated the reasonings behind this much more clearly. First of all, I think it's good to distinguish from the Most React libraries which export components use named imports in their docs/examples. But of course this doesn't require removing the user facing default export. But by unifying the way this library is used, reports and discussions in this repository could be more readable and more understandable to everyone. Taken from the Builder Bob docs:
Here are some clarifications of the possible issues.
I want to clarify: Changing the individual exports within For library users, mainly the changes in To conclude, changing the user facing exports in |
MapLibreGL
naming and export default
MapLibreGL
naming and deprecate export default
I've pushed the deprecations, now this PR only deprecates exports and introduces no new breaking changes. |
Perfect! Thank you. |
# Conflicts: # android/build.gradle
# [10.0.0-beta.13](v10.0.0-beta.12...v10.0.0-beta.13) (2024-12-23) ### Features * drop `MapLibreGL` naming and deprecate `export default` ([#567](#567)) ([aa0c73d](aa0c73d))
🎉 This PR is included in version 10.0.0-beta.13 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [10.0.0](v9.1.0...v10.0.0) (2025-01-14) ### Bug Fixes * `VectorSource` `onPress` returning null geometry on Android ([250ee6f](250ee6f)), closes [#538](#538) * `VectorSource` `onPress` returning null geometry on Android ([a130786](a130786)), closes [#538](#538) * add @babel/plugin-transform-private-methods for jest ([3a2188f](3a2188f)) * add generic expo config plugin to remove duplicate signature ([#453](#453)) ([2671381](2671381)) * added GeometryCollection to GeoJSONUtils ([#556](#556)) ([e6b7a66](e6b7a66)) * allow MapView and Images to have no children ([#521](#521)) ([1e35bf6](1e35bf6)) * allow resetting contentInset with 0 ([#468](#468)) ([1fe42c6](1fe42c6)) * android example crashing on launch ([#372](#372)) ([aeef5c3](aeef5c3)) * cleanup yarn setup ([#463](#463)) ([d9a4d30](d9a4d30)) * corepack enable on publish workflow ([2d13f33](2d13f33)) * correct types in MapView ([#268](#268)) ([0ea35c4](0ea35c4)) * disable code signing for release builds ([b3cf088](b3cf088)) * disable library code signing ([22030dd](22030dd)) * empty pbxproj and dwarf-with-dsym plugin config for EAS ([#458](#458)) ([0d54b46](0d54b46)) * expo-app should load library from workspace:. ([016b44a](016b44a)) * export custom header methods ([#552](#552)) ([58abdb0](58abdb0)), closes [#551](#551) * group dependabot commits by core, dev and example ([#165](#165)) ([b697978](b697978)) * keep [@ts-ignore](https://github.com/ts-ignore) for headingIcon in library [#476](#476) ([#477](#477)) ([ef62454](ef62454)) * make `follow` props on `Camera` deterministic ([#550](#550)) ([e9256e7](e9256e7)) * make MarkerView props with defaults optional ([#460](#460)) ([185cf3e](185cf3e)) * plugin for debug simulator ([#164](#164)) ([06b23d4](06b23d4)) * remove AbortController test mock ([#403](#403)) ([698b558](698b558)) * round compass margins and attribution position to nearest integers [android] ([#294](#294)) ([c89c842](c89c842)) * setMaxAnimationFps on null ([#440](#440)) ([2884256](2884256)) * style expressions ([#466](#466)) ([2202908](2202908)) * trigger release after npm maintenance ([#548](#548)) ([f0fca00](f0fca00)) * types of `getPointInView` and `getCoordinateFromView` ([#601](#601)) ([c7537b5](c7537b5)) * updated Mapbox callstack check for iOS custom headers to check for MapLibre instead ([#461](#461)) ([a6d6216](a6d6216)) * use UIManager exported from react-native ([#511](#511)) ([a4030b5](a4030b5)) * yarn implementation ([#419](#419)) ([39233b1](39233b1)) ### Continuous Integration * add semantic release ([#526](#526)) ([069b6c5](069b6c5)) ### Features * add Expo plugin props ([#589](#589)) ([51fbb00](51fbb00)) * align react and react-native versions for development ([b92abfe](b92abfe)) * allow using google location engine on Android ([#586](#586)) ([92ffdb7](92ffdb7)) * configure packages/examples ([c4510c3](c4510c3)) * drop `MapLibreGL` naming and deprecate `export default` ([#567](#567)) ([aa0c73d](aa0c73d)) * export RegionPayload and MapLibreRNEvent types ([#544](#544)) ([b342f1b](b342f1b)) * extract android UserLocation FPS ([#428](#428)) ([8c0abaa](8c0abaa)) * make `setAccessToken(null)` obsolete ([#593](#593)) ([df44b48](df44b48)) * make Camera pure ([#471](#471)) ([23ecf88](23ecf88)) * MapLibre Android SDK 11.5.0 ([#455](#455)) ([042b759](042b759)) * monorepo configuration ([343e7ac](343e7ac)) * mv example packages/react-native-app ([5c9d3d0](5c9d3d0)) * mv examples, styles, assets, utils and scenes to packages/examples ([13600fe](13600fe)) * packages/expo-app ([c01abd5](c01abd5)) * remove deprecations ([#543](#543)) ([0c41ada](0c41ada)) * remove duplicate of `OfflinePackStatus` type ([#542](#542)) ([9e231b7](9e231b7)) * remove Style component ([#547](#547)) ([9d4c458](9d4c458)) * remove style property enums ([#558](#558)) ([b89a0dd](b89a0dd)) * setup build step ([#504](#504)) ([a017d64](a017d64)) * shared dependencies through packages/examples ([01a9586](01a9586)) * support new arch through interop layer ([#483](#483)) ([951e9cf](951e9cf)) * unify `MapView`s `styleURL` and `styleJSON` to `mapStyle` ([#559](#559)) ([7d22f16](7d22f16)) * update maplibre native version ([#61](#61)) ([25c418a](25c418a)) * upgrade [@Turf](https://github.com/turf) to v7 and remove geo utils ([#478](#478)) ([a45fc55](a45fc55)) * upgrade Android gradle setup ([#539](#539)) ([761ae0d](761ae0d)) * upgrade dependencies ([#535](#535)) ([047f87f](047f87f)) * upgrade MapLibre Native ([#563](#563)) ([d2b7f5d](d2b7f5d)) * upgrade MapLibre Native Android to v11.8.0 ([#597](#597)) ([410d0c3](410d0c3)) * upgrade MapLibre Native iOS to v6.10.0 ([#598](#598)) ([b596c76](b596c76)) * use `withPodfile` instead of `withDangerousMod` in Expo Plugin ([#587](#587)) ([56d02e1](56d02e1)) ### BREAKING CHANGES * remove `styleURL` and `styleJSON` from `MapView`, use `mapStyle` instead * Removed style property enums * Remove `Style` component, use `styleJSON` of `MapView` instead * - Deprecated `UserTrackingModes` is removed in favor of `UserTrackingMode` - Removed deprecated `setCamera` from `MapView` - Removed deprecated `byId` methods from `ShapeSource` - Removed deprecated `children` from `SymbolSource` - Removed deprecated `assets` key from `Images` - Removed deprecated event keys * Replace OfflineProgressStatus with OfflinePackStatus * Upgrade native packages and migrate components * ci: move native builds to review * ci: run release immediate for debugging * ci: use android working directory for build * docs: remove RELEASE.md * chore: remove manual changelog task * ci: enable release on beta branch * ci: keep default tagFormat * ci: setup npm tag fixes * ci: run review on mr to beta * ci: run fix tags on beta * ci: fix name * ci: clarify workflow_call * ci: disable debugging * ci: run fix tags in pr * ci: setup fix tags to run on beta * docs: prepare changelog for semantic-release * ci: remove fix npm tags workflow
Merge #563 first.
As recommended by React Native Builder Bob I've removed default exports and generally removed wherever possible from the library. The resulting breaking changes are documented in the migration guide.