maplibre-style-spec icon indicating copy to clipboard operation
maplibre-style-spec copied to clipboard

Add semiliteral operator for expressions inside arrays and objects

Open sargunv opened this issue 11 months ago • 4 comments

Description

The purpose of this PR is to add support for producing arrays with elements calculated by expressions. It's a draft implementation of https://github.com/maplibre/maplibre-style-spec/issues/950.

I implemented it as a single semiliteral operator mirroring the literal syntax, like other lisps have quasiquote and quote. Happy to restructure this into []/{} or some other name as discussed in that design proposal.

Launch Checklist

  • [x] Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • [x] Briefly describe the changes in this PR.
  • [x] Link to related issues.
  • [x] Write tests for all new functionality.
  • [x] Document any changes to public APIs.
  • [ ] Post benchmark scores.
  • [ ] Add an entry to CHANGELOG.md under the ## main section.

sargunv avatar Dec 22 '24 22:12 sargunv

Codecov Report

Attention: Patch coverage is 90.90909% with 5 lines in your changes missing coverage. Please review.

Project coverage is 92.76%. Comparing base (c6fd205) to head (c4e7d47). Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
src/expression/definitions/semiliteral.ts 90.74% 5 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #951      +/-   ##
==========================================
- Coverage   92.78%   92.76%   -0.03%     
==========================================
  Files         107      108       +1     
  Lines        4739     4794      +55     
  Branches     1346     1355       +9     
==========================================
+ Hits         4397     4447      +50     
- Misses        342      347       +5     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Dec 22 '24 22:12 codecov-commenter

@sargunv any updates on this? It seems that this PR is drifting away a bit...

HarelM avatar Aug 17 '25 08:08 HarelM

Ah yeah, I've been focused on maplibre native core stuff and haven't worked on this in a while. Last I remember, we aligned on this general approach in a monthly meeting in May, and next step was to write up some expression naming options and poll the community?

I'll propose some names with background/justification and share in Slack soon

sargunv avatar Aug 17 '25 10:08 sargunv

Yes, I think that was the last action item on this topic.

HarelM avatar Aug 17 '25 11:08 HarelM