carbon-design-system / carbon-for-ibm-dotcom

Carbon for IBM.com is based on the Carbon Design System for IBM
https://www.ibm.com/standards/carbon/
Apache License 2.0
266 stars 157 forks source link

Fix custom-elements.json #10024

Open jogibear9988 opened 1 year ago

jogibear9988 commented 1 year ago

Description

The custom-elements.json seems to be an old version, and the path in the manifest links to the .ts files, but according to the spec it should link to the .js files (it also only makes sense, cause the .js files are the ones that get used).

I need the correct spec for the components to work in my designer: https://node-projects.github.io/web-component-designer-demo/index.html

Component(s) impacted

all

Browser

Chrome

Carbon for IBM.com version

current

Severity

Severity 1 = The design is broken in a critical way that blocks users from completing tasks or damages the brand. Affects major functionality, no workaround.

Application/website

a designer

Package

@carbon/web-components

CodeSandbox example

no sample

Steps to reproduce the issue (if applicable)

No response

Release date (if applicable)

No response

Code of Conduct

emyarod commented 1 year ago

Can you explain more about what you mean by the spec needing to link to .js files? For reference, the playground examples for web-component-analyzer also link to .ts files

but just as a heads up, web-component-analyzer emits this message on every use, so it may be brittle to depend on:

!!!!!!!!!!!!!  WARNING !!!!!!!!!!!!!
The custom-elements.json format is for experimental purposes. You can expect changes to this format.
Please follow and contribute to the discussion at:
  - https://github.com/webcomponents/custom-elements-json
  - https://github.com/w3c/webcomponents/issues/776
!!!!!!!!!!!!!  WARNING !!!!!!!!!!!!!
jogibear9988 commented 1 year ago

This was wrong, see: https://github.com/webcomponents/custom-elements-manifest/issues/96#issuecomment-1037495021

For example, my designer uses the manifest to load the components, but a browser could not load .ts files

emyarod commented 1 year ago

I only see a discussion in your link but I'm not finding the resolution. Either we would have to migrate off of web-component-analyzer or there needs to be an issue opened on that repo instead to correct the analyzer's behavior, is that right?

justinfagnani commented 1 year ago

The module paths need to link to where users and tools can actually import the element from. For TypeScript projects that is _not_the source file. web-components-analyzer is indeed incorrect here. The Lit team is working on a new analyzer that outputs the correct paths (most of the time, if you don't have a different build step after TypeScript). It should be ready enough to generate manifests soon: https://github.com/lit/lit/tree/main/packages/labs/analyzer

emyarod commented 1 year ago

thank you for the clarification! So it looks like the next steps here would be to open an issue against web-components-analyzer, and in the meantime we will also keep an eye on the Lit team's analyzer for a possible migration

stale[bot] commented 1 year ago

We've marked this issue as stale because there hasn't been any activity for 60 days. If there's no further activity on this issue in the next three days then we'll close it. You can keep the conversation going with just a short comment. Thanks for your contributions.

jogibear9988 commented 1 year ago

do not close...

abdonrd commented 1 year ago

@jeffchew @kennylam looks like the v2 version has the same problem.

Could you review it? Thank you!