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

Update Development Environment - Support Node v14 #190

Closed
wants to merge 41 commits into from
Closed

Update Development Environment - Support Node v14 #190

wants to merge 41 commits into from

Conversation

astridx
Copy link
Contributor

@astridx astridx commented Jun 29, 2021

If I'm right, we don't fully support Node v12+ yet because of the way we integrate ECMAScript modules.

There are two options since Node v12+: : Via library or via flag. As far as I can see, we use the library esm.

By the way: Mapbox changed the way to use ECMAScript modules (esm) in PR 10367. They do not use esm any more.

I have no experience with esm. The last version is almost 2 years old. Nevertheless, I suggest updating to this one, because this way our Node scipts are usable under Node v12+. Not everything runs smoothly with this PR. For example, many tests fail. But maybe so we can better work on supporting Node v12+.

I decided to use "type": "module" in main package.json because it is more future-proof.
For this reason, I have had to change Node.js require to ES6 import/export in many places. In addition, the specification of file extensions is mandatory.

Launch Checklist

  • confirm your changes do not include backports from Mapbox projects (unless with compliant license)
  • briefly describe the changes in this PR
  • write tests for all new functionality -> tests have to be correted
  • 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'

@HarelM
Copy link
Member

HarelM commented Jun 29, 2021

Thanks for kicking this off!!
I guess we'll need to fix those tests before we can merge this in.
My two cents: if we can avoid using a library that seems no longer maintained I would feel better about this PR, but this can also be an initial step forward to mitigate.
There was also a suggestion to convert the code to typescript which will also solve this, wouldn't it? (Ton of work nevertheless).

@astridx
Copy link
Contributor Author

astridx commented Jun 29, 2021

My two cents: if we can avoid using a library that seems no longer maintained I would feel better about this PR,

I see it exactly the same way. I thought about whether I should create the PR at all.

I did it because I saw in Mapbox's PR that a lot has been changed to support Node v12+. If someone else can do this in one step, then that's great. Updating to the esm library creates the possibility to proceed in small steps.

I do not add the library. We are already using it. I'm just updating it. So far I haven't found any disadvantage.
We would certainly have to adapt that in any case, right?

@HarelM
Copy link
Member

HarelM commented Jun 29, 2021

I've read through the issue related to the mapbox PR and they write there that this didn't work for them. Since I don't think muting failing tests is the right approach, and due to what they wrote it seems that this won't get us to where we want to be, I still think this pr is important to kick off the process, but I don't think we'll be able to easily fix this that way. I might be wrong. Feel free to commit more changes here until this is resolved...? Your call.
@nyurik, @wipfli any thoughts about this? Use this as a strong argument to migrate to TS? try solving this any other way?

@wipfli
Copy link
Member

wipfli commented Jun 30, 2021

Thanks for working on this Astrid. Indeed, we cannot stay with node version 10 forever. Already now, gekodriver v2 does not support node 10 so I had to restrict the driver to version 1. The sooner we go to a newer node version the better.

@wipfli
Copy link
Member

wipfli commented Jun 30, 2021

Regarding the typescript discussion, I think there was already a long thread about this at some point. @HarelM do you remember where?

@HarelM
Copy link
Member

HarelM commented Jun 30, 2021

Yes, the discussion is here: #32.
This node issues were never a point in the above discussion but I see correlation.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2021

Bundle size report:

Size Change: -8.85 kB
Total Size Before: 205 kB
Total Size After: 196 kB

Output file Before After Change
maplibre-gl.js 196 kB 187 kB -8.9 kB
maplibre-gl.css 8.87 kB 8.92 kB +51 B
ℹ️ View Details
Source file Before After Change
src/data/pos_attributes.js 84 B 540 B +456 B
node_modules/@mapbox/tiny-sdf/index.js 839 B 1.2 kB +365 B
src/util/primitives.js 708 B 970 B +262 B
src/index.js 527 B 734 B +207 B
src/render/uniform_binding.js 452 B 654 B +202 B
src/render/program/collision_program.js 553 B 725 B +172 B
src/render/draw_collision_debug.js 905 B 1.08 kB +171 B
src/util/actor.js 968 B 1.09 kB +119 B
src/source/rtl_text_plugin.js 812 B 914 B +102 B
src/render/program/fill_extrusion_program.js 702 B 804 B +102 B
src/data/raster_bounds_attributes.js 0 B 96 B +96 B
src/render/program/hillshade_program.js 805 B 882 B +77 B
node_modules/ieee754/index.js 490 B 565 B +75 B
node_modules/pbf/index.js 2.68 kB 2.75 kB +69 B
rollup/maplibregl.js 22 B 83 B +61 B
src/geo/transform.js 3.7 kB 3.76 kB +56 B
src/ui/popup.js 1.83 kB 1.89 kB +55 B
src/render/texture.js 654 B 705 B +51 B
src/ui/control/scale_control.js 695 B 734 B +39 B
src/data/bucket/fill_attributes.js 79 B 112 B +33 B
src/util/util.js 2.47 kB 2.5 kB +31 B
src/symbol/one_em.js 0 B 30 B +30 B
node_modules/murmurhash-js/index.js 48 B 76 B +28 B
src/data/bucket/fill_extrusion_attributes.js 96 B 120 B +24 B
node_modules/gl-matrix/esm/vec4.js 436 B 458 B +22 B
src/style-spec/util/color_spaces.js 771 B 790 B +19 B
src/data/bucket/pattern_attributes.js 124 B 141 B +17 B
src/render/draw_heatmap.js 1.02 kB 1.04 kB +16 B
src/style-spec/validate/validate_function.js 1.13 kB 1.15 kB +15 B
node_modules/@mapbox/mapbox-gl-supported/index.js 977 B 992 B +15 B
src/source/source.js 346 B 360 B +14 B
src/symbol/mergelines.js 390 B 403 B +13 B
src/style/style_layer/circle_style_layer_properties.js 221 B 234 B +13 B
src/style/style_layer/background_style_layer_properties.js 106 B 118 B +12 B
src/util/dom.js 885 B 897 B +12 B
src/style/style_layer/hillshade_style_layer_properties.js 155 B 166 B +11 B
src/style-spec/validate/validate_glyphs_url.js 161 B 172 B +11 B
src/data/bucket/line_attributes_ext.js 92 B 103 B +11 B
src/style-spec/error/validation_error.js 115 B 126 B +11 B
src/data/bucket/circle_attributes.js 83 B 93 B +10 B
src/style-spec/validate/validate_property.js 543 B 553 B +10 B
src/render/draw_debug.js 1.11 kB 1.12 kB +10 B
src/style/style_layer/line_style_layer_properties.js 273 B 282 B +9 B
src/util/tile_request_cache.js 1.24 kB 1.24 kB +9 B
src/style-spec/validate/validate_number.js 214 B 223 B +9 B
src/gl/stencil_mode.js 142 B 151 B +9 B
src/style/style_layer/fill_style_layer_properties.js 191 B 200 B +9 B
src/style-spec/empty.js 147 B 155 B +8 B
src/data/extent.js 24 B 32 B +8 B
src/util/verticalize_punctuation.js 581 B 588 B +7 B
src/gl/depth_mode.js 128 B 135 B +7 B
node_modules/@mapbox/vector-tile/lib/vectortilefeature.js 1 kB 1.01 kB +7 B
src/data/bucket/line_attributes.js 112 B 119 B +7 B
src/ui/anchor.js 204 B 210 B +6 B
node_modules/kdbush/src/range.js 256 B 262 B +6 B
src/gl/cull_face_mode.js 125 B 130 B +5 B
src/symbol/collision_feature.js 374 B 379 B +5 B
src/style/style_image.js 122 B 127 B +5 B
src/util/global_worker_pool.js 340 B 345 B +5 B
src/style-spec/validate/validate_light.js 288 B 292 B +4 B
src/util/classify_rings.js 243 B 247 B +4 B
src/render/draw_custom.js 334 B 338 B +4 B
src/util/color_ramp.js 316 B 320 B +4 B
src/gl/color_mode.js 169 B 173 B +4 B
src/symbol/check_max_angle.js 282 B 286 B +4 B
src/style/style_layer/fill_extrusion_style_layer_properties.js 189 B 193 B +4 B
src/style-spec/expression/definitions/number_format.js 600 B 604 B +4 B
node_modules/geojson-vt/src/clip.js 868 B 871 B +3 B
node_modules/geojson-vt/src/feature.js 298 B 301 B +3 B
node_modules/murmurhash-js/murmurhash3_gc.js 365 B 368 B +3 B
src/style-spec/validate/validate_boolean.js 122 B 125 B +3 B
src/util/sku_token.js 234 B 236 B +2 B
[EOLs] 42 B 44 B +2 B
node_modules/geojson-vt/src/wrap.js 462 B 464 B +2 B
src/util/offscreen_canvas_supported.js 159 B 161 B +2 B
src/style-spec/validate/validate_filter.js 623 B 625 B +2 B
src/style-spec/validate/validate_array.js 355 B 357 B +2 B
node_modules/@mapbox/unitbezier/index.js 378 B 380 B +2 B
src/style/style_layer/symbol_style_layer_properties.js 650 B 652 B +2 B
src/style/style_layer/raster_style_layer_properties.js 168 B 170 B +2 B
node_modules/geojson-vt/src/index.js 1.56 kB 1.57 kB +2 B
src/style-spec/validate/validate_enum.js 209 B 210 B +1 B
src/style-spec/util/get_type.js 132 B 133 B +1 B
src/style-spec/group_by_layout.js 406 B 407 B +1 B
node_modules/geojson-vt/src/transform.js 273 B 274 B +1 B
node_modules/geojson-vt/src/tile.js 780 B 781 B +1 B
src/render/program/raster_program.js 563 B 564 B +1 B
src/style-spec/validate/validate_source.js 618 B 619 B +1 B
node_modules/grid-index/grid-index.js 994 B 993 B -1 B
node_modules/@mapbox/point-geometry/index.js 629 B 628 B -1 B
node_modules/csscolorparser/csscolorparser.js 2.05 kB 2.05 kB -1 B
src/style-spec/util/properties.js 157 B 156 B -1 B
src/style-spec/expression/stops.js 189 B 188 B -1 B
src/style-spec/util/interpolate.js 175 B 174 B -1 B
src/style-spec/validate/validate_color.js 145 B 143 B -2 B
src/style-spec/validate/validate_object.js 395 B 393 B -2 B
node_modules/gl-matrix/esm/common.js 178 B 176 B -2 B
src/render/program/circle_program.js 467 B 465 B -2 B
src/style-spec/expression/is_constant.js 259 B 256 B -3 B
src/util/resolve_tokens.js 99 B 96 B -3 B
src/render/glyph_atlas.js 333 B 330 B -3 B
src/symbol/clip_line.js 303 B 300 B -3 B
node_modules/quickselect/index.js 355 B 352 B -3 B
src/style/query_utils.js 266 B 263 B -3 B
src/symbol/transform_text.js 206 B 202 B -4 B
src/util/find_pole_of_inaccessibility.js 696 B 692 B -4 B
src/ui/handler/touch_pan.js 442 B 438 B -4 B
src/style-spec/deref.js 219 B 214 B -5 B
src/gl/framebuffer.js 226 B 221 B -5 B
src/symbol/path_interpolator.js 317 B 311 B -6 B
src/style-spec/validate/validate_constants.js 122 B 116 B -6 B
src/style-spec/util/deep_equal.js 200 B 194 B -6 B
src/style-spec/expression/definitions/literal.js 395 B 389 B -6 B
src/data/feature_position_map.js 556 B 550 B -6 B
src/style-spec/validate/validate_layer.js 874 B 868 B -6 B
src/render/program/pattern.js 623 B 616 B -7 B
src/style-spec/util/color.js 324 B 317 B -7 B
src/render/program/line_program.js 1.16 kB 1.15 kB -8 B
src/util/smart_wrap.js 242 B 234 B -8 B
src/style-spec/expression/runtime_error.js 119 B 111 B -8 B
src/data/bucket/symbol_attributes.js 775 B 767 B -8 B
src/style-spec/expression/types/collator.js 211 B 202 B -9 B
src/style-spec/expression/definitions/assertion.js 695 B 686 B -9 B
src/ui/handler/handler_util.js 110 B 101 B -9 B
src/style/zoom_history.js 191 B 182 B -9 B
src/style/validate_style.js 166 B 157 B -9 B
src/style/format_section_override.js 316 B 307 B -9 B
src/source/tile_bounds.js 326 B 316 B -10 B
src/style-spec/expression/definitions/in.js 461 B 451 B -10 B
src/render/program/heatmap_program.js 573 B 563 B -10 B
src/data/load_geometry.js 263 B 253 B -10 B
src/style-spec/expression/definitions/var.js 348 B 338 B -10 B
src/style-spec/validate/validate.js 397 B 387 B -10 B
src/style-spec/expression/evaluation_context.js 320 B 309 B -11 B
src/ui/control/geolocate_control.js 2.23 kB 2.22 kB -11 B
src/style-spec/expression/definitions/at.js 413 B 402 B -11 B
node_modules/murmurhash-js/murmurhash2_gc.js 256 B 245 B -11 B
src/style-spec/expression/definitions/index_of.js 559 B 548 B -11 B
src/source/pixels_to_tile_units.js 115 B 103 B -12 B
src/ui/control/attribution_control.js 1.28 kB 1.27 kB -12 B
src/style-spec/expression/definitions/image.js 307 B 295 B -12 B
src/gl/vertex_buffer.js 548 B 536 B -12 B
src/render/draw_hillshade.js 1.1 kB 1.09 kB -12 B
src/render/draw_line.js 1.02 kB 1.01 kB -12 B
src/shaders/encode_attribute.js 94 B 81 B -13 B
src/gl/index_buffer.js 310 B 297 B -13 B
node_modules/kdbush/src/within.js 345 B 332 B -13 B
src/util/struct_array.js 712 B 699 B -13 B
src/style/load_glyph_range.js 249 B 235 B -14 B
src/render/draw_background.js 543 B 529 B -14 B
src/source/load_tilejson.js 322 B 308 B -14 B
src/util/dictionary_coder.js 166 B 152 B -14 B
src/render/draw_fill.js 990 B 976 B -14 B
src/data/dem_data.js 774 B 759 B -15 B
src/ui/control/logo_control.js 592 B 577 B -15 B
src/style-spec/expression/definitions/length.js 386 B 371 B -15 B
src/style/style_layer/line_style_layer.js 957 B 942 B -15 B
src/ui/handler/keyboard.js 587 B 571 B -16 B
src/style/style_layer/fill_extrusion_style_layer.js 943 B 927 B -16 B
src/render/draw_fill_extrusion.js 823 B 807 B -16 B
src/style/pauseable_placement.js 614 B 598 B -16 B
src/ui/handler/shim/dblclick_zoom.js 166 B 150 B -16 B
src/ui/handler/scroll_zoom.js 1.27 kB 1.25 kB -16 B
src/ui/handler/shim/drag_rotate.js 195 B 178 B -17 B
src/symbol/get_anchors.js 592 B 575 B -17 B
src/util/webp_supported.js 377 B 359 B -18 B
src/ui/handler/click_zoom.js 260 B 241 B -19 B
src/style/parse_glyph_pbf.js 386 B 367 B -19 B
src/render/draw_raster.js 1.02 kB 1 kB -19 B
src/gl/context.js 1.3 kB 1.28 kB -19 B
src/data/bucket/pattern_bucket_features.js 347 B 327 B -20 B
src/render/program/clipping_mask_program.js 127 B 107 B -20 B
node_modules/@mapbox/geojson-rewind/index.js 359 B 339 B -20 B
src/render/program/background_program.js 498 B 478 B -20 B
src/ui/handler/shim/drag_pan.js 233 B 213 B -20 B
src/source/source_state.js 623 B 602 B -21 B
src/style-spec/expression/definitions/format.js 747 B 726 B -21 B
src/source/worker.js 965 B 943 B -22 B
src/style/evaluation_parameters.js 407 B 385 B -22 B
src/ui/handler/shim/touch_zoom_rotate.js 302 B 280 B -22 B
src/render/draw_circle.js 603 B 580 B -23 B
node_modules/gl-matrix/esm/mat4.js 2.14 kB 2.12 kB -23 B
src/ui/handler/tap_recognizer.js 563 B 540 B -23 B
src/ui/handler/tap_zoom.js 390 B 366 B -24 B
src/style-spec/expression/types/formatted.js 438 B 414 B -24 B
src/style-spec/util/ref_properties.js 24 B 0 B -24 B
src/data/segment.js 475 B 451 B -24 B
src/ui/control/fullscreen_control.js 852 B 828 B -24 B
src/style-spec/expression/types.js 540 B 515 B -25 B
src/style/load_sprite.js 442 B 417 B -25 B
src/style-spec/expression/definitions/case.js 496 B 470 B -26 B
src/geo/lng_lat_bounds.js 638 B 611 B -27 B
node_modules/potpack/index.mjs 379 B 352 B -27 B
src/render/program/fill_program.js 605 B 578 B -27 B
src/util/web_worker_transfer.js 1.01 kB 982 B -27 B
src/util/throttled_invoker.js 239 B 211 B -28 B
src/util/image.js 750 B 722 B -28 B
src/render/line_atlas.js 1.01 kB 984 B -29 B
node_modules/@mapbox/whoots-js/index.mjs 302 B 273 B -29 B
src/ui/handler_inertia.js 852 B 823 B -29 B
src/render/program/debug_program.js 225 B 195 B -30 B
src/style-spec/expression/definitions/coercion.js 831 B 801 B -30 B
node_modules/@mapbox/vector-tile/lib/vectortile.js 196 B 166 B -30 B
src/style-spec/expression/values.js 527 B 497 B -30 B
src/render/draw_symbol.js 2.52 kB 2.49 kB -31 B
src/style-spec/expression/definitions/let.js 506 B 474 B -32 B
src/style-spec/expression/definitions/coalesce.js 489 B 457 B -32 B
src/render/program/symbol_program.js 1.34 kB 1.31 kB -32 B
src/ui/default_locale.js 317 B 285 B -32 B
src/ui/handler/tap_drag_zoom.js 515 B 482 B -33 B
src/util/browser.js 516 B 482 B -34 B
node_modules/vt-pbf/index.js 903 B 868 B -35 B
src/geo/edge_insets.js 465 B 430 B -35 B
src/style-spec/diff.js 1.53 kB 1.49 kB -36 B
node_modules/gl-matrix/esm/vec2.js 167 B 130 B -37 B
node_modules/@mapbox/vector-tile/index.js 82 B 45 B -37 B
src/ui/handler/map_event.js 472 B 434 B -38 B
src/data/bucket.js 234 B 195 B -39 B
src/util/is_char_in_unicode_block.js 916 B 875 B -41 B
src/util/task_queue.js 308 B 266 B -42 B
src/style-spec/validate_style.min.js 339 B 297 B -42 B
src/style-spec/expression/definitions/interpolate.js 1.36 kB 1.31 kB -43 B
src/style-spec/util/extend.js 127 B 83 B -44 B
src/style/style_layer/circle_style_layer.js 583 B 539 B -44 B
src/source/geojson_wrapper.js 428 B 381 B -47 B
src/util/worker_pool.js 411 B 363 B -48 B
node_modules/kdbush/src/sort.js 424 B 376 B -48 B
src/util/intersection_tests.js 981 B 932 B -49 B
src/util/vectortile_to_geojson.js 301 B 252 B -49 B
src/style-spec/expression/scope.js 246 B 196 B -50 B
node_modules/gl-matrix/esm/mat2.js 278 B 227 B -51 B
src/geo/lng_lat.js 633 B 582 B -51 B
src/source/tile_id.js 1.14 kB 1.09 kB -51 B
src/style-spec/expression/parsing_error.js 145 B 92 B -53 B
src/geo/mercator_coordinate.js 395 B 342 B -53 B
src/source/raster_dem_tile_worker_source.js 447 B 392 B -55 B
src/style-spec/expression/types/resolved_image.js 206 B 151 B -55 B
src/source/raster_dem_tile_source.js 962 B 907 B -55 B
src/util/throttle.js 199 B 143 B -56 B
src/style-spec/expression/definitions/index.js 1.69 kB 1.64 kB -57 B
src/style-spec/expression/compound_expression.js 817 B 760 B -57 B
node_modules/geojson-vt/src/simplify.js 336 B 278 B -58 B
src/render/glyph_manager.js 931 B 873 B -58 B
src/symbol/cross_tile_symbol_index.js 1.19 kB 1.13 kB -59 B
src/style/style_layer/hillshade_style_layer.js 202 B 143 B -59 B
src/util/dispatcher.js 391 B 332 B -59 B
src/style/style_layer/custom_style_layer.js 515 B 456 B -59 B
src/render/image_atlas.js 898 B 837 B -61 B
src/style/create_style_layer.js 254 B 191 B -63 B
src/util/ajax.js 2.75 kB 2.69 kB -63 B
src/style/style_layer/heatmap_style_layer.js 423 B 360 B -63 B
src/style/style_layer/raster_style_layer.js 130 B 66 B -64 B
src/style/style_layer/background_style_layer.js 137 B 72 B -65 B
src/style/style_layer/fill_style_layer.js 343 B 277 B -66 B
src/style/style_layer_index.js 518 B 452 B -66 B
src/style/style_layer.js 1.28 kB 1.21 kB -67 B
src/style-spec/expression/definitions/match.js 975 B 906 B -69 B
src/style-spec/expression/definitions/comparison.js 951 B 882 B -69 B
src/symbol/symbol_size.js 613 B 542 B -71 B
src/style-spec/expression/definitions/collator.js 511 B 439 B -72 B
node_modules/gl-matrix/esm/mat3.js 294 B 221 B -73 B
src/source/canvas_source.js 1.1 kB 1.03 kB -73 B
node_modules/@mapbox/vector-tile/lib/vectortilelayer.js 506 B 433 B -73 B
src/style-spec/expression/definitions/slice.js 567 B 494 B -73 B
node_modules/gl-matrix/esm/vec3.js 938 B 865 B -73 B
src/ui/hash.js 1.02 kB 943 B -77 B
src/source/tile_cache.js 636 B 556 B -80 B
src/symbol/projection.js 1.85 kB 1.77 kB -81 B
src/source/video_source.js 960 B 877 B -83 B
src/style/light.js 649 B 564 B -85 B
src/source/image_source.js 1.2 kB 1.11 kB -88 B
node_modules/geojson-vt/src/convert.js 940 B 852 B -88 B
src/source/vector_tile_source.js 1.27 kB 1.18 kB -88 B
src/source/raster_tile_source.js 1.06 kB 973 B -89 B
src/data/bucket/heatmap_bucket.js 194 B 102 B -92 B
src/ui/marker.js 2.82 kB 2.73 kB -96 B
src/ui/handler/box_zoom.js 802 B 705 B -97 B
node_modules/tinyqueue/index.js 460 B 363 B -97 B
src/ui/control/navigation_control.js 1.69 kB 1.59 kB -100 B
src/ui/handler/mouse.js 658 B 557 B -101 B
src/util/evented.js 3.95 kB 3.85 kB -103 B
src/data/feature_index.js 1.81 kB 1.71 kB -104 B
node_modules/earcut/src/earcut.js 2.7 kB 2.59 kB -106 B
src/data/bucket/fill_extrusion_bucket.js 1.41 kB 1.3 kB -107 B
src/source/query_features.js 1.32 kB 1.22 kB -107 B
node_modules/kdbush/src/index.js 479 B 371 B -108 B
src/style-spec/feature_filter/index.js 1 kB 885 B -115 B
src/ui/map.js 6.26 kB 6.14 kB -117 B
src/ui/handler/touch_zoom_rotate.js 1.09 kB 966 B -120 B
src/style/style_layer/symbol_style_layer.js 1.09 kB 973 B -121 B
src/data/bucket/fill_bucket.js 1.22 kB 1.09 kB -125 B
src/source/tile.js 2.05 kB 1.91 kB -133 B
src/source/vector_tile_worker_source.js 831 B 698 B -133 B
src/render/image_manager.js 1.55 kB 1.41 kB -135 B
src/style-spec/expression/definitions/step.js 835 B 696 B -139 B
src/render/vertex_array_object.js 695 B 554 B -141 B
src/data/bucket/line_bucket.js 2.54 kB 2.39 kB -144 B
src/data/program_configuration.js 2.77 kB 2.62 kB -147 B
src/symbol/quads.js 2.04 kB 1.9 kB -148 B
src/ui/events.js 510 B 358 B -152 B
src/ui/camera.js 3.15 kB 2.99 kB -160 B
src/style-spec/expression/index.js 1.76 kB 1.6 kB -165 B
src/render/painter.js 3.47 kB 3.31 kB -165 B
src/source/worker_tile.js 1.44 kB 1.28 kB -165 B
src/gl/value.js 1.25 kB 1.08 kB -169 B
src/source/geojson_source.js 1.48 kB 1.31 kB -175 B
src/util/script_detection.js 1.82 kB 1.65 kB -176 B
src/symbol/anchor.js 323 B 146 B -177 B
node_modules/supercluster/index.js 2.24 kB 2.06 kB -180 B
src/symbol/placement.js 4.84 kB 4.66 kB -182 B
src/style-spec/expression/parsing_context.js 1.2 kB 1.02 kB -185 B
src/util/mapbox.js 3.06 kB 2.88 kB -186 B
src/data/bucket/circle_bucket.js 1.15 kB 968 B -186 B
src/symbol/collision_index.js 1.78 kB 1.57 kB -210 B
src/render/program/program_uniforms.js 1.02 kB 805 B -217 B
src/style/properties.js 2.09 kB 1.87 kB -219 B
src/source/geojson_worker_source.js 1.77 kB 1.55 kB -221 B
src/symbol/grid_index.js 1.5 kB 1.28 kB -221 B
src/render/program.js 1.13 kB 904 B -222 B
src/style-spec/function/index.js 1.42 kB 1.18 kB -235 B
src/ui/handler_manager.js 2.59 kB 2.33 kB -265 B
src/style-spec/expression/definitions/within.js 1.69 kB 1.4 kB -291 B
src/source/source_cache.js 4.04 kB 3.73 kB -309 B
src/util/performance.js 745 B 403 B -342 B
src/data/bucket/symbol_bucket.js 4.57 kB 4.21 kB -360 B
src/symbol/shaping.js 3.91 kB 3.54 kB -376 B
src/data/array_types.js 2.75 kB 2.35 kB -407 B
src/shaders/shaders.js 7.53 kB 7.06 kB -464 B
src/style/style.js 7.09 kB 6.55 kB -536 B
src/symbol/symbol_layout.js 4.6 kB 3.59 kB -1.01 kB

src/render/painter.js Show resolved Hide resolved
src/render/program.js Show resolved Hide resolved
@HarelM
Copy link
Member

HarelM commented Jul 2, 2021

Not sure how the ci works, but you'll need to update the circle ci file with node 14 instead of 10, currently seems like it continues to run everything on 10 so the ci is green...

@wipfli
Copy link
Member

wipfli commented Jul 2, 2021

In my understanding CI is all done with GitHub actions.

@astridx
Copy link
Contributor Author

astridx commented Jul 2, 2021

@HarelM @wipfli
I have changed the circleci-yml in one of the last commits. Should I not have done that?

So far I only look at the test results locally.

@HarelM
Copy link
Member

HarelM commented Jul 2, 2021

You should change the circle-ci. It should be merged as part of this commit. Once this commit lands, the ci should be updated.

@HarelM
Copy link
Member

HarelM commented Jul 2, 2021

Seems like an issue with yarn.lock...?

@astridx
Copy link
Contributor Author

astridx commented Jul 2, 2021

Now everything is red :(. Is that really correct?

Locally, I just started the unit tests. None of them failed. Not even the faulty ScrollZoomHandler unit test.

tests

I don't know if I can reach my goal with this approach. But the fact that everything is red makes me feel insecure more.

@astridx
Copy link
Contributor Author

astridx commented Jul 2, 2021

Seems like an issue with yarn.lock...?

Hm. I add .yarn.lock to the changed files. .yarn.lock is not in .gitignore. package-lock.json is in ,gitignore.

@astridx
Copy link
Contributor Author

astridx commented Jul 2, 2021

Seems like an issue with yarn.lock...?

Thank you. After deleting the changes in yarn.lock the ci-tests started again. Before they did not start.

But all fail again :(

@HarelM
Copy link
Member

HarelM commented Jul 2, 2021

I'm looking at the build which says:
Run yarn install --frozen-lockfile
yarn install v1.22.10
[1/5] Validating package.json...
error maplibre-gl@1.14.1-rc.2: The engine "node" is incompatible with this module. Expected version ">=14.16.0". Got "10.24.1"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

You'll get there, don't worry, it'll just take more time...

@HarelM
Copy link
Member

HarelM commented Jul 2, 2021

I'm not a big fan of yarn, I guess I don't understand its added value over npm...

@astridx
Copy link
Contributor Author

astridx commented Jul 8, 2021

@astridx let me know if this would cover this one as well: #117
Seems to me that both basically have the same purpose - so I prefer to keep the effort in one place.
Keep me posted.

@HarelM I have seen that #117 is now closed. I have entered the changes from there in the same way here.

@astridx
Copy link
Contributor Author

astridx commented Jul 8, 2021

Now all tests are green here on Github. But on my local computer, at least npm test-render and npm run test-query-node still fail. Shouldn't these also be tested here on Github?

@HarelM
Copy link
Member

HarelM commented Jul 8, 2021

I closed it in favor of this one... Good work!

@HarelM
Copy link
Member

HarelM commented Jul 8, 2021

I don't know why they are not running...
In any case, you need to "undraft" this PR in order for it to be merged.
If this is green I think we are good to go. If we decide to add the tests I'm the future we can always make sure they are green before we do :-)

@HarelM
Copy link
Member

HarelM commented Jul 8, 2021

Can you undo the change of the addition of ".js" extension to all the files? There must be a way without it...?

@astridx
Copy link
Contributor Author

astridx commented Jul 8, 2021

I don't know why they are not running...
In any case, you need to "undraft" this PR in order for it to be merged.
If this is green I think we are good to go. If we decide to add the tests I'm the future we can always make sure they are green before we do :-)

I'll look at the two failing scripts tomorrow. If I find a solution to anything I notice, I'll change the draft status.

Can you undo the change of the addition of ".js" extension to all the files? There must be a way without it...?

What disadvantage do you see with the added file extensions? Apart from the work that has now been done, I only see advantages. But maybe I'm missing something?

If I see it correctly, the only possibility to do without the file extensions is the use of https://github.com/standard-things/esm. I had started this solution, but run into problems during integration testing that I couldn't find a solution for. The Node documentation says that the extensions are mandatory: https://nodejs.org/api/esm.html#esm_mandatory_file_extensions

@HarelM
Copy link
Member

HarelM commented Jul 8, 2021

Here are the problems the way I see it:
The number of file that needs to be reviewed is very large as this changes almost all the files, which will degrade the code review quality.
Typescript uses almost the same notation for imports and there's a discussion if this would be the next step for this library, so keeping it similar to how it will look in ts is a big plus, IMO.
less change will help future developers to better understand what changes really were in case we introduce a big in this PR.
If you'd ask me, I think it's important enough to try and avoid this change...

@HarelM
Copy link
Member

HarelM commented Jul 8, 2021

Is it possible to add the extension only to non-flow-typed files? i.e. files that are part of the build and not part of the library?
Flow files get traspiled to js, so they are being taken care of, right?
I guess my question is if we can minimize the number of files that needs to be changed?

@astridx
Copy link
Contributor Author

astridx commented Jul 9, 2021

Here are the problems the way I see it:
The number of file that needs to be reviewed is very large as this changes almost all the files, which will degrade the code review quality.
Typescript uses almost the same notation for imports and there's a discussion if this would be the next step for this library, so keeping it similar to how it will look in ts is a big plus, IMO.
less change will help future developers to better understand what changes really were in case we introduce a big in this PR.

You are right, a review is big.

About typescript: imports with file extensions work here too, right?

I think that adding the extensions is more precise and thus also makes the code easier to read for future developers.

  

@astridx
Copy link
Contributor Author

astridx commented Jul 9, 2021

Is it possible to add the extension only to non-flow-typed files? i.e. files that are part of the build and not part of the library?

If I see it correctly, it is only possible not to use file extensions when importing into node 12+ when using the ems package.

I could keep trying to get this variant to work. I decided against it because the package was last changed in 2019 and node in its own doc describes the variant with type:module in package.json as future proof.
But maybe I am missing something.

@HarelM
Copy link
Member

HarelM commented Jul 9, 2021

Don't get me wrong, using ems is not the right solution as it's kinda deprecated.
What I'm saying is that the js file that also have flow annotation are passing some traspilation which might allow keeping them as they are now without changing them.
Migration to typescript will change the file extension of all the files from .js to .ts and so I would like to keep the code un aware of file extensions.
I can fork your branch and play with it if you want...
I think it's possible according to things I read...

@astridx
Copy link
Contributor Author

astridx commented Jul 9, 2021

I can fork your branch and play with it if you want...
I think it's possible according to things I read...

This would be great. I can not figure it out but I like to learn.

Migration to typescript will change the file extension of all the files from .js to .ts and so I would like to keep the code un aware of file extensions.

Nevertheless, just in case, I would find it better if we used the extensions. It is extra work, but the right file is for sure imported. There will probably still be a few js files. But that is my personal opinion.

@mourner
Copy link
Contributor

mourner commented Jul 9, 2021

@HarelM @astridx I'm disappointed to find out this PR directly copied most changes from my PR here mapbox/mapbox-gl-js#10367 (not open-source-licensed), down to small details like the custom loader code. I worked extremely hard to get it working, and copying my work directly is not fair. I urge you to close this PR and start from scratch on your own, without copy-pasting anything from GL JS, otherwise we would have to explore what practices like this mean legally for this project.

update: edited for milder language

@mourner
Copy link
Contributor

mourner commented Jul 9, 2021

image

@marcelnormann @nyurik please discuss this on the steering committee meeting. Note how the checkbox above was checked.

@astridx
Copy link
Contributor Author

astridx commented Jul 9, 2021

@mourner
I'm sorry. I looked at these things primarily to learn. I had tried different things. I looked at your loader and it is currently in this PR. You are right.
I'll close here. It is difficult to change something that has already been done elsewhere in a similar way.

@astridx astridx closed this Jul 9, 2021
@mourner
Copy link
Contributor

mourner commented Jul 9, 2021

@astridx I may have overreacted and apologize for the harsh tone. It's fine to learn and then do similar changes independently (no objections to this at all), but definitely not OK to directly copy proprietary code.

@HarelM
Copy link
Member

HarelM commented Jul 9, 2021

Thanks for the input @mourner.
I have nothing but respect to your work and the mapbox license, I'm sorry if you feel like we are copying your hard work. This was never the intention.
The checkbox above is exactly for that.
I'll take it to the committee to see what else can be done, but I'm not entirely sure how to address this as I have not looked into your code, I simply reviewed the changes here and with the objective of upgrading to latest version of node and other libraries, I believe ultimately the changes will be very similar - but I believe (haven't compared it obviously) that the commits and commit order and content is different.
In any case, we will start over per your request.

@mourner
Copy link
Contributor

mourner commented Jul 9, 2021

@HarelM for the record, leaving a few comparisons to demonstrate that some parts were copied as is, not just similar:

image
image

@mourner
Copy link
Contributor

mourner commented Jul 9, 2021

@astridx I now realize this was likely unintentional, so once again please forgive me for the initial angry reaction, and feel free to ask questions if you get stuck when redoing this, and I'll be happy to help. It should also be a lot much easier and faster to do it from scratch cleanly now after everything you've learned. Also, feel free to consult the list of gotchas I left in my PR description (but not the code changes). And you don't have to do the .js renames everywhere — Node seems to have an option to use the old path resolution logic that I wasn't aware of at the time.

@HarelM
Copy link
Member

HarelM commented Jul 9, 2021

Thanks @mourner for your kind words and the offer for an olive branch.
I know that @astridx have worked very hard on this by the commits' times, scale, failing attempts and his comments in this conversation.
I think that if this was simply a copy-paste of your final code changes it would've been a lot simpler :-)
Having said that, I understand what you are saying about similar code changes. I'll need to think how I can prevent this in the future.
Sorry once again.

@ambientlight
Copy link
Sponsor Contributor

this calls for a github action or a bot that can cross checks PRs-vs-PRs for changes similarity via some plagiarism checker, not sure how many false positives can arise, but at least something that can post a warning comment to an open PR linking to PR on mapbox side would be handy

surprised there is nothing like that out there

@HarelM
Copy link
Member

HarelM commented Jul 9, 2021

@ambientlight I generally agree this is the right approach. It'd be extremely cool if you could push this forward.

@marcelnormann
Copy link
Contributor

this calls for a github action or a bot that can cross checks PRs-vs-PRs for changes similarity via some plagiarism checker, not sure how many false positives can arise, but at least something that can post a warning comment to an open PR linking to PR on mapbox side would be handy

Please see #129. I already spent some time for research on that issue, but right now there is no real progress. Please let me know if you have some hints for us.

@marcelnormann
Copy link
Contributor

@astridx I may have overreacted and apologize for the harsh tone. It's fine to learn and then do similar changes independently (no objections to this at all), but definitely not OK to directly copy proprietary code.

As a steering committe it is up to us to apologize! Backporting of non-compliant code is unacceptable and against the rules of this project. We will take additional measures to ensure other peoples copyright.

@astridx astridx deleted the esm_modules_integration branch September 4, 2021 09:05
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.

None yet

6 participants