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

Remove access token #298

Merged
merged 2 commits into from
Sep 4, 2021
Merged

Remove access token #298

merged 2 commits into from
Sep 4, 2021

Conversation

HarelM
Copy link
Collaborator

@HarelM HarelM commented Sep 3, 2021

This PR is for removing access token from the code.
This will replace #21 but the code changes are very similar.
This also fixes #216.
Replaces #293 due to merge conflicts...

  • 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:
  • include before/after visuals or gifs if this PR includes visual changes
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the maplibre-gl-js changelog: <changelog></changelog>

@HarelM HarelM mentioned this pull request Sep 3, 2021
9 tasks
@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2021

Bundle size report:

Size Change: -3.25 kB
Total Size Before: 197 kB
Total Size After: 194 kB

Output file Before After Change
maplibre-gl.js 188 kB 185 kB -3.21 kB
maplibre-gl.css 9.55 kB 9.51 kB -44 B
ℹ️ View Details
Source file Before After Change
rollup/build/tsc/util/request_manager.js 0 B 358 B +358 B
rollup/build/tsc/util/webp_supported.js 380 B 492 B +112 B
rollup/build/tsc/source/rtl_text_plugin.js 904 B 924 B +20 B
rollup/build/tsc/util/actor.js 1.09 kB 1.11 kB +12 B
rollup/build/tsc/util/intersection_tests.js 933 B 944 B +11 B
rollup/build/tsc/symbol/get_anchors.js 572 B 581 B +9 B
rollup/build/tsc/style-spec/validate/validate_filter.js 619 B 627 B +8 B
rollup/build/tsc/source/tile_id.js 1.09 kB 1.09 kB +8 B
rollup/build/tsc/symbol/shaping.js 3.62 kB 3.63 kB +7 B
rollup/build/tsc/symbol/symbol_size.js 534 B 540 B +6 B
rollup/build/tsc/style-spec/expression/index.js 1.59 kB 1.6 kB +5 B
rollup/build/tsc/util/evented.js 3.84 kB 3.85 kB +5 B
node_modules/quickselect/index.js 349 B 354 B +5 B
rollup/build/tsc/style/style_layer/line_style_layer.js 1.01 kB 1.02 kB +5 B
rollup/build/tsc/geo/lng_lat_bounds.js 608 B 613 B +5 B
rollup/build/tsc/geo/mercator_coordinate.js 342 B 347 B +5 B
rollup/build/tsc/style-spec/validate/validate_function.js 1.14 kB 1.15 kB +4 B
rollup/build/tsc/style-spec/validate/validate_source.js 617 B 621 B +4 B
rollup/build/tsc/data/bucket/circle_bucket.js 970 B 974 B +4 B
rollup/build/tsc/style-spec/validate/validate_object.js 390 B 393 B +3 B
rollup/build/tsc/style-spec/validate/validate.js 384 B 387 B +3 B
rollup/build/tsc/data/load_geometry.js 253 B 256 B +3 B
rollup/build/tsc/data/bucket/fill_bucket.js 1.09 kB 1.09 kB +3 B
rollup/build/tsc/symbol/transform_text.js 201 B 204 B +3 B
rollup/build/tsc/style-spec/deref.js 208 B 211 B +3 B
rollup/build/tsc/style-spec/expression/scope.js 194 B 196 B +2 B
rollup/build/tsc/style-spec/validate/validate_constants.js 112 B 114 B +2 B
rollup/build/tsc/style-spec/util/unbundle_jsonlint.js 179 B 181 B +2 B
rollup/build/tsc/style-spec/validate/validate_array.js 355 B 357 B +2 B
rollup/build/tsc/style-spec/validate/validate_number.js 221 B 223 B +2 B
rollup/build/tsc/style-spec/validate/validate_expression.js 452 B 454 B +2 B
node_modules/earcut/src/earcut.js 2.62 kB 2.62 kB +2 B
rollup/build/tsc/util/verticalize_punctuation.js 587 B 589 B +2 B
rollup/build/tsc/symbol/anchor.js 168 B 170 B +2 B
rollup/build/tsc/style/style_layer/fill_style_layer.js 283 B 285 B +2 B
rollup/build/tsc/util/dispatcher.js 331 B 333 B +2 B
rollup/build/tsc/source/query_features.js 1.21 kB 1.21 kB +2 B
rollup/build/tsc/symbol/placement.js 4.65 kB 4.66 kB +2 B
rollup/build/tsc/render/program/hillshade_program.js 881 B 883 B +2 B
rollup/build/tsc/render/draw_symbol.js 2.47 kB 2.47 kB +2 B
rollup/build/tsc/geo/edge_insets.js 422 B 424 B +2 B
rollup/build/tsc/ui/handler_manager.js 2.33 kB 2.33 kB +2 B
rollup/build/tsc/ui/control/geolocate_control.js 2.26 kB 2.26 kB +2 B
node_modules/grid-index/grid-index.js 991 B 992 B +1 B
rollup/build/tsc/style-spec/util/color.js 353 B 354 B +1 B
rollup/build/tsc/style-spec/expression/types/collator.js 202 B 203 B +1 B
rollup/build/tsc/style-spec/expression/types/formatted.js 414 B 415 B +1 B
rollup/build/tsc/style-spec/expression/definitions/collator.js 437 B 438 B +1 B
rollup/build/tsc/style-spec/expression/is_constant.js 258 B 259 B +1 B
rollup/build/tsc/style-spec/expression/parsing_context.js 1.01 kB 1.02 kB +1 B
rollup/build/tsc/style-spec/expression/definitions/case.js 469 B 470 B +1 B
rollup/build/tsc/style-spec/util/properties.js 156 B 157 B +1 B
rollup/build/tsc/style-spec/error/validation_error.js 124 B 125 B +1 B
rollup/build/tsc/style-spec/validate/validate_enum.js 210 B 211 B +1 B
rollup/build/tsc/style-spec/validate/validate_property.js 550 B 551 B +1 B
rollup/build/tsc/style-spec/validate/validate_string.js 123 B 124 B +1 B
rollup/build/tsc/style-spec/validate/validate_boolean.js 123 B 124 B +1 B
rollup/build/tsc/style-spec/validate/validate_color.js 141 B 142 B +1 B
rollup/build/tsc/style-spec/validate/validate_formatted.js 61 B 62 B +1 B
rollup/build/tsc/style-spec/validate/validate_image.js 62 B 63 B +1 B
rollup/build/tsc/style/validate_style.js 154 B 155 B +1 B
rollup/build/tsc/style/evaluation_parameters.js 386 B 387 B +1 B
rollup/build/tsc/data/array_types.js 2.35 kB 2.35 kB +1 B
rollup/build/tsc/style/query_utils.js 264 B 265 B +1 B
rollup/build/tsc/util/classify_rings.js 246 B 247 B +1 B
rollup/build/tsc/data/bucket/pattern_bucket_features.js 326 B 327 B +1 B
rollup/build/tsc/data/bucket/fill_extrusion_bucket.js 1.3 kB 1.3 kB +1 B
rollup/build/tsc/data/bucket/symbol_attributes.js 766 B 767 B +1 B
rollup/build/tsc/symbol/check_max_angle.js 292 B 293 B +1 B
rollup/build/tsc/symbol/clip_line.js 303 B 304 B +1 B
rollup/build/tsc/data/bucket/symbol_bucket.js 4.23 kB 4.23 kB +1 B
rollup/build/tsc/style/format_section_override.js 307 B 308 B +1 B
rollup/build/tsc/geo/lng_lat.js 582 B 583 B +1 B
rollup/build/tsc/data/dem_data.js 760 B 761 B +1 B
node_modules/@mapbox/tiny-sdf/index.js 1.2 kB 1.2 kB +1 B
rollup/build/tsc/style/light.js 560 B 561 B +1 B
rollup/build/tsc/source/tile_bounds.js 315 B 316 B +1 B
rollup/build/tsc/source/image_source.js 1.11 kB 1.11 kB +1 B
rollup/build/tsc/source/source.js 360 B 361 B +1 B
rollup/build/tsc/util/global_worker_pool.js 337 B 338 B +1 B
rollup/build/tsc/symbol/grid_index.js 1.28 kB 1.28 kB +1 B
rollup/build/tsc/render/program/pattern.js 615 B 616 B +1 B
rollup/build/tsc/gl/vertex_buffer.js 537 B 538 B +1 B
rollup/build/tsc/gl/color_mode.js 172 B 173 B +1 B
rollup/build/tsc/gl/stencil_mode.js 152 B 153 B +1 B
rollup/build/tsc/render/draw_collision_debug.js 1.07 kB 1.08 kB +1 B
rollup/build/tsc/render/draw_fill_extrusion.js 807 B 808 B +1 B
rollup/build/tsc/render/draw_hillshade.js 1.09 kB 1.09 kB +1 B
rollup/build/tsc/render/draw_raster.js 1 kB 1 kB +1 B
rollup/build/tsc/render/draw_debug.js 1.11 kB 1.11 kB +1 B
rollup/build/tsc/render/draw_circle.js 580 B 581 B +1 B
rollup/build/tsc/render/draw_background.js 528 B 529 B +1 B
rollup/build/tsc/ui/handler/mouse.js 555 B 556 B +1 B
rollup/build/tsc/ui/handler/touch_zoom_rotate.js 970 B 971 B +1 B
rollup/build/tsc/ui/handler/keyboard.js 571 B 572 B +1 B
rollup/build/tsc/ui/handler/shim/dblclick_zoom.js 149 B 150 B +1 B
rollup/build/tsc/ui/handler/shim/touch_zoom_rotate.js 289 B 290 B +1 B
rollup/build/tsc/util/smart_wrap.js 233 B 234 B +1 B
rollup/build/tsc/style-spec/expression/values.js 491 B 490 B -1 B
rollup/build/tsc/style-spec/expression/definitions/literal.js 390 B 389 B -1 B
rollup/build/tsc/style-spec/expression/definitions/assertion.js 678 B 677 B -1 B
rollup/build/tsc/style-spec/expression/definitions/format.js 722 B 721 B -1 B
rollup/build/tsc/style-spec/expression/definitions/var.js 338 B 337 B -1 B
rollup/build/tsc/style-spec/expression/definitions/coalesce.js 457 B 456 B -1 B
rollup/build/tsc/style-spec/expression/definitions/length.js 370 B 369 B -1 B
rollup/build/tsc/style-spec/validate/validate_glyphs_url.js 171 B 170 B -1 B
rollup/build/tsc/util/is_char_in_unicode_block.js 876 B 875 B -1 B
node_modules/gl-matrix/esm/vec4.js 428 B 427 B -1 B
rollup/build/tsc/style/style_layer/circle_style_layer.js 552 B 551 B -1 B
rollup/build/tsc/util/color_ramp.js 319 B 318 B -1 B
node_modules/@mapbox/point-geometry/index.js 633 B 632 B -1 B
node_modules/@mapbox/vector-tile/lib/vectortile.js 164 B 163 B -1 B
node_modules/potpack/index.mjs 353 B 352 B -1 B
rollup/build/tsc/symbol/quads.js 1.89 kB 1.89 kB -1 B
rollup/build/tsc/symbol/collision_feature.js 379 B 378 B -1 B
rollup/build/tsc/style/style_layer/hillshade_style_layer.js 143 B 142 B -1 B
rollup/build/tsc/data/feature_index.js 1.7 kB 1.7 kB -1 B
rollup/build/tsc/render/glyph_manager.js 874 B 873 B -1 B
rollup/build/tsc/source/tile.js 1.91 kB 1.91 kB -1 B
rollup/build/tsc/source/tile_cache.js 557 B 556 B -1 B
rollup/build/tsc/source/source_state.js 602 B 601 B -1 B
rollup/build/tsc/render/program/collision_program.js 726 B 725 B -1 B
rollup/build/tsc/render/program/line_program.js 1.15 kB 1.15 kB -1 B
rollup/build/tsc/render/draw_fill.js 976 B 975 B -1 B
rollup/build/tsc/ui/handler/tap_recognizer.js 532 B 531 B -1 B
rollup/build/tsc/ui/handler/touch_pan.js 431 B 430 B -1 B
rollup/build/tsc/ui/handler/tap_drag_zoom.js 482 B 481 B -1 B
rollup/build/tsc/ui/handler/shim/drag_pan.js 223 B 222 B -1 B
rollup/build/tsc/ui/control/logo_control.js 597 B 596 B -1 B
rollup/build/tsc/ui/control/navigation_control.js 1.62 kB 1.61 kB -1 B
rollup/build/tsc/ui/popup.js 1.9 kB 1.9 kB -1 B
rollup/build/tsc/style-spec/expression/definitions/step.js 696 B 694 B -2 B
rollup/build/tsc/style-spec/expression/definitions/interpolate.js 1.31 kB 1.31 kB -2 B
rollup/build/tsc/style-spec/expression/definitions/at.js 402 B 400 B -2 B
rollup/build/tsc/style-spec/expression/definitions/in.js 446 B 444 B -2 B
rollup/build/tsc/style-spec/expression/definitions/number_format.js 605 B 603 B -2 B
rollup/build/tsc/style-spec/expression/definitions/index.js 1.63 kB 1.62 kB -2 B
rollup/build/tsc/style-spec/function/index.js 1.18 kB 1.18 kB -2 B
rollup/build/tsc/util/web_worker_transfer.js 979 B 977 B -2 B
rollup/build/tsc/util/script_detection.js 1.65 kB 1.65 kB -2 B
rollup/build/tsc/util/struct_array.js 699 B 697 B -2 B
rollup/build/tsc/data/segment.js 451 B 449 B -2 B
rollup/build/tsc/data/bucket/pattern_attributes.js 141 B 139 B -2 B
rollup/build/tsc/data/feature_position_map.js 559 B 557 B -2 B
rollup/build/tsc/render/uniform_binding.js 628 B 626 B -2 B
rollup/build/tsc/style/style_layer/circle_style_layer_properties.js 231 B 229 B -2 B
rollup/build/tsc/style/style_layer/hillshade_style_layer_properties.js 165 B 163 B -2 B
rollup/build/tsc/data/bucket/fill_attributes.js 112 B 110 B -2 B
rollup/build/tsc/style/style_layer/fill_style_layer_properties.js 198 B 196 B -2 B
rollup/build/tsc/style/style_layer/fill_extrusion_style_layer.js 936 B 934 B -2 B
node_modules/tinyqueue/index.js 361 B 359 B -2 B
rollup/build/tsc/symbol/symbol_layout.js 3.61 kB 3.61 kB -2 B
rollup/build/tsc/style/style_layer/symbol_style_layer_properties.js 648 B 646 B -2 B
rollup/build/tsc/style/style_layer/raster_style_layer_properties.js 169 B 167 B -2 B
rollup/build/tsc/geo/transform.js 3.79 kB 3.79 kB -2 B
node_modules/csscolorparser/csscolorparser.js 2.05 kB 2.05 kB -3 B
rollup/build/tsc/style-spec/expression/definitions/coercion.js 800 B 797 B -3 B
rollup/build/tsc/style-spec/expression/definitions/index_of.js 544 B 541 B -3 B
rollup/build/tsc/style-spec/expression/definitions/comparison.js 879 B 876 B -3 B
rollup/build/tsc/style-spec/feature_filter/index.js 887 B 884 B -3 B
rollup/build/tsc/style-spec/validate_style.min.js 296 B 293 B -3 B
rollup/build/tsc/style/style_layer.js 1.22 kB 1.21 kB -3 B
rollup/build/tsc/style/style_layer/fill_extrusion_style_layer_properties.js 192 B 189 B -3 B
rollup/build/tsc/style/parse_glyph_pbf.js 368 B 365 B -3 B
rollup/build/tsc/util/find_pole_of_inaccessibility.js 690 B 687 B -3 B
rollup/build/tsc/style/style_layer/custom_style_layer.js 488 B 485 B -3 B
rollup/build/tsc/style/style_layer/heatmap_style_layer.js 365 B 362 B -3 B
rollup/build/tsc/util/performance.js 470 B 467 B -3 B
rollup/build/tsc/symbol/projection.js 1.78 kB 1.78 kB -3 B
rollup/build/tsc/render/painter.js 3.3 kB 3.29 kB -3 B
rollup/build/tsc/util/primitives.js 1.08 kB 1.08 kB -3 B
rollup/build/tsc/style-spec/expression/definitions/slice.js 491 B 487 B -4 B
rollup/build/tsc/util/offscreen_canvas_supported.js 160 B 156 B -4 B
rollup/build/tsc/render/image_atlas.js 833 B 829 B -4 B
rollup/build/tsc/data/program_configuration.js 2.62 kB 2.61 kB -5 B
rollup/build/tsc/util/image.js 653 B 648 B -5 B
node_modules/@mapbox/vector-tile/lib/vectortilefeature.js 1.01 kB 1.01 kB -5 B
rollup/build/tsc/style/style_layer/line_style_layer_properties.js 281 B 276 B -5 B
node_modules/@mapbox/vector-tile/lib/vectortilelayer.js 432 B 425 B -7 B
rollup/build/tsc/style/properties.js 1.88 kB 1.87 kB -8 B
node_modules/pbf/index.js 2.82 kB 2.81 kB -8 B
rollup/build/tsc/style/load_glyph_range.js 235 B 223 B -12 B
rollup/build/tsc/source/raster_dem_tile_source.js 900 B 882 B -18 B
node_modules/gl-matrix/esm/mat4.js 2.09 kB 2.07 kB -20 B
rollup/build/tsc/source/load_tilejson.js 310 B 280 B -30 B
rollup/build/tsc/style/style.js 6.55 kB 6.51 kB -36 B
rollup/build/tsc/ui/map.js 6.14 kB 6.1 kB -43 B
node_modules/gl-matrix/esm/vec3.js 930 B 880 B -50 B
rollup/build/tsc/index.js 717 B 664 B -53 B
rollup/build/tsc/source/raster_tile_source.js 973 B 914 B -59 B
rollup/build/tsc/source/vector_tile_source.js 1.17 kB 1.11 kB -68 B
rollup/build/tsc/util/dom.js 732 B 620 B -112 B
rollup/build/tsc/util/config.js 245 B 80 B -165 B
rollup/build/tsc/util/sku_token.js 238 B 0 B -238 B
rollup/build/tsc/util/tile_request_cache.js 1.29 kB 1.02 kB -272 B
rollup/build/tsc/ui/control/attribution_control.js 1.31 kB 1.03 kB -280 B
rollup/build/tsc/util/ajax.js 2.7 kB 2.3 kB -398 B
rollup/build/tsc/util/util.js 2.46 kB 1.97 kB -491 B
rollup/build/tsc/util/mapbox.js 2.88 kB 0 B -2.88 kB

@HarelM HarelM mentioned this pull request Sep 3, 2021
5 tasks
@HarelM
Copy link
Collaborator Author

HarelM commented Sep 3, 2021

@wipfli @lseelenbinder @fredj @nyurik @petr-pokorny-1 any chance for a review? There're not much here besides removing telemetry and mapbox access token...

Copy link
Contributor

@petr-pokorny-1 petr-pokorny-1 left a comment

Choose a reason for hiding this comment

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

I havent found any issues. Great job!

@HarelM HarelM merged commit c34a28b into main Sep 4, 2021
@HarelM HarelM deleted the remove-access-token branch September 4, 2021 05:05
@wipfli
Copy link
Contributor

wipfli commented Sep 4, 2021

Looks good to me as well. Removing code that talks to mapbox servers is really a relief. Thanks for the cleanup Harel.

One thing that can be improved is renaming of files. GitHub tells me for example that util/mapbox was deleted and util/request_manager was added. I assume that this is because you run something like this:

$ mv util/mapbox util/request_manager
$ git add util/request_manager

If instead you run only

$ git mv util_mapbox util/request_manager

GitHub will probably show that the file was renamed and which parts were then deleted. This would make reviewing easier. Let me know if I got something wrong.

@wipfli
Copy link
Contributor

wipfli commented Sep 4, 2021

Regarding migrating from Mapbox v1 to MapLibre v2: We recently came up with the idea that addProtocol could be used to facilitate custom protocols and also access token management. Can you draft an example of how one can migrate after the removal of accessToken?

@HarelM
Copy link
Collaborator Author

HarelM commented Sep 4, 2021

I think it's better this way - take a look at the top of the file of mapbox. It says that if you change it you violate their terms and conditions. So I decided to delete it and add a file instead.
Regarding the addProtocol, and due to the message above I'm not sure I should document this officially as it feels like a violation of their terms again. I don't know...

@xabbu42
Copy link
Contributor

xabbu42 commented Sep 4, 2021

@wipfli git does not really track file moves but detects them based on similarities, so git mv is just a shorthand for git rm and git add.

@wipfli
Copy link
Contributor

wipfli commented Sep 4, 2021

Beautiful, I didn't know that.

wipfli referenced this pull request in wipfli/maplibre-gl-js Sep 9, 2021
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.

[Typescript] Remove access token and telemetry
4 participants