diff --git a/package.json b/package.json index e45c4f85d21c7609993a88c3dd4f5b37c60e29b4..2a5a30992925b711e3321b6a3b9683a5fe54fbd3 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 0000000000000000000000000000000000000000..2647621e8127891712acd5889ca58517410ebbb1 --- /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 0000000000000000000000000000000000000000..09f3215c8a36cdb0410af0796eb548381708699b --- /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 0000000000000000000000000000000000000000..0e0984bd5e87e6a531555276c28bb5619b166d24 --- /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 9e38e8784c1b9e921240961b298dcb1b5c3b98f7..f8761db56ee42b220f37b1a7991e4209521b7694 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",