Project

Profile

Help

Feature #4655

Standard-ESM imports

Added by Michael Kay about 1 year ago. Updated 4 months ago.

Status:
AwaitingInfo
Priority:
Low
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2020-07-24
Due date:
% Done:

0%

Estimated time:
Applies to JS Branch:
2
Fix Committed on JS Branch:
Fixed in JS Release:
SEF Generated with:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

Request received from Max Fechner by email:

Thank you for developing saxonJS!

It would be great if you could support standard-esm imports like

import saxonJS from 'http://www.saxonica.com/saxon.js'

this would work in *deno as well as nodejs as well as modern browsers!

thank you for considering this proposal!

best, Max Fechner

History

#1 Updated by Debbie Lockett 7 months ago

  • Applies to JS Branch 2 added

#2 Updated by Norm Tovey-Walsh 6 months ago

  • Priority changed from Normal to Low

We rely on the Closure compiler to build the release artifacts. As far as I can tell in a couple of days of research, the Closure compiler doesn't offer any options for producing ESM modules and I couldn't find any workarounds that seemed practical. I'll plan to check back periodically, and naturally I'm open to suggestions, but short of support from the compiler, I'm not sure this is something we can do.

#3 Updated by Norm Tovey-Walsh 5 months ago

  • Status changed from New to AwaitingInfo

Using "AwaitingInfo" to indicate that we need support from the Closure compiler (or something else) for this.

#4 Updated by Daniel Naab 4 months ago

Hello,

Not being familiar with Saxon-JS project structure, I don't know if this is a useful suggestion or not, but typically a project would be refactored to internally use ES modules; then a tool like Rollup could be used to create the distributable artifacts (Rollup, for instance, has a Google Closure plugin - https://github.com/ampproject/rollup-plugin-closure-compiler). Rollup can produce a single ESM with obsfucated code, in addition to something like the current IIFE bundle.

If internally Saxon-JS is difficult to convert to ES modules, Rollup also has plugins to use alternate modules types as input. For instance, using AMD modules - https://www.npmjs.com/package/rollup-plugin-amd

I have some familiarity with doing this, and could help clarify your options, if there is any interest. I am exploring a use case that would benefit from ESM usage, also.

Please register to edit this issue

Also available in: Atom PDF Tracking page