Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update calciteConfig message when same or different versions #9721

Closed
2 of 8 tasks
odoe opened this issue Jul 1, 2024 · 5 comments
Closed
2 of 8 tasks

Update calciteConfig message when same or different versions #9721

odoe opened this issue Jul 1, 2024 · 5 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. calcite-components Issues specific to the @esri/calcite-components package. enhancement Issues tied to a new feature or request. estimate - 3 A day or two of work, likely requires updates to tests. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - high Issue should be addressed in the current milestone, impacts component or core functionality

Comments

@odoe
Copy link

odoe commented Jul 1, 2024

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 and defineCustomElements, 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

  • Two messages for when the same Calcite version or a different Calcite version is loaded.
  • Confirm regular Vite setup doesn't add the same message with our example

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/calcite-components
  • @esri/calcite-components-angular
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Maps SDK for JavaScript

@odoe odoe added 0 - new New issues that need assignment. enhancement Issues tied to a new feature or request. needs triage Planning workflow - pending design/dev review. labels Jul 1, 2024
@github-actions github-actions bot added ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. calcite-components Issues specific to the @esri/calcite-components package. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive labels Jul 1, 2024
@geospatialem geospatialem added this to the 2024-07-30 - Jul Release milestone Jul 3, 2024
@geospatialem geospatialem added p - high Issue should be addressed in the current milestone, impacts component or core functionality 1 - assigned Issues that are assigned to a sprint and a team member. estimate - 3 A day or two of work, likely requires updates to tests. and removed 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Jul 3, 2024
@jcfranco
Copy link
Member

jcfranco commented Jul 5, 2024

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?

@odoe
Copy link
Author

odoe commented Jul 5, 2024

@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);

jcfranco added a commit that referenced this issue Jul 15, 2024
**Related Issue:** #9721

## Summary

This updates the message displayed when components load to show the
version, build date and revision (similar to Maps SDK). It will log an
info message instead of a warning as it could be misinterpreted and
would also show up multiple times when a bundled `calcite-components`
version would be overridden.

**Note**: `console.info` messages will be omitted by default across all
tests to avoid noise
@jcfranco
Copy link
Member

@odoe @COV-GIS Thanks for your help on this one! ✨💪✨

We changed the approach to instead display an info message showing the stamped version to avoid confusion when the same or mismatched versions are encountered. The PR description adds a bit more detail if you're curious.

@jcfranco jcfranco added 2 - in development Issues that are actively being worked on. 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 1 - assigned Issues that are assigned to a sprint and a team member. 2 - in development Issues that are actively being worked on. labels Jul 15, 2024
Copy link
Contributor

Installed and assigned for verification.

@github-actions github-actions bot assigned geospatialem and DitwanP and unassigned jcfranco Jul 15, 2024
@DitwanP
Copy link
Contributor

DitwanP commented Jul 15, 2024

🍡 Verified on 2.11.0-next.9

@DitwanP DitwanP closed this as completed Jul 15, 2024
@DitwanP DitwanP removed the 3 - installed Issues that have been merged to master branch and are ready for final confirmation. label Jul 15, 2024
@DitwanP DitwanP added the 4 - verified Issues that have been released and confirmed resolved. label Jul 15, 2024
calcite-admin pushed a commit that referenced this issue Jul 30, 2024
**Related Issue:** #9721

## Summary

This updates the message displayed when components load to show the
version, build date and revision (similar to Maps SDK). It will log an
info message instead of a warning as it could be misinterpreted and
would also show up multiple times when a bundled `calcite-components`
version would be overridden.

**Note**: `console.info` messages will be omitted by default across all
tests to avoid noise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. calcite-components Issues specific to the @esri/calcite-components package. enhancement Issues tied to a new feature or request. estimate - 3 A day or two of work, likely requires updates to tests. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - high Issue should be addressed in the current milestone, impacts component or core functionality
Projects
None yet
Development

No branches or pull requests

4 participants