GoogleChromeLabs / GoogleChromeLabs/container-query-polyfill

Script breaks Leaflet implementation

Open
#89 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.1k
Forks
48
PR merge metrics
No merged PRs in 30d

Description

When adding the polyfill like this:

```javascript

```

it may interfere with Leaflet implementations as it writes a function to the global "L" variable.

In my concrete case window.L is a function with the following content:

```javascript
function L(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128||95===e}
```

When i add the script tag with type="module" it works but i dont know if it works correctly that way...

Do you have any advice or could you provide an update, that avoids messing with the window object?

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue by loading container-query-polyfill.modern.js alongside Leaflet and checking the window.L value before and after loading. Then inspect the polyfill entry point responsible for the global assignment and determine how the behavior changes with type="module". Done means Leaflet's global remains intact while the polyfill still operates correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.