0

I'm trying to create a simple proof-of-concept of using Deno to bundle a browser application which is using Lit. Basic functionality (e.g., initial component rendering) is functional, but I'm unable to get simple DOM manipulations to trigger the reactive property changes.

My simple example can be seen working at this Lit Playground example. An example which does not work is this Deno bundle version. These 2 versions have the exact same source code (i.e., index.html and main.ts).

You can view all of the code and the build process for creating the Deno bundle here.

Is Deno capable of producing bundles which behave in the expected manner?

tgd25
  • 48
  • 1
  • 7
  • 1
    FWIW: I've experienced infrequent but ongoing issues with `swc`, the bundler used by Deno: multiple kinds of issues like elided exports, improperly named exports, lack of tree-shaking, etc. The maintainer of `swc` is just a single dev (although he's extremely ambitious). You also have to understand that skypack and other "ESM CDNs" apply transforms to their hosted module code, so this is yet another variable in the process of using in Deno a package written for Node. Don't give up, but just know there's lots of complexity in the interop strategies employed by the system you're using. – jsejcksn Dec 08 '21 at 20:39

2 Answers2

0

Deno 1.17.2 is able to successfully create a bundle. See https://github.com/denoland/deno/issues/13048 for background. As @jsejcksn said, SWC is most likely the culprit for the original issue.

tgd25
  • 48
  • 1
  • 7
0

try https://github.com/mindon/packup which is using esbuild to bundle js for browser.

here's a demo with lit (with locales), material design web and three.js https://github.com/mindon/deno.lit-and-mw3.demo

mindon
  • 318
  • 4
  • 13