-
Notifications
You must be signed in to change notification settings - Fork 77
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
Calcite Components React should auto import web component #6601
Labels
4 - verified
Issues that have been released and confirmed resolved.
calcite-components-react
Issues specific to the @esri/calcite-components-react package.
tooling
Issues relating to build system fixes or improvements.
Milestone
Comments
am-maneaters
added
0 - new
New issues that need assignment.
needs triage
Planning workflow - pending design/dev review.
tooling
Issues relating to build system fixes or improvements.
labels
Mar 14, 2023
Great suggestion. Enabling this will make the wrappers behave closer to the custom-elements output target. cc @benelan |
benelan
added
framework-react
Issues with React framework
1 - assigned
Issues that are assigned to a sprint and a team member.
and removed
0 - new
New issues that need assignment.
needs triage
Planning workflow - pending design/dev review.
labels
May 24, 2023
benelan
added
2 - in development
Issues that are actively being worked on.
and removed
1 - assigned
Issues that are assigned to a sprint and a team member.
labels
Jun 7, 2023
benelan
added a commit
that referenced
this issue
Jun 29, 2023
…ng their React wrapper (#7185) **Related Issue:** #6601 ## Summary Automatically imports and defines Calcite Components when importing the React wrappers. For example, here is a snippet from our React sample: ```jsx import '@esri/calcite-components/dist/components/calcite-button'; import '@esri/calcite-components/dist/components/calcite-icon'; import '@esri/calcite-components/dist/components/calcite-slider'; import { CalciteButton, CalciteIcon, CalciteSlider } from '@esri/calcite-components-react'; ``` The above snippet can now be simplified to the following: ```jsx import { CalciteButton, CalciteIcon, CalciteSlider } from '@esri/calcite-components-react'; ``` ### Note I had to patch the build because Stencil was generating an incorrect import path to the JSX type. I tested in our old output targets repo and it reproduced there as well, so this isn't related to the monorepo change.
benelan
added
3 - installed
Issues that have been merged to master branch and are ready for final confirmation.
and removed
2 - in development
Issues that are actively being worked on.
labels
Jun 29, 2023
Installed and assigned for verification. |
geospatialem
added
4 - verified
Issues that have been released and confirmed resolved.
and removed
3 - installed
Issues that have been merged to master branch and are ready for final confirmation.
labels
Jul 3, 2023
Verified in the example repo's App.js with import React, { useState } from 'react';
import { CalciteButton, CalciteIcon, CalciteSlider } from '@esri/calcite-components-react';
import '@esri/calcite-components/dist/calcite/calcite.css'; |
geospatialem
added
calcite-components-react
Issues specific to the @esri/calcite-components-react package.
and removed
framework-react
Issues with React framework
labels
Aug 14, 2023
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.
calcite-components-react
Issues specific to the @esri/calcite-components-react package.
tooling
Issues relating to build system fixes or improvements.
Summary
Having to import components twice in the React wrapper adds extra complexity to using the package.
i.e.
Intellisense in VSCode knows to auto import the
CalciteNotice
when I use it in JSX, but then I have to manually include web-component import as well. I've resorted to having a single file where I import every calcite component import that I just include in my index file.Desired Outcome
Since the react wrappers are already generated using a set of scripts, we could extend those scripts or write a secondary script that auto attaches
calcite-component
imports to the respectivecalcite-components-react
component.I have a local version of this working using dynamic imports in the
createComponent.js
file that is included in the stencil-react-output-target.Resources
the way i implemented this was at this line, i added
oh, or probably could just use this? https://stenciljs.com/docs/react#includeimportcustomelements
The text was updated successfully, but these errors were encountered: