docs: confusing setAssetPath recommendation #9544
Labels
4 - verified
Issues that have been released and confirmed resolved.
docs
Issues relating to documentation updates only.
estimate - 2
Small fix or update, may require updates to tests.
p - high
Issue should be addressed in the current milestone, impacts component or core functionality
Milestone
Description
Calcite's get started docs recommend setting this URL for assets:
This URL is a bit misleading because the
assets
part at the end of the above URLs is ignored (because it does not end with/
)To reduce confusion, perhaps the documentation should recommend this url instead:
https://js.arcgis.com/calcite-components/2.9.0/
NOTE - this is not a breaking change. Explanation:
Under the hood, Calcite calls Stencil's getAssetPath:
Given this input:
The end result is:
See that the
/assets/
part is present only once in the final URL, despite being present in the string on the left and on the right.This is because the
new URL()
's 2nd argument does not end in/
, which leads to the last part (assets
) being ignored.See MDN documentation: https://developer.mozilla.org/en-US/docs/Web/API/URL/URL#:~:text=When%20specify%20a,a%20URL.
So, it works right now, but it's confusing. I would recommend the documentation be changed to clearly show a URL like this:
https://js.arcgis.com/calcite-components/2.9.0/
Which Component
all
Resources
No response
The text was updated successfully, but these errors were encountered: