Skip to content

Fix feature-dependent config expressions #13453

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

brncsk
Copy link
Contributor

@brncsk brncsk commented Apr 9, 2025

This PR aims to fix #13452.

Some remarks:

  • A more roboust alternative to typeEquals would be to ensure that the type constants maintain their identity across the postMessage boundary, but that would be a more involved refactor than what I could do.

  • An alternative to the featureConstant flag in Config would be to store the config expression itself in the instance, and defer to eachChild for determining whether it's feature constant, however I'm not sure that'd work (can the value of a config option change between parsing and evaluating the ["config"] expression)?

Launch Checklist

  • Make sure the PR title is descriptive and preferably reflects the change from the user's perspective.
  • Add additional detail and context in the PR description (with screenshots/videos if there are visual changes).
  • Manually test the debug page.
  • Write tests for all new functionality and make sure the CI checks pass.
  • Document any changes to public APIs.
  • Post benchmark scores if the change could affect performance.
  • Tag @mapbox/map-design-team @mapbox/static-apis if this PR includes style spec API or visual changes.
  • Tag @mapbox/gl-native if this PR includes shader changes or needs a native port.

@brncsk brncsk requested a review from a team as a code owner April 9, 2025 14:30
@CLAassistant
Copy link

CLAassistant commented Apr 9, 2025

CLA assistant check
All committers have signed the CLA.

@brncsk brncsk force-pushed the fix-feature-dependent-config branch from 67e617c to 8e54241 Compare April 9, 2025 16:03
@brncsk brncsk force-pushed the fix-feature-dependent-config branch 2 times, most recently from 1c0aa2a to cdb2c12 Compare April 9, 2025 16:12
This exposes a `featureConstant` property on `Config` instances to
determine at parse time whether the current value (or the default) of
the config option evaluates to a feature-constant expression, and uses
that property in `isFeatureConstant`.
@brncsk brncsk force-pushed the fix-feature-dependent-config branch from 8aab775 to cca3291 Compare April 9, 2025 16:24
@mourner mourner requested a review from stepankuzmin April 9, 2025 16:56
@brncsk brncsk force-pushed the fix-feature-dependent-config branch from 631cb32 to a1f8ba0 Compare April 10, 2025 05:02
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.

Multiple issues wrt. feature-dependent config expressions
2 participants