gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant-backoffice] branch master updated: bank: fix unrendered


From: gnunet
Subject: [taler-merchant-backoffice] branch master updated: bank: fix unrendered style.
Date: Fri, 28 Jan 2022 14:10:21 +0100

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository merchant-backoffice.

The following commit(s) were added to refs/heads/master by this push:
     new 57348c3  bank: fix unrendered style.
57348c3 is described below

commit 57348c35d8bd6b14d5ed9e1a0715609b616a9de8
Author: ms <ms@taler.net>
AuthorDate: Fri Jan 28 14:09:16 2022 +0100

    bank: fix unrendered style.
    
    template.html was missing the <style>-inlining.
---
 packages/bank/package.json                | 12 ++++--
 packages/bank/preact.config.js            | 37 +++++++++++++++---
 packages/bank/src/{index.ts => index.tsx} |  1 -
 packages/bank/src/pages/home/index.tsx    |  1 +
 packages/bank/src/template.html           | 65 ++++++++++++++++---------------
 5 files changed, 74 insertions(+), 42 deletions(-)

diff --git a/packages/bank/package.json b/packages/bank/package.json
index 6f5a771..e1155a3 100644
--- a/packages/bank/package.json
+++ b/packages/bank/package.json
@@ -4,13 +4,12 @@
   "version": "0.1.0",
   "license": "MIT",
   "scripts": {
-    "build": "preact build --no-sw --no-esm --no-inline-css",
-    "serve": "sirv build --port ${PORT:=8080} --cors --single",
     "dev": "preact watch --port ${PORT:=8080} --no-sw --no-esm",
+    "build": "preact build --no-sw --no-esm -c preact.single-config.js --dest 
single && sh remove-link-stylesheet.sh",
+    "serve": "sirv build --port ${PORT:=8080} --cors --single",
     "lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
     "test": "jest ./tests",
     "build-storybook": "build-storybook",
-    "build-single": "preact build --no-sw --no-esm -c preact.single-config.js 
--dest single && sh remove-link-stylesheet.sh",
     "serve-single": "sirv single --port ${PORT:=8080} --cors --single",
     "pretty": "prettier --write src",
     "storybook": "start-storybook -p 6006"
@@ -55,6 +54,8 @@
     "@types/jest": "^27.0.2",
     "@typescript-eslint/eslint-plugin": "^5.3.0",
     "@typescript-eslint/parser": "^5.3.0",
+    "babel-loader": "^8.2.2",
+    "base64-inline-loader": "^1.1.1",
     "bulma": "^0.9.3",
     "bulma-checkbox": "^1.1.1",
     "bulma-radio": "^1.1.1",
@@ -62,6 +63,10 @@
     "enzyme-adapter-preact-pure": "^3.2.0",
     "eslint": "^8.1.0",
     "eslint-config-preact": "^1.2.0",
+    "html-webpack-inline-chunk-plugin": "^1.1.1",
+    "html-webpack-inline-source-plugin": "0.0.10",
+    "html-webpack-skip-assets-plugin": "^1.0.1",
+    "inline-chunk-html-plugin": "^1.1.1",
     "jest": "^27.3.1",
     "jest-fetch-mock": "^3.0.3",
     "jest-preset-preact": "^4.0.5",
@@ -72,6 +77,7 @@
     "preact-cli": "3.0.5",
     "sass": "1.32.13",
     "sass-loader": "^10",
+    "script-ext-html-webpack-plugin": "^2.1.5",
     "sirv-cli": "^1.0.14",
     "typescript": "^4.4.4"
   },
diff --git a/packages/bank/preact.config.js b/packages/bank/preact.config.js
index 8d6da19..8e640f3 100644
--- a/packages/bank/preact.config.js
+++ b/packages/bank/preact.config.js
@@ -28,18 +28,43 @@ const commitHash = cp.execSync('git rev-parse --short 
HEAD').toString();
 
 export default {
   webpack(config, env, helpers) {
+    // ensure that process.env will not be undefined on runtime
+    config.node.process = 'mock'
+
     // add __VERSION__ to be use in the html
     config.plugins.push(
       new DefinePlugin({
-        'process.env.__VERSION__': JSON.stringify(env.isProd ? pack.version : 
`dev-${commitHash}`),
+        'process.env.__VERSION__': JSON.stringify(env.isProd ? pack.version : 
`dev-${commitHash}`) ,
       }),
     );
-    const crittersWrapper = helpers.getPluginsByName(config, 'Critters')
-    if (crittersWrapper && crittersWrapper.length > 0) {
-      const [{ index }] = crittersWrapper
-      config.plugins.splice(index, 1)
-    }
 
+    // suddenly getting out of memory error from build process, error below [1]
+    // FIXME: remove preact-cli, use rollup
+    let { index } = helpers.getPluginsByName(config, 
'WebpackFixStyleOnlyEntriesPlugin')[0]
+    config.plugins.splice(index, 1)   
   }
 }
 
+
+
+/* [1] from this error decided to remove plugin 'webpack-fix-style-only-entries
+   leaving this error for future reference
+
+
+<--- Last few GCs --->
+
+[32479:0x2e01870]    19969 ms: Mark-sweep 1869.4 (1950.2) -> 1443.1 (1504.1) 
MB, 497.5 / 0.0 ms  (average mu = 0.631, current mu = 0.455) allocation failure 
scavenge might not succeed
+[32479:0x2e01870]    21907 ms: Mark-sweep 2016.9 (2077.9) -> 1628.6 (1681.4) 
MB, 1596.0 / 0.0 ms  (average mu = 0.354, current mu = 0.176) allocation 
failure scavenge might not succeed
+
+<--- JS stacktrace --->
+
+==== JS stack trace =========================================
+
+    0: ExitFrame [pc: 0x13cf099]
+Security context: 0x2f4ca66c08d1 <JSObject>
+    1: /* anonymous * / [0x35d05555b4b9] 
[...path/merchant-backoffice/node_modules/.pnpm/webpack-fix-style-only-entries@0.5.2/node_modules/webpack-fix-style-only-entries/index.js:~80]
 [pc=0x2145e699d1a4](this=0x1149465410e9 <GlobalObject Object map = 
0xff481b5b5f9>,0x047e52e36a49 <Dependency map = 0x1ed1fe41cd19>)
+    2: arguments adaptor frame: 3...
+
+FATAL ERROR: invalid array length Allocation failed - JavaScript heap out of 
memory
+ 
+*/
\ No newline at end of file
diff --git a/packages/bank/src/index.ts b/packages/bank/src/index.tsx
similarity index 67%
rename from packages/bank/src/index.ts
rename to packages/bank/src/index.tsx
index 4bd7b28..8da850f 100644
--- a/packages/bank/src/index.ts
+++ b/packages/bank/src/index.tsx
@@ -1,4 +1,3 @@
 import App from "./components/app";
-import "./scss/main.scss";
 
 export default App;
diff --git a/packages/bank/src/pages/home/index.tsx 
b/packages/bank/src/pages/home/index.tsx
index 2e4c4f1..7c99869 100644
--- a/packages/bank/src/pages/home/index.tsx
+++ b/packages/bank/src/pages/home/index.tsx
@@ -5,6 +5,7 @@ import { Buffer } from "buffer";
 import { useTranslator, Translate } from "../../i18n";
 import { QR } from "../../components/QR";
 import { useNotNullLocalStorage, useLocalStorage } from "../../hooks";
+import "../../scss/main.scss";
 
 /**
  * ToDo:
diff --git a/packages/bank/src/template.html b/packages/bank/src/template.html
index 8ae2fe1..ccccab1 100644
--- a/packages/bank/src/template.html
+++ b/packages/bank/src/template.html
@@ -16,36 +16,37 @@
  @author Sebastian Javier Marchano
 -->
 <!DOCTYPE html>
-<html
-  lang="en"
-  class="has-aside-left has-aside-mobile-transition has-navbar-fixed-top 
has-aside-expanded"
->
-  <head>
-    <meta charset="utf-8" />
-    <title><%= htmlWebpackPlugin.options.title %></title>
-    <meta name="viewport" content="width=device-width,initial-scale=1" />
-    <meta name="mobile-web-app-capable" content="yes" />
-    <meta name="apple-mobile-web-app-capable" content="yes" />
-
-    <link
-      rel="icon"
-      
href="data:;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABILAAASCwAAAAAAAAAAAAD///////////////////////////////////////////////////////////////////////////////////////////////////7//v38//78/P/+/fz//vz7///+/v/+/f3//vz7///+/v/+/fz//v38///////////////////////+/v3///7+/////////////////////////////////////////////////////////v3//v79///////+/v3///////r28v/ct5//06SG/9Gffv/Xqo7/7N/V/9e2nf/bsJb/6uDW/9Sskf/euKH/+/j2///////+/v3//////+3azv+/eE3/2rWd/9Kkhv/Vr5T/48i2/8J+VP/
 [...]
-    />
-    <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon" />
-
-    <% if (htmlWebpackPlugin.options.manifest.theme_color) { %>
-    <meta
-      name="theme-color"
-      content="<%= htmlWebpackPlugin.options.manifest.theme_color %>"
-    />
-    <% } %>
-  </head>
-  <body>
-    <script>
-      <%= 
compilation.assets[htmlWebpackPlugin.files.chunks["polyfills"].entry.substr(htmlWebpackPlugin.files.publicPath.length)].source()
 %>
-    </script>
-    <script>
-      <%= 
compilation.assets[htmlWebpackPlugin.files.chunks["bundle"].entry.substr(htmlWebpackPlugin.files.publicPath.length)].source()
 %>
-    </script>
-  </body>
+<html lang="en" class="has-aside-left has-aside-mobile-transition 
has-navbar-fixed-top has-aside-expanded">
+       <head>
+               <meta charset="utf-8">
+               <title><%= htmlWebpackPlugin.options.title %></title>
+               <meta name="viewport" 
content="width=device-width,initial-scale=1">
+               <meta name="mobile-web-app-capable" content="yes">
+               <meta name="apple-mobile-web-app-capable" content="yes">
+
+               <link rel="icon" 
href="data:;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABILAAASCwAAAAAAAAAAAAD///////////////////////////////////////////////////////////////////////////////////////////////////7//v38//78/P/+/fz//vz7///+/v/+/f3//vz7///+/v/+/fz//v38///////////////////////+/v3///7+/////////////////////////////////////////////////////////v3//v79///////+/v3///////r28v/ct5//06SG/9Gffv/Xqo7/7N/V/9e2nf/bsJb/6uDW/9Sskf/euKH/+/j2///////+/v3//////+3azv+/eE3/2rWd/9Kkhv/Vr5
 [...]
+               <link rel="shortcut icon" href="data:image/x-icon;," 
type="image/x-icon" />
+
+               <% if (htmlWebpackPlugin.options.manifest.theme_color) { %>
+                       <meta name="theme-color" content="<%= 
htmlWebpackPlugin.options.manifest.theme_color %>">
+               <% } %>
+
+               <% for (const index in htmlWebpackPlugin.files.css) { %>
+                       <% const file = htmlWebpackPlugin.files.css[index] %>
+                       <style data-href='<%= file %>' >
+                               <%= 
compilation.assets[file.substr(htmlWebpackPlugin.files.publicPath.length)].source()
 %>
+                       </style>
+               <% } %>
+               
+       </head>
+       <body>
+
+               <script>
+                       <%= 
compilation.assets[htmlWebpackPlugin.files.chunks["polyfills"].entry.substr(htmlWebpackPlugin.files.publicPath.length)].source()
 %>
+               </script>
+               <script>
+                       <%= 
compilation.assets[htmlWebpackPlugin.files.chunks["bundle"].entry.substr(htmlWebpackPlugin.files.publicPath.length)].source()
 %>
+               </script>
+
+       </body>
 </html>

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]