From 7e6d3a32db34c5582b2b92cea233b4246af69188 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Fri, 9 Sep 2022 17:38:21 +0800 Subject: [PATCH] begin refactor to `0.4`, not successful yet --- components/DynamicSquiggleEditor.tsx | 18 +++++++++++++++++ ...amicSquiggleEditorWithImportedBindings.tsx | 20 ------------------- components/Layout.tsx | 2 +- package.json | 1 + pages/squiggle-demo.mdx | 8 ++++++-- 5 files changed, 26 insertions(+), 23 deletions(-) create mode 100644 components/DynamicSquiggleEditor.tsx delete mode 100644 components/DynamicSquiggleEditorWithImportedBindings.tsx diff --git a/components/DynamicSquiggleEditor.tsx b/components/DynamicSquiggleEditor.tsx new file mode 100644 index 0000000..c7ea7ab --- /dev/null +++ b/components/DynamicSquiggleEditor.tsx @@ -0,0 +1,18 @@ +import React from "react"; +import dynamic from "next/dynamic"; + +const SquiggleEditor = dynamic( + () => import("@quri/squiggle-components").then((mod) => mod.SquiggleEditor), + { + loading: () =>

Loading...

, + ssr: false, + } +) + +export function DynamicSquiggleEditor( props: any ) { + return ( + + ) +}; diff --git a/components/DynamicSquiggleEditorWithImportedBindings.tsx b/components/DynamicSquiggleEditorWithImportedBindings.tsx deleted file mode 100644 index bc658fa..0000000 --- a/components/DynamicSquiggleEditorWithImportedBindings.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from "react"; -import dynamic from "next/dynamic"; - -const SquiggleEditorWithImportedBindings = dynamic( - () => import("@quri/squiggle-components").then((mod) => mod.SquiggleEditorWithImportedBindings), - { - loading: () =>

Loading...

, - ssr: false, - } -) - -export function DynamicSquiggleEditorWithImportedBindings( props: any ) { - return ( - - ) -}; diff --git a/components/Layout.tsx b/components/Layout.tsx index f4cbb05..b3dd685 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -10,7 +10,7 @@ export default function Layout({ children }: Props) { return ( <> - GUCEM + squiggle-next-template diff --git a/package.json b/package.json index 0e57d0f..8359547 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "private": true, + "version": "0.0.1", "scripts": { "dev": "next dev", "build": "next build", diff --git a/pages/squiggle-demo.mdx b/pages/squiggle-demo.mdx index 5252c81..4dddec3 100644 --- a/pages/squiggle-demo.mdx +++ b/pages/squiggle-demo.mdx @@ -1,4 +1,4 @@ -import { DynamicSquiggleEditorWithImportedBindings as SquiggleEditor } from "../components/DynamicSquiggleEditorWithImportedBindings" +import { DynamicSquiggleEditor as SquiggleEditor } from "../components/DynamicSquiggleEditor" # Squiggle demonstration @@ -13,6 +13,10 @@ f(z)`} /> We can also import assignments from files that live in `/public/estimates/` of the repo. - + Files you import for bindings have to consist only of assignments: they cannot end in an expression, unless that expression is a record.