From 3c5f5d3a6b59e8175665bb8e3182eefd34e60dac Mon Sep 17 00:00:00 2001
From: arose <alexander.rose@weirdbyte.de>
Date: Fri, 23 Mar 2018 07:07:01 -0700
Subject: [PATCH] wip, started mol-gl

---
 package.json                   |  9 +++++++--
 src/apps/render-test/index.tsx | 11 +++++++++++
 src/apps/render-test/ui.tsx    | 15 +++++++++++++++
 src/mol-gl/context.ts          | 12 ++++++++++++
 tsconfig.json                  |  1 +
 5 files changed, 46 insertions(+), 2 deletions(-)
 create mode 100644 src/apps/render-test/index.tsx
 create mode 100644 src/apps/render-test/ui.tsx
 create mode 100644 src/mol-gl/context.ts

diff --git a/package.json b/package.json
index e45c4f85d..2a5a30992 100644
--- a/package.json
+++ b/package.json
@@ -49,9 +49,11 @@
     "@types/jest": "^22.1.3",
     "@types/node": "^9.4.6",
     "@types/node-fetch": "^1.6.7",
-    "argparse": "^1.0.10",
+    "@types/react": "^16.0.4",
+    "@types/react-dom": "^16.0.4",
     "benchmark": "^2.1.4",
     "jest": "^22.4.2",
+    "regl": "git+https://github.com/regl-project/regl.git#45c6ec570232420fca21567499c9c5a2a054432e",
     "rollup": "^0.56.2",
     "rollup-plugin-buble": "^0.19.2",
     "rollup-plugin-commonjs": "^8.3.0",
@@ -65,7 +67,10 @@
     "util.promisify": "^1.0.0"
   },
   "dependencies": {
+    "argparse": "^1.0.10",
     "express": "^4.16.2",
-    "node-fetch": "^2.0.0"
+    "node-fetch": "^2.0.0",
+    "react": "^16.2.0",
+    "react-dom": "^16.2.0"
   }
 }
diff --git a/src/apps/render-test/index.tsx b/src/apps/render-test/index.tsx
new file mode 100644
index 000000000..2647621e8
--- /dev/null
+++ b/src/apps/render-test/index.tsx
@@ -0,0 +1,11 @@
+/**
+ * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ *
+ * @author Alexander Rose <alexander.rose@weirdbyte.de>
+ */
+
+import UI from './ui'
+import * as React from 'react'
+import * as ReactDOM from 'react-dom'
+
+ReactDOM.render(<UI/>, document.getElementById('app'));
\ No newline at end of file
diff --git a/src/apps/render-test/ui.tsx b/src/apps/render-test/ui.tsx
new file mode 100644
index 000000000..09f3215c8
--- /dev/null
+++ b/src/apps/render-test/ui.tsx
@@ -0,0 +1,15 @@
+/**
+ * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ *
+ * @author Alexander Rose <alexander.rose@weirdbyte.de>
+ */
+
+import * as React from 'react'
+
+export default class Root extends React.Component {
+    render() {
+        return <div style={{ position: 'absolute', top: 0, right: 0, left: 0, bottom: 0, overflow: 'hidden' }}>
+            
+        </div>
+    }
+}
\ No newline at end of file
diff --git a/src/mol-gl/context.ts b/src/mol-gl/context.ts
new file mode 100644
index 000000000..0e0984bd5
--- /dev/null
+++ b/src/mol-gl/context.ts
@@ -0,0 +1,12 @@
+/**
+ * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ *
+ * @author Alexander Rose <alexander.rose@weirdbyte.de>
+ */
+
+import REGL = require('regl');
+import { InitializationOptions } from 'regl'
+
+export function create(params: InitializationOptions) {
+    return REGL(params)
+}
diff --git a/tsconfig.json b/tsconfig.json
index 9e38e8784..f8761db56 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -9,6 +9,7 @@
         "strictNullChecks": true,
         "strictFunctionTypes": true,
         //"downlevelIteration": true,
+        "jsx": "react",
         "lib": [ "es6", "dom", "esnext.asynciterable", "es2016" ],
         "outDir": "build/node_modules",
         "baseUrl": "src",
-- 
GitLab