Skip to content

Commit

Permalink
fix(react)!: disable includeImportCustomElements to resolve initial r…
Browse files Browse the repository at this point in the history
…ender issues (#8248)

**Related Issue:** #8143

## Summary

The `ReferenceError: navigator is not defined` error is still present in
Stencil v4 when removing the patch. Disabled
[`includeImportCustomElements`](https://stenciljs.com/docs/react#includeimportcustomelements)
for now while we investigate an alternative fix that doesn't cause
initial render issues.


BREAKING CHANGE: Disabled `includeImportCustomElements`. Make sure to
import components from `@esri/calcite-components` in addition to the
react wrappers. For example, the first code snippet in #7185 is now
required, or else the custom elements will not be defined on the window.
  • Loading branch information
benelan committed Dec 2, 2023
1 parent 9946ac1 commit 0948c1a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 68 deletions.
3 changes: 1 addition & 2 deletions packages/calcite-components-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
"license": "SEE LICENSE.md",
"scripts": {
"build": "rimraf dist && npm run compile",
"prebuild": "npm run patch:ssr && npm run patch:jsx-import",
"prebuild": "npm run patch:jsx-import",
"clean": "rimraf dist node_modules .turbo",
"compile": "npm run tsc",
"patch:jsx-import": "ts-node support/patchJSXImport.ts",
"patch:ssr": "ts-node support/patchSSR.ts",
"tsc": "tsc"
},
"main": "./dist/index.js",
Expand Down
65 changes: 0 additions & 65 deletions packages/calcite-components-react/support/patchSSR.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/calcite-components/stencil.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export const create: () => Config = () => ({
proxiesFile: "../calcite-components-react/src/components.ts",
excludeComponents: ["context-consumer"],
customElementsDir: "dist/components",
includeImportCustomElements: true,
}),
{ type: "dist-hydrate-script" },
{ type: "dist-custom-elements", customElementsExportBehavior: "auto-define-custom-elements" },
Expand Down

0 comments on commit 0948c1a

Please sign in to comment.