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

FIX CJS issue due to QuickLRU #39

Merged
merged 1 commit into from
Mar 8, 2024
Merged

FIX CJS issue due to QuickLRU #39

merged 1 commit into from
Mar 8, 2024

Conversation

jonathanlurie
Copy link
Collaborator

@jonathanlurie jonathanlurie commented Mar 6, 2024

RD-213

Objective

Make the client lib work with CommonJS

Description

So far was not working because the dependency QuickLRU is not CJS compatible. For its CJS target, the client lib now fully integrates QuickLRU into the bundle so that it does not need to be bundled by projects using the client lib.

Acceptance

The Client lib works on cjs.

Runing node main.cjs on the following file:

// main.cjs

const maptilerClient = require("@maptiler/client");
maptilerClient.config.apiKey = "YOUR_API_KEY";

(async () => {
  const result = await maptilerClient.geocoding.forward("Paris, France");
  console.log(JSON.stringify(result, null, 2));
})();

Checklist

  • I have added relevant info to the CHANGELOG.md

Copy link
Member

@petrsloup petrsloup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jonathanlurie jonathanlurie merged commit 305cf83 into main Mar 8, 2024
1 check passed
@jonathanlurie jonathanlurie deleted the RD-213 branch March 8, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants