Skip to content

use with for json modules instead of assert#4092

Merged
birkskyum merged 1 commit intomaplibre:mainfrom
birkskyum:use-with-instead-of-assert
May 8, 2024
Merged

use with for json modules instead of assert#4092
birkskyum merged 1 commit intomaplibre:mainfrom
birkskyum:use-with-instead-of-assert

Conversation

@birkskyum
Copy link
Copy Markdown
Member

@birkskyum birkskyum commented May 8, 2024

The JSON modules / import attribute syntax has been changed from assert to with, which it appear to finally stabilize on.

https://github.com/tc39/proposal-json-modules
https://github.com/tc39/proposal-import-attributes/

@birkskyum birkskyum changed the title use with for json modules instead of assert use with for json modules instead of assert May 8, 2024
@HarelM
Copy link
Copy Markdown
Collaborator

HarelM commented May 8, 2024

Does it require a newer node version? Does it create any rollup issue?
I'm surprised nothing is failing...

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.34%. Comparing base (3d0f0db) to head (d78e2e4).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4092      +/-   ##
==========================================
- Coverage   86.61%   86.34%   -0.28%     
==========================================
  Files         241      241              
  Lines       32518    32518              
  Branches     2145     2008     -137     
==========================================
- Hits        28165    28077      -88     
- Misses       3395     3476      +81     
- Partials      958      965       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@birkskyum
Copy link
Copy Markdown
Member Author

birkskyum commented May 8, 2024

I believe it works because the with syntax has been added in minor versions, like here for 18.20 (nodejs/node#52165), and must be the same for node 20.

@birkskyum birkskyum merged commit b6e1c0a into maplibre:main May 8, 2024
jleedev added a commit to jleedev/maplibre-style-spec that referenced this pull request May 20, 2024
HarelM pushed a commit to maplibre/maplibre-style-spec that referenced this pull request May 20, 2024
* use `with` for json modules instead of `assert`

See maplibre/maplibre-gl-js#4092

* Add a changelog entry
ToHold pushed a commit to ToHold/maplibre-gl-js that referenced this pull request Oct 31, 2025
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.

3 participants