Open odoe opened 1 week ago
Confirm regular Vite setup doesn't add the same message with our example
@odoe I can't reproduce the same-version warning with the vite example. Do you have any suggestions on how to get the warning?
@jcfranco I made a repro here https://github.com/odoe/calcite-dupe-issue
It updates the main.js
to do both defineCustomElements
and an import from map components. This will trigger the loading of the config file from two different dist folders in calcite.
import './style.css';
// loads calcite from components folder
import { defineCustomElements as defineCalciteElements } from "@esri/calcite-components/dist/loader";
// loads calcite from esm folder
import "@arcgis/map-components/dist/components/arcgis-map";
defineCalciteElements(window, {
resourcesUrl: "https://js.arcgis.com/calcite-components/2.10.1/assets",
});
const loader = document.createElement('calcite-loader');
document.body.appendChild(loader);
Check existing issues
Description
Currently, when the
globalThis.calciteConfig
is checked if a Calcite version is loaded, it emits a message that doesn't distinguish if the same version or a different version was loaded.There are cases when the same version could be loaded if an app that uses Stencil built components mixes
import
of components anddefineCustomElements
, which is probably not best practice.Not sure what the message when the same version is loaded should be, but definitely a distinct warning when a different version is loaded, probably means something went wrong.
Acceptance Criteria
Relevant Info
No response
Which Component
calcite-components/src/utils/config.ts
Example Use Case
No response
Priority impact
impact - p3 - not time sensitive
Calcite package
Esri team
ArcGIS Maps SDK for JavaScript