Problem/Motivation

Quickly tried to use our package via Unpkg's module option and encountered an error.

https://unpkg.com/@drupal-api-client/json-api-client@0.1.0/dist/index.js?module

Doesn't necessarily have to be unpkg, but I'd love to be able to provide an option for this client to be used via a CDN.

Steps to reproduce

Load: https://unpkg.com/@drupal-api-client/json-api-client@0.1.0/dist/index.js?module

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork api_client-3400583

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

brianperry created an issue. See original summary.

brianperry’s picture

Status: Active » Needs review
brianperry’s picture

It actually looks like jsdelivr / esm.run is smart enough to handle this today.

https://esm.run/@drupal-api-client/json-api-client

Codepen:

https://codepen.io/brianperry/pen/gOyboza

Still don't see how targeting es2020 would hurt. Would be nice to support unpkg as well.

coby.sher’s picture

Status: Needs review » Reviewed & tested by the community
brianperry’s picture

Status: Reviewed & tested by the community » Fixed

The most recent release did in fact resolve the error when using json-api-client as a module on unpkg:

https://unpkg.com/@drupal-api-client/json-api-client@0.7.2/dist/index.mjs?module

But I still can't seem to use it in a codepen:

https://codepen.io/brianperry/pen/BaELdOx?editors=1111

I think we can mark this as fixed though - we have one functional CDN example we can suggest. We can open an issue specific to unpkg if there is demand.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.