Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be here? Seems like a dup of line 15. Can either be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me test it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not work without it... the import in the dot block probably is a typescript thing... not sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand it correctly, the
.
export will pull fromdist/shoelace.js
:And the
./shoelace.js
export will also pull from the same place.The latter seems redundant, but I'm not sure which is better. The only time one should pull from
shoelace.js
is when you want the entire library to load. Depending on the bundler, tree shaking may not work as expected (looking at you, webpack!)So I wonder if we should discourage pulling from
@shoelace-style/shoelace
without specifying a specific file, be itshoelace.js
(all components) or specific components/utils.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it fail using:
or this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good. This will mean that CDN paths will be out of sync since they still need the
dist
for jsDelivr, but once we move to our own CDN we can remap that too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'm actually not sure if CDN users will be able to remove
dist
now too. Might have to do a test release. The best hint I can find whether JSDelivr supports this or not is here:jsdelivr/jsdelivr#18298 (comment)
Has anyone tried this before with jsDelivr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on that comment, it should probably work... but never tested it... maybe open a Discussion to bring more visibility to this question?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got some clarification:
The previous comment was intended for esm.run, which has a known issue with singletons so I can't use that at the moment.
After looking through the docs, I think leaving
dist
in both paths for now will be best to avoid confusion. When Shoelace moves to its own CDN, which is something I'd like to do, we can probably remap it there and removedist
from both at the same time.I'll make this update shortly. Thanks again!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 6c7d7f4.