Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Protocol parsing in URL resolution #516

Closed
@guybedford

Description

@guybedford

Currently we determine an absolute URL form based on the existence of :, but there are valid use cases for having : in a relative URL.

We should update the code at https://github.com/ModuleLoader/es-module-loader/blob/master/core/resolve.js#L12 to provide proper protocol parsing, following some subset of the rules at https://url.spec.whatwg.org/#host-parsing.

The important thing is that this code is on the performance shortpath so it's nice to do as little work as possible.

The regex /^[^:/?#]+:/ may well be enough to rule out the common cases.

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