-
Notifications
You must be signed in to change notification settings - Fork 41
replaces http-server with a live-reloading rollup dev server
#39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| <!-- | ||
|
|
||
| Copyright (c) 2020, the Regular Table Authors. | ||
|
|
||
| This file is part of the Regular Table library, distributed under the terms of | ||
| the Apache License 2.0. The full license can be found in the LICENSE file. | ||
|
|
||
| --> | ||
|
|
||
| <!-- | ||
|
|
||
| Entry point for serving the examples from [`regular-table`](https://github.com/jpmorganchase/regular-table). | ||
|
|
||
| --> | ||
|
|
||
| <!DOCTYPE html> | ||
| <html> | ||
|
|
||
| <head> | ||
|
|
||
| <meta name="viewport" | ||
| content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | ||
|
|
||
| <style> | ||
| #list { | ||
| display: flex; | ||
| flex-direction: column; | ||
| } | ||
| </style> | ||
|
|
||
| </head> | ||
|
|
||
| <body> | ||
|
|
||
| <div id="list"> | ||
| <a href="2d_array.html">2d_array.html</a> | ||
| <a href="benchmark.html">benchmark.html</a> | ||
| <a href="canvas_data_model.html">canvas_data_model.html</a> | ||
| <a href="file_browser.html">file_browser.html</a> | ||
| <a href="minesweeper.html">minesweeper.html</a> | ||
| <a href="perspective_headers.html">perspective_headers.html</a> | ||
| <a href="perspective.html">perspective.html</a> | ||
| <a href="react.html">react.html</a> | ||
| <a href="spreadsheet.html">spreadsheet.html</a> | ||
| <a href="two_billion_rows.html">two_billion_rows.html</a> | ||
| <a href="virtual_indices.html">virtual_indices.html</a> | ||
| <a href="web_worker.html">web_worker.html</a> | ||
| </div> | ||
|
|
||
| </body> | ||
|
|
||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,13 @@ | ||
| module.exports = { | ||
| server: { | ||
| command: "yarn start -p 8081", | ||
| command: "yarn start --port 8081", | ||
| launchTimeout: 30000, | ||
| port: 8081, | ||
| waitOnScheme: { | ||
| resources: [ | ||
| "dist/css/material.css", | ||
| "dist/umd/regular-table.js", | ||
| ], | ||
| }, | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,47 @@ | ||
| import {terser} from "rollup-plugin-terser"; | ||
| import babel from "@rollup/plugin-babel"; | ||
| import filesize from "rollup-plugin-filesize"; | ||
| import postcss from "rollup-plugin-postcss" | ||
| import sourcemaps from "rollup-plugin-sourcemaps"; | ||
| import babel from "@rollup/plugin-babel"; | ||
| import {terser} from "rollup-plugin-terser"; | ||
|
|
||
| export default { | ||
| export default [{ | ||
| input: "src/less/material.less", | ||
| output: { | ||
| dir: "dist/css", | ||
| }, | ||
| plugins: [ | ||
| postcss({ | ||
| inject: false, | ||
| extract: "material.css", | ||
| sourceMap: false, | ||
| minimize: true, | ||
| }), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ], | ||
| watch: { | ||
| clearScreen: false, | ||
| }, | ||
| }, | ||
| { | ||
| input: "src/js/index.js", | ||
| output: { | ||
| sourcemap: true, | ||
| file: "dist/umd/regular-table.js", | ||
| }, | ||
| plugins: [ | ||
| babel({ | ||
| exclude: "node_modules/**", | ||
| babelHelpers: "bundled", | ||
| }), | ||
| sourcemaps(), | ||
| filesize(), | ||
| postcss({ | ||
| inject: false, | ||
| sourceMap: false, | ||
| minimize: true, | ||
| }), | ||
| sourcemaps(), | ||
| terser(), | ||
| ], | ||
| watch: { | ||
| clearScreen: false, | ||
| }, | ||
| output: { | ||
| sourcemap: true, | ||
| file: "dist/umd/regular-table.js", | ||
| }, | ||
| }; | ||
| }]; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import babel from "@rollup/plugin-babel"; | ||
| import filesize from "rollup-plugin-filesize"; | ||
| import livereload from "rollup-plugin-livereload" | ||
| import postcss from "rollup-plugin-postcss" | ||
| import serve from "rollup-plugin-serve" | ||
| import sourcemaps from "rollup-plugin-sourcemaps"; | ||
|
|
||
| export default commandLineArgs => { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is 99% identical to |
||
| const port = +commandLineArgs.port || 8080; | ||
| // ref: https://github.com/rollup/rollup/issues/2694#issuecomment-463915954 | ||
| delete commandLineArgs.port; | ||
|
|
||
| return [{ | ||
| input: "src/less/material.less", | ||
| output: { | ||
| dir: "dist/css", | ||
| }, | ||
| plugins: [ | ||
| postcss({ | ||
| inject: false, | ||
| extract: "material.css", | ||
| sourceMap: true, | ||
| }) | ||
| ], | ||
| watch: { | ||
| clearScreen: false, | ||
| }, | ||
| }, | ||
| { | ||
| input: "src/js/index.js", | ||
| output: { | ||
| sourcemap: true, | ||
| file: "dist/umd/regular-table.js", | ||
| }, | ||
| plugins: [ | ||
| babel({ | ||
| exclude: "node_modules/**", | ||
| babelHelpers: "bundled", | ||
| }), | ||
| filesize(), | ||
| livereload("dist"), | ||
| postcss({ | ||
| inject: false, | ||
| sourceMap: true, | ||
| }), | ||
| serve({ | ||
| contentBase: [".", "examples"], | ||
| port | ||
| }), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no nice way to say this - |
||
| sourcemaps(), | ||
| ], | ||
| watch: { | ||
| clearScreen: false, | ||
| }, | ||
| }]; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,9 +8,11 @@ | |
| * | ||
| */ | ||
|
|
||
| import {css, log_perf, html, throttlePromise} from "./utils"; | ||
| import {log_perf, html, throttlePromise} from "./utils"; | ||
| import {DEBUG, BROWSER_MAX_HEIGHT, DOUBLE_BUFFER_RECREATE, DOUBLE_BUFFER_ROW, DOUBLE_BUFFER_COLUMN} from "./constants"; | ||
|
|
||
| import container_css from "../less/container.less"; | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is great to remove but it leaves the vestigial code - the babel plugin and symbol in |
||
| /** | ||
| * Handles the virtual scroll pane, as well as the double buffering | ||
| * of the underlying <table>. This DOM structure looks a little like | ||
|
|
@@ -64,7 +66,6 @@ export class RegularVirtualTableViewModel extends HTMLElement { | |
| create_shadow_dom() { | ||
| this.attachShadow({mode: "open"}); | ||
| const slot = `<slot></slot>`; | ||
| const container_css = css`src/less/container.less`; | ||
| this.shadowRoot.innerHTML = html` | ||
| <style> | ||
| ${container_css} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really not fortunate that this builds twice ..