Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.
This repository was archived by the owner on Mar 25, 2026. It is now read-only.

Support gating with Progressive Enhancement or Graceful Degredation #153

Description

@Westbrook

With import attributes being a feature of module imports that hoist, has there been thought put into how to support them with Progressive Enhancement or Graceful Degredation? Maybe this is enough:

try {
  import('./styles.css', { with: { type: 'css' } });
  import('./modern.js');
} catch (e) {
  import('./legacy.js');
}

But it feels so awkward to rely on try/catch with dynamic imports, which may later have more dynamically imported content included, powering the feature gate.

This is so much like the move to ES Modules at large where we got access to nomodule to unlock access to a build with modules and a separate one without. A noattributes sort of attribute could be a great place to start the conversation.

I remember a lot of feature checking conversation in the wake of nomodule, so maybe there are better options in the intervening years?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions