Skip to content

Commit 10c1339

Browse files
disabled experimental components support
1 parent 858f26a commit 10c1339

4 files changed

Lines changed: 17 additions & 9 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.out.js

editor/scaffolds/canvas/isolate-mode.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { Dialog } from "@material-ui/core";
1212
import { FullScreenPreview } from "scaffolds/preview-full-screen";
1313
import { VanillaESBuildAppRunner } from "components/app-runner";
1414
import bundler from "@code-editor/esbuild-services";
15+
import assert from "assert";
1516

1617
const esbuild_base_html_code = `<div id="root"></div>`;
1718

@@ -95,12 +96,8 @@ export function IsolateModeCanvas({ onClose }: { onClose: () => void }) {
9596
return;
9697
}
9798

98-
const transform = (s, n) => {
99-
return `import React from 'react'; import ReactDOM from 'react-dom';
100-
${s}
101-
const App = () => <><${n}/></>
102-
ReactDOM.render(<App />, document.querySelector('#root'));`;
103-
};
99+
assert(state.editingCode.componentName, "component name is required");
100+
assert(state.editingCode.raw, "raw input code is required");
104101

105102
setIsbuilding(true);
106103
bundler(
@@ -198,3 +195,10 @@ const EditorCanvasSkeleton = () => {
198195
/>
199196
);
200197
};
198+
199+
const transform = (s, n) => {
200+
return `import React from 'react'; import ReactDOM from 'react-dom';
201+
${s}
202+
const App = () => <><${n}/></>
203+
ReactDOM.render(<App />, document.querySelector('#root'));`;
204+
};

packages/designto-code/universal/design-to-code.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export async function designToCode({
8484

8585
const vanilla_token = tokenize(input.entry, tokenizer_config);
8686

87+
/* COMPONENT SUPPORT IS DISABLED.
8788
// post token processing for componentization
8889
let reusable_widget_tree;
8990
if (!build_config.disable_components) {
@@ -97,10 +98,11 @@ export async function designToCode({
9798
console.error("error while building reusable widget tree.", _);
9899
}
99100
}
101+
*/
100102

101103
const _tokenized_widget_input = {
102104
widget: vanilla_token,
103-
reusable_widget_tree: reusable_widget_tree,
105+
// reusable_widget_tree: reusable_widget_tree,
104106
};
105107

106108
const _extend_result = {
@@ -165,7 +167,6 @@ export async function designToCode({
165167
// @ts-ignore
166168
framework_config.framework
167169
}" is not supported at this point.`;
168-
return;
169170
}
170171

171172
export const designTo = {
@@ -314,7 +315,7 @@ export async function designToVanillaPreview({
314315
}): Promise<output.ICodeOutput> {
315316
const vanillawidget = toVanilla.buildVanillaWidget(
316317
input.widget,
317-
(vanilla_config as any) as config.VanillaFrameworkConfig
318+
vanilla_config as any as config.VanillaFrameworkConfig
318319
);
319320
const res = toVanilla.buildVanillaPreviewFile(vanillawidget, vanilla_config);
320321

packages/designto-react/app/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ export function buildReusableReactApp__Experimental({
7777
tree;
7878
components;
7979
}) {
80+
console.info("starting experimental react reusable components build");
81+
8082
const res = finalizeReactReusable_StyledComponents__Experimental({
8183
tree,
8284
components,

0 commit comments

Comments
 (0)