profile
viewpoint
Eryk Napierała erykpiast Poznań, Poland

allegro/turnilo 386

Business intelligence, data exploration and visualization web application for Druid, formerly known as Swiv and Pivot

cyclejs/cycle-time-travel 215

A time traveling debugger for Cycle.js

cyclejs/history 60

MOVED

cyclejs/storage 52

A Cycle.js Driver for using localStorage and sessionStorage.

cyclejs/cycle-fetch-driver 27

Cycle.js for the Fetch API

erykpiast/autocompleted-select 11

Select Web Component with autocompletion. Based on RxJS and VirtualDOM.

erykpiast/angular-duration-format 8

AngularJS filter for formatting time

erykpiast/bs-react-dropzone 6

ReasonML bindings for react-dropzone library

erykpiast/bs-react-syntax-highlighter 4

ReasonML bindings for react-syntax-highlighter library

pull request commentwebpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

This approach is looking really promising to me! I'd be happy if we could make this pipeline easier by removing the ejs templates.

I'm thrilled to see your contributions, @TrySound ❤️. I hope you're not feeling discouraged as we are a bit slow to look through your changes — rest assured that we are happy to see you contribute to webpack-bundle-analyzer 😊

realityking

comment created time in a day

Pull request review commentwebpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

 async function generateReport(bundleStats, opts) {   if (!chartData) return;    await new Promise((resolve, reject) => {-    ejs.renderFile(-      `${projectRoot}/views/viewer.ejs`,-      {+    try {

Looks like there is no need in promise here anymore. The code is sync

realityking

comment created time in a day

PR opened webpack-contrib/webpack-bundle-analyzer

Replace express with builtin node server

Alternative to long-standing https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/212

Express in this project does not add much value. Middleware api is not necessary for 1.5 middlwares. We can try to use node server directly.

Serving static is left for express middleware. Can be replaced with something smaller in another PR.

+88 -42

0 comment

3 changed files

pr created time in a day

startedkenoxa/beamwind

started time in 2 days

startedleonadler/drag-and-drop-across-browsers

started time in 2 days

startedjehna/ga-lite

started time in 2 days

startedloreanvictor/callbag-common

started time in 2 days

startedssbc/ssb-private1

started time in 2 days

startedTribler/py-ipv8

started time in 3 days

startedtrebleshot/android

started time in 3 days

startedstaltz/ssb-db-mock-feed-stream

started time in 5 days

created repositorystaltz/ssb-db-mock-feed-stream

Mock ssb.createFeedStream if you dont need it

created time in 5 days

pull request commentwebpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

They use it to build cli https://github.com/mde/ejs/commit/82a030985891ad7efcfb6be381aeb742c1d25c81#diff-ca900686fca4680d4692bf587dc5da1322879c344688c187b5511cda27902c18R20

realityking

comment created time in 5 days

pull request commentwebpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

ejs started to depend on jake build

Hmm, I wonder why do they need build tool as runtime dependency?

realityking

comment created time in 5 days

pull request commentwebpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

Just to further illustrate this point, these are the dependencies that would no longer be required:

├─┬ ejs@3.1.5
│ └─┬ jake@10.8.2
│   ├── async@0.9.2
│   ├─┬ chalk@2.4.2
│   │ ├─┬ ansi-styles@3.2.1
│   │ │ └─┬ color-convert@1.9.3
│   │ │   └── color-name@1.1.3
│   │ ├── escape-string-regexp@1.0.5
│   │ └─┬ supports-color@5.5.0
│   │   └── has-flag@3.0.0
│   ├─┬ filelist@1.0.1
│   │ └── minimatch@3.0.4 deduped
│   └─┬ minimatch@3.0.4
│     └─┬ brace-expansion@1.1.11
│       ├── balanced-match@1.0.0
│       └── concat-map@0.0.1
realityking

comment created time in 5 days

pull request commentwebpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

Sorry about the force push, I'll refrain from them.

The size difference in node_modules is 1MB with this patch. (11 MB > 10 MB)

realityking

comment created time in 5 days

pull request commentwebpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

ejs started to depend on jake build took since v3 for some reason. v2 was dependency free.

realityking

comment created time in 5 days

Pull request review commentwebpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

-<!DOCTYPE html>+/* eslint-disable max-len */+const path = require('path');+const fs = require('fs');++const _ = require('lodash');++const projectRoot = path.resolve(__dirname, '..');+const assetsRoot = path.join(projectRoot, 'public');++/**+ * Escapes `<` characters in JSON to safely use it in `<script>` tag.+ */+function escapeJson(json) {+  return JSON.stringify(json).replace(/</gu, '\\u003c');+}++function getAssetContent(filename) {+  const assetPath = path.join(assetsRoot, filename);++  if (!assetPath.startsWith(assetsRoot)) {+    throw new Error(`"${filename}" is outside of the assets root`);+  }++  return fs.readFileSync(assetPath, 'utf8');+}++function getScript(filename, mode) {+  if (mode === 'static') {+    return `<!-- ${_.escape(filename)} -->+<script>${getAssetContent(filename)}</script>`;+  } else {+    return `<script src="${_.escape(filename)}"></script>`;+  }+}++function renderViewer({title, enableWebSocket, chartData, defaultSizes, mode} = {}) {+  return `<!DOCTYPE html>
  • Syntax highlighting could be added in some editors/plugins by adding a "fake" tag html. I'll add that as a commit so you can see what it looks like.
  • Agreed that conditionals are more cumbersome but do you expect the templates to get significantly more complex than they are today?
  • This is true (though you also have to be mindful of <%= vs <%- in EJS) and I wouldn't do it for a large server rendered app but as of today there's just two variables in the templates here that need to be escaped.

To me, this is trade-off of complexity. EJS is certainly nicer than template literals but for a template this small it's, IMHO, not worth the cost of the dependencies. Some of which are very old and don't even deduplicate.

realityking

comment created time in 5 days

Pull request review commentwebpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

-<!DOCTYPE html>+/* eslint-disable max-len */+const path = require('path');+const fs = require('fs');++const _ = require('lodash');++const projectRoot = path.resolve(__dirname, '..');+const assetsRoot = path.join(projectRoot, 'public');++/**+ * Escapes `<` characters in JSON to safely use it in `<script>` tag.+ */+function escapeJson(json) {+  return JSON.stringify(json).replace(/</gu, '\\u003c');+}++function getAssetContent(filename) {+  const assetPath = path.join(assetsRoot, filename);++  if (!assetPath.startsWith(assetsRoot)) {+    throw new Error(`"${filename}" is outside of the assets root`);+  }++  return fs.readFileSync(assetPath, 'utf8');+}++function getScript(filename, mode) {+  if (mode === 'static') {+    return `<!-- ${_.escape(filename)} -->+<script>${getAssetContent(filename)}</script>`;+  } else {+    return `<script src="${_.escape(filename)}"></script>`;+  }+}++function renderViewer({title, enableWebSocket, chartData, defaultSizes, mode} = {}) {+  return `<!DOCTYPE html>

I'm not saying that I'm strongly against this PR, no. We can live with these drawbacks, but only if it brings some significant improvements. That's why I asked to provide difference in node_modules sizes.

realityking

comment created time in 5 days

pull request commentwebpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

@realityking may I ask you to not use force-push in the future please as it significantly complicates tracking of changes.

realityking

comment created time in 5 days

Pull request review commentwebpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

-<!DOCTYPE html>+/* eslint-disable max-len */+const path = require('path');+const fs = require('fs');++const _ = require('lodash');++const projectRoot = path.resolve(__dirname, '..');+const assetsRoot = path.join(projectRoot, 'public');++/**+ * Escapes `<` characters in JSON to safely use it in `<script>` tag.+ */+function escapeJson(json) {+  return JSON.stringify(json).replace(/</gu, '\\u003c');+}++function getAssetContent(filename) {+  const assetPath = path.join(assetsRoot, filename);++  if (!assetPath.startsWith(assetsRoot)) {+    throw new Error(`"${filename}" is outside of the assets root`);+  }++  return fs.readFileSync(assetPath, 'utf8');+}++function getScript(filename, mode) {+  if (mode === 'static') {+    return `<!-- ${_.escape(filename)} -->+<script>${getAssetContent(filename)}</script>`;+  } else {+    return `<script src="${_.escape(filename)}"></script>`;+  }+}++function renderViewer({title, enableWebSocket, chartData, defaultSizes, mode} = {}) {+  return `<!DOCTYPE html> <html>   <head>     <meta charset="UTF-8"/>     <meta name="viewport" content="width=device-width, initial-scale=1"/>-    <title><%= title %></title>+    <title>${_.escape(title)}</title>     <link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c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+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />      <script>-      window.enableWebSocket = <%- escapeJson(enableWebSocket) %>;+      window.enableWebSocket = ${escapeJson(enableWebSocket)};     </script>-    <%- include('script', { filename: 'viewer.js' }) %>+    ${getScript('viewer.js', mode)}   </head>    <body>     <div id="app"></div>     <script>-      window.chartData = <%- escapeJson(chartData) %>;-      window.defaultSizes = <%- escapeJson(defaultSizes) %>;+      window.chartData = ${escapeJson(chartData)};+      window.defaultSizes = ${escapeJson(defaultSizes)};     </script>   </body>-</html>+</html>`;+}++exports.renderViewer = renderViewer;

Done

realityking

comment created time in 5 days

pull request commentwebpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

This drops 15(!) packages from the dependencies

What is the difference between node_modules sizes after npm i --production?

realityking

comment created time in 5 days

Pull request review commentwebpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

-<!DOCTYPE html>+/* eslint-disable max-len */+const path = require('path');+const fs = require('fs');++const _ = require('lodash');++const projectRoot = path.resolve(__dirname, '..');+const assetsRoot = path.join(projectRoot, 'public');++/**+ * Escapes `<` characters in JSON to safely use it in `<script>` tag.+ */+function escapeJson(json) {+  return JSON.stringify(json).replace(/</gu, '\\u003c');+}++function getAssetContent(filename) {+  const assetPath = path.join(assetsRoot, filename);++  if (!assetPath.startsWith(assetsRoot)) {+    throw new Error(`"${filename}" is outside of the assets root`);+  }++  return fs.readFileSync(assetPath, 'utf8');+}++function getScript(filename, mode) {+  if (mode === 'static') {+    return `<!-- ${_.escape(filename)} -->+<script>${getAssetContent(filename)}</script>`;+  } else {+    return `<script src="${_.escape(filename)}"></script>`;+  }+}++function renderViewer({title, enableWebSocket, chartData, defaultSizes, mode} = {}) {+  return `<!DOCTYPE html> <html>   <head>     <meta charset="UTF-8"/>     <meta name="viewport" content="width=device-width, initial-scale=1"/>-    <title><%= title %></title>+    <title>${_.escape(title)}</title>     <link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlS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d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />      <script>-      window.enableWebSocket = <%- escapeJson(enableWebSocket) %>;+      window.enableWebSocket = ${escapeJson(enableWebSocket)};     </script>-    <%- include('script', { filename: 'viewer.js' }) %>+    ${getScript('viewer.js', mode)}   </head>    <body>     <div id="app"></div>     <script>-      window.chartData = <%- escapeJson(chartData) %>;-      window.defaultSizes = <%- escapeJson(defaultSizes) %>;+      window.chartData = ${escapeJson(chartData)};+      window.defaultSizes = ${escapeJson(defaultSizes)};     </script>   </body>-</html>+</html>`;+}++exports.renderViewer = renderViewer;

Let's move it above escapeJson function declaration please so exported members become clearly visible.

realityking

comment created time in 5 days

Pull request review commentwebpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

-<!DOCTYPE html>+/* eslint-disable max-len */+const path = require('path');+const fs = require('fs');++const _ = require('lodash');++const projectRoot = path.resolve(__dirname, '..');+const assetsRoot = path.join(projectRoot, 'public');++/**+ * Escapes `<` characters in JSON to safely use it in `<script>` tag.+ */+function escapeJson(json) {+  return JSON.stringify(json).replace(/</gu, '\\u003c');+}++function getAssetContent(filename) {+  const assetPath = path.join(assetsRoot, filename);++  if (!assetPath.startsWith(assetsRoot)) {+    throw new Error(`"${filename}" is outside of the assets root`);+  }++  return fs.readFileSync(assetPath, 'utf8');+}++function getScript(filename, mode) {+  if (mode === 'static') {+    return `<!-- ${_.escape(filename)} -->+<script>${getAssetContent(filename)}</script>`;+  } else {+    return `<script src="${_.escape(filename)}"></script>`;+  }+}++function renderViewer({title, enableWebSocket, chartData, defaultSizes, mode} = {}) {+  return `<!DOCTYPE html>

I see a few drawbacks of this approach:

  • No syntax highlighting
  • Much more difficult to do conditional branching e.g. if/else if we'll need it in the future.
  • You have to remember to call _.escape manually
realityking

comment created time in 5 days

pull request commentwebpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

Please fix lint errors ☺️

realityking

comment created time in 5 days

startedtc39/proposal-error-cause

started time in 6 days

PR opened webpack-contrib/webpack-bundle-analyzer

Replace ejs templates with a simple js file

This PR replaces the EJS based templates with a simple JS file using template strings.

webpack-bundle-analyzer uses very little HTML templating since most of the client is a SPA. What is used, can be replaced by a straightforward JS file. This drops 15(!) packages from the dependencies. I also like how all functions related to generating the HTML get pulled into the same file.

+75 -160

0 comment

5 changed files

pr created time in 6 days

startedojkelly/yarn.build

started time in 7 days

startedsberan/typed-json-schema

started time in 9 days

startedfastify/fluent-schema

started time in 9 days

more