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

[bazel] Run nodejs inside of bazel for genrules #1948

Merged
merged 5 commits into from
Feb 7, 2024

Conversation

keith
Copy link
Collaborator

@keith keith commented Dec 12, 2023

This fixes #1910 by using rules_js.

@louwers louwers added the build Related to build, configuration or CI/CD label Dec 12, 2023
Copy link

github-actions bot commented Dec 12, 2023

Bloaty Results 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-1948-compared-to-main.txt

Compared to d387090 (legacy)

    FILE SIZE        VM SIZE    
 --------------  -------------- 
   +18% +21.4Mi  +399% +23.9Mi    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-1948-compared-to-legacy.txt

@louwers
Copy link
Collaborator

louwers commented Dec 12, 2023

Should we maybe stick to package-lock.json so we don't have two separate lockfiles?

@keith
Copy link
Collaborator Author

keith commented Dec 12, 2023

Unfortunately I think that's a requirement of these rules, but I'm asking around to see if that interpretation is true

@keith
Copy link
Collaborator Author

keith commented Jan 22, 2024

this currently includes #1956

Copy link

github-actions bot commented Jan 22, 2024

Bloaty Results (iOS) 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-1948-compared-to-main.txt

@keith
Copy link
Collaborator Author

keith commented Jan 22, 2024

ok once we merge the 7.x bump and I rebase this I think it will look good!

@keith
Copy link
Collaborator Author

keith commented Jan 29, 2024

As is this fixes #2009 by replacing the umbrella header with one generated by bazel, and taking some part of #2010. This probably results in the import being different for folks using #import <MapLibre/MapBox.h> syntax, but I think for folks using @import MapLibre (or from Swift) there is no noticeable difference in that. This does remove some headers as is that we might want to add back though:

--- /dev/fd/63	2024-01-29 14:06:43
+++ /dev/fd/62	2024-01-29 14:06:43
@@ -1,5 +1,4 @@
 MLNAnnotation.h
-MLNAnnotationContainerView.h
 MLNAnnotationImage.h
 MLNAnnotationView.h
 MLNAttributedExpression.h
@@ -10,15 +9,13 @@
 MLNCircleStyleLayer.h
 MLNClockDirectionFormatter.h
 MLNCluster.h
-MLNCompactCalloutView.h
 MLNCompassButton.h
 MLNCompassDirectionFormatter.h
 MLNComputedShapeSource.h
-MLNConversion.h
 MLNCoordinateFormatter.h
+MLNCustomDrawableStyleLayer.h
 MLNDefaultStyle.h
 MLNDistanceFormatter.h
-MLNFaux3DUserLocationAnnotationView.h
 MLNFeature.h
 MLNFillExtrusionStyleLayer.h
 MLNFillStyleLayer.h
@@ -32,14 +29,10 @@
 MLNLineStyleLayer.h
 MLNLocationManager.h
 MLNLoggingConfiguration.h
-MLNMapAccessibilityElement.h
 MLNMapCamera.h
 MLNMapProjection.h
 MLNMapSnapshotter.h
 MLNMapView+IBAdditions.h
-MLNMapView+Impl.h
-MLNMapView+Metal.h
-MLNMapView+OpenGL.h
 MLNMapView.h
 MLNMapViewDelegate.h
 MLNMultiPoint.h
@@ -47,6 +40,7 @@
 MLNOfflinePack.h
 MLNOfflineRegion.h
 MLNOfflineStorage.h
+MLNOpenGLStyleLayer.h
 MLNOverlay.h
 MLNPointAnnotation.h
 MLNPointCollection.h
@@ -55,10 +49,6 @@
 MLNRasterDEMSource.h
 MLNRasterStyleLayer.h
 MLNRasterTileSource.h
-MLNReachability.h
-MLNRendererConfiguration.h
-MLNRendererFrontend.h
-MLNScaleBar.h
 MLNSettings.h
 MLNShape.h
 MLNShapeCollection.h
@@ -67,7 +57,6 @@
 MLNSource.h
 MLNStyle.h
 MLNStyleLayer.h
-MLNStyleLayerManager.h
 MLNStyleValue.h
 MLNSymbolStyleLayer.h
 MLNTilePyramidOfflineRegion.h
@@ -77,30 +66,10 @@
 MLNUserLocation.h
 MLNUserLocationAnnotationView.h
 MLNUserLocationAnnotationViewStyle.h
-MLNUserLocationHeadingArrowLayer.h
-MLNUserLocationHeadingBeamLayer.h
-MLNUserLocationHeadingIndicator.h
-MLNValueEvaluator.h
 MLNVectorStyleLayer.h
 MLNVectorTileSource.h
+MapLibre.h
 Mapbox.h
-NSArray+MLNAdditions.h
-NSBundle+MLNAdditions.h
-NSCoder+MLNAdditions.h
-NSComparisonPredicate+MLNAdditions.h
-NSCompoundPredicate+MLNAdditions.h
-NSDate+MLNAdditions.h
-NSDictionary+MLNAdditions.h
-NSException+MLNAdditions.h
 NSExpression+MLNAdditions.h
-NSOrthography+MLNAdditions.h
 NSPredicate+MLNAdditions.h
-NSString+MLNAdditions.h
-NSURL+MLNAdditions.h
 NSValue+MLNAdditions.h
-NSValue+MLNStyleAttributeAdditions.h
-UIColor+MLNAdditions.h
-UIDevice+MLNAdditions.h
-UIImage+MLNAdditions.h
-UIView+MLNAdditions.h
-UIViewController+MLNAdditions.h

@keith keith marked this pull request as ready for review January 29, 2024 22:07
@keith
Copy link
Collaborator Author

keith commented Jan 29, 2024

@louwers fun one for you

@louwers
Copy link
Collaborator

louwers commented Jan 30, 2024

This looks good to me.

This does remove some headers as is that we might want to add back though:

I think these are intended to be private headers. If someone complains though, it will be pretty easy to fix.

This probably results in the import being different for folks using #import <MapLibre/MapBox.h> syntax

I think before the 6.0.0 release it used to be #import <Mapbox.h>. It was not intended to change to MapLibre/Mapbox.h... But @import MapLibre should be the prefered way to consume the library.

One question though: what steps are needed to update npm packages now?

@keith
Copy link
Collaborator Author

keith commented Jan 30, 2024

So when node packages are updated now the build will fail CI until this new file is re-sync'd with:

bazel run -- @pnpm//:pnpm --dir $PWD install --lockfile-only

@louwers louwers requested a review from mwilsnd January 30, 2024 19:50
@bsudekum
Copy link
Contributor

bsudekum commented Feb 2, 2024

Hey folks, can we merge this one?

@keith
Copy link
Collaborator Author

keith commented Feb 7, 2024

@louwers want to merge this one?

@louwers louwers merged commit 5cd2f73 into maplibre:main Feb 7, 2024
30 checks passed
@louwers
Copy link
Collaborator

louwers commented Feb 7, 2024

@keith @bsudekum Yes! Thanks for the reminder (am out of office, back this Friday). 🙏

@keith keith deleted the ks/node-fixes branch February 7, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to build, configuration or CI/CD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove dependency on globally installed Node to build iOS
3 participants