Skip to content

JS module and importmap support #92

Description

@tomvanenckevort

New Feature Proposal

Description

Now there is Jint v3 support, there should also be support for JS modules and import maps.

Background

Currently AngleSharp.Js only parses and executes script elements with type="javascript", so it will ignore the newer modules and import maps.
An example of a simple test scenario:

<!doctype html>
<script type="importmap">
    {
        "imports": {
          "jquery": "https://cdn.jsdelivr.net/npm/jquery@4.0.0-beta/+esm"
        }
      }
</script>
<script type="module">
    import { $ } from 'jquery';

    console.log($.toString());
</script>

Specification

The JsScriptingService needs to be updated to also allow processing of module and importmap script elements.
And then depending on the type it will need to run different Jint commands to deal with modules and import maps.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions