Giter VIP home page Giter VIP logo

Comments (4)

kkomelin avatar kkomelin commented on May 12, 2024 1

Thank you @shishkin for experimenting with this. If adding new formats doesn't help, there is no much I can help with.
Let's keep this issue open in case anyone else comes up with a solution.

from isomorphic-dompurify.

kkomelin avatar kkomelin commented on May 12, 2024

Hi @shishkin ,

Thank you for your suggestion. It makes sense.

The isomorhic-unfetch uses microbundle for this purpose, like this:

// package.json
{
    "build": "microbundle src/index.mjs -f cjs,esm,umd && microbundle polyfill/polyfill.mjs -o polyfill/index.js -f cjs --no-sourcemap"
}

However, I'm not sure if the package will work for Deno anyway because of the JSDom dependency which may not work for everywhere.

Anyway, would you like to help with this improvement?

from isomorphic-dompurify.

shishkin avatar shishkin commented on May 12, 2024

I gave it a try but ultimately wasn't able to figure out dynamic imports in the isomorphic ESM case.

After looking at isomorhic-unfetch again, it seems it benefits from the unfetch default export being an async function returning a Promise. That makes it easy to call a dynamic import and chain the promises for a result.

In case of DOMPurify, the default export is an object with functions. And I wasn't able to construct a static export from dynamic imports as I wasn't able to unwrap promises without top level await. And top level await seems only supported on specific targets, so won't cover default ESM case.

Please let me know if I have missed something.

from isomorphic-dompurify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.