webcomponents / custom-elements-everywhere

Custom Element + Framework Interoperability Tests.
https://custom-elements-everywhere.com
Other
1.19k stars 103 forks source link

Where do the ce-* imports come from? they aren't defined in any package.json #2439

Closed NullVoxPopuli closed 1 month ago

NullVoxPopuli commented 1 month ago

Update: found them! they're in libraries/__shared/webcomponents/src as individual files, rather than top-level packages.

I changed the webcomponents package.json here:

  "type": "module",
  "exports": {
    "./*": "./src/*.js"
  },

And then changed my imports to:

import "webcomponents/ce-without-children";
import "webcomponents/ce-with-children";
import "webcomponents/ce-with-properties";
import "webcomponents/ce-with-event";

(i have no idea what the consequences are for this in the other projects)


I'm looking at adding Ember to this project, and noticed that all the other implementations have

import "ce-without-children";
import "ce-with-children";
import "ce-with-properties";
import "ce-with-event";

without declaring any of those packages in the package.json -- this is generally invalid and breaks strict packagers (such as vite).

Where do these come from? Are they virtual packages from somewhere?

I couldn't find any of them defined anywhere in this repo. Whichever dependencies they come from, I'll need to add to my package.json so that the dep and module graphs are both valid.

(Note that I have not taken the time to debug the webpack builds for the other projects, which would definitively have given me the answer -- I figure asking here would be good SEO for future implementers as well)

Thanks!


For some additional context, I'm trying to build my project to then pass to the existing karma + webpack infra so that I don't have to figure out how to translate the vite plugins to webpack for the ember project. I understand this isn't "how things are done" in this repo, but allowing the per-framework implementation to be a bit closer to the framework's general usage would help with long term maintenance and allow "just anyway" to do updates, rather than have to learn (what is for some people) foreign tooling