Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -812,12 +812,9 @@ function renderJSXElement(
[UTOPIA_PATH_KEY]: optionalMap(EP.toString, elementPath),
}

const looksLikeReactIntrinsicButNotHTML = elementIsIntrinsic && !elementIsBaseHTML

const finalProps =
looksLikeReactIntrinsicButNotHTML || elementIsFragment
? filterDataProps(propsIncludingElementPath)
: propsIncludingElementPath
const finalProps = elementIsFragment
? filterDataProps(propsIncludingElementPath)
: propsIncludingElementPath

if (!elementIsFragment && FinalElement == null) {
throw canvasMissingJSXElementError(jsxFactoryFunctionName, code, jsx, filePath, highlightBounds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as RemixServerRuntime from '@remix-run/server-runtime'
import * as Hydrogen from '@shopify/hydrogen'
import React from 'react' // this is imported like this so that the monkey patching will run
import * as ReactDOM from 'react-dom'
import * as ReactDOMServer from 'react-dom/server'
import * as ReactRouter from 'react-router'
import * as ReactJsxRuntime from 'react/jsx-runtime'
import * as UtopiaAPI from 'utopia-api'
Expand Down Expand Up @@ -75,6 +76,11 @@ export function createBuiltInDependenciesList(
builtInDependency('react/jsx-runtime', ReactJsxRuntime, editorPackageJSON.dependencies.react),
builtInDependency('react', React, editorPackageJSON.dependencies.react),
builtInDependency('react-dom', ReactDOM, editorPackageJSON.dependencies['react-dom']),
builtInDependency(
'react-dom/server',
ReactDOMServer,
editorPackageJSON.dependencies['react-dom'],
),
builtInDependency(
'@emotion/react',
EmotionReact,
Expand Down
5 changes: 5 additions & 0 deletions editor/src/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
<script defer type="module" src="/editor-entry-point.tsx"></script>
<% } %>

<script
type="module"
src="https://shopify.github.io/storefront-components/standalone-library.js"
></script>

<!--preloadVSCode-->

<!--preloadProjectDependencies-->
Expand Down
18 changes: 9 additions & 9 deletions editor/src/utils/canvas-react-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ export function makeCanvasElementPropsSafe(props: any): any {
}

function shouldIncludeDataUID(type: any): boolean {
if (typeof type === 'string') {
const elementIsIntrinsic = firstLetterIsLowerCase(type)
const elementIsBaseHTML = isIntrinsicHTMLElementString(type)
// Looks like an intrinsic element (div/span/etc), but isn't a recognised
// React intrinsic HTML element.
if (elementIsIntrinsic && !elementIsBaseHTML) {
return false
}
}
// if (typeof type === 'string') {
// const elementIsIntrinsic = firstLetterIsLowerCase(type)
// const elementIsBaseHTML = isIntrinsicHTMLElementString(type)
// // Looks like an intrinsic element (div/span/etc), but isn't a recognised
// // React intrinsic HTML element.
// if (elementIsIntrinsic && !elementIsBaseHTML) {
// return false
// }
// }
return true
}

Expand Down