Skip to content

Different fallbacks specified in different places #10

@domenic

Description

@domenic

Consider the following scenario:

// a.mjs
import "std:infinite-list|https://cdn-a.com/il.mjs";
// b.mjs
import "std:infinite-list|https://cdn-b.com/il.mjs";

Both a.mjs and b.mjs are expressing a dependency on the infinite-list layered API. However, they have specified different fallback URLs. This can be problematic, especially in cases such as custom elements which have global side effects.

Alternate fallback styles, e.g. using package name maps or some other centralized mapping, avoid this problem.

Alternately, we could define a sort of first-fallback-wins rule. In this scenario, assuming std:infinite-list is not implemented, then if b.mjs loads first, a.mjs gets interpreted as if they had written import "https://cdn-b.com/il.mjs". This is kind of strange since that string never appears inside the actual text of a.mjs, but it's not too bad IMO...

Metadata

Metadata

Assignees

No one assigned

    Labels

    fallback semanticsAn issue with the proposed model for falling back from a LAPI to a polyfill

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions