From 48a5bf1fb05da5ee6222c7b0a98e14a029eee90b Mon Sep 17 00:00:00 2001 From: Guilherme Correia Date: Tue, 8 Aug 2023 22:01:45 -0300 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=93=8C=20Fix=20dependencies=20above?= =?UTF-8?q?=20deprecations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 3317b85..75a446a 100644 --- a/package.json +++ b/package.json @@ -16,29 +16,27 @@ }, "dependencies": { "@swc/core": "1.3.35", - "babel-loader": "9.1.2", "body-parser": "1.20.1", "commander": "10.0.0", - "copy-webpack-plugin": "^11.0.0", + "copy-webpack-plugin": "11.0.0", "css-loader": "6.7.3", - "css-minimizer-webpack-plugin": "^4.2.2", + "css-minimizer-webpack-plugin": "5.0.1", "dotenv": "16.0.3", "eslint-plugin-nullstack": "0.0.26", "express": "4.18.2", "fs-extra": "11.1.0", - "lightningcss": "^1.19.0", + "lightningcss": "1.21.5", "mini-css-extract-plugin": "2.7.2", "node-fetch": "2.6.7", - "nodemon-webpack-plugin": "^4.8.1", + "nodemon-webpack-plugin": "4.8.1", "sass": "1.58.0", "sass-loader": "13.2.0", - "style-loader": "^3.3.1", + "style-loader": "3.3.3", "swc-loader": "0.2.3", "swc-plugin-nullstack": "0.1.3", "terser-webpack-plugin": "5.3.6", - "webpack": "^5.0.0", - "webpack-dev-server": "4.11.1", - "webpack-hot-middleware": "^2.25.3" + "webpack": "5.88.1", + "webpack-hot-middleware": "2.25.4" }, "devDependencies": { "webpack-dev-middleware": "github:Mortaro/webpack-dev-middleware#fix-write-to-disk-cleanup" From 30f10d7c12b30049e485ffac019e0594a10d0411 Mon Sep 17 00:00:00 2001 From: Guilherme Correia Date: Mon, 14 Aug 2023 19:53:32 -0300 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20Add=20type=20to=20i?= =?UTF-8?q?nner=20components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/index.d.ts b/types/index.d.ts index b2243c4..380e297 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -100,6 +100,8 @@ export default class Nullstack { render?(context: NullstackClientContext): NullstackNode + [_property: `render${Capitalize}`]: Nullstack['render'] + prerendered: boolean /** From 7a74807da0699c8bc21fbf8e4de57876294bd9be Mon Sep 17 00:00:00 2001 From: hallexcosta Date: Fri, 18 Aug 2023 00:30:39 -0300 Subject: [PATCH 3/7] add utility function symbolHashSplit --- shared/symbolHashSplit.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 shared/symbolHashSplit.js diff --git a/shared/symbolHashSplit.js b/shared/symbolHashSplit.js new file mode 100644 index 0000000..c395e33 --- /dev/null +++ b/shared/symbolHashSplit.js @@ -0,0 +1,3 @@ +export default function symbolHashSplit(hash) { + return hash.split('---') +} \ No newline at end of file From 05ec145346b409b64ddfaaaf8ad1b4e665ae7e9e Mon Sep 17 00:00:00 2001 From: hallexcosta Date: Fri, 18 Aug 2023 00:31:17 -0300 Subject: [PATCH 4/7] change seperator hash to --- --- server/server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/server.js b/server/server.js index 45e7361..5434993 100644 --- a/server/server.js +++ b/server/server.js @@ -2,6 +2,7 @@ import bodyParser from 'body-parser' import express from 'express' import path from 'path' import deserialize from '../shared/deserialize' +import symbolHashSplit from '../shared/symbolHashSplit' import prefix from '../shared/prefix' import context, { getCurrentContext, generateCurrentContext } from './context' import emulatePrerender from './emulatePrerender' @@ -123,7 +124,7 @@ server.start = function () { const payload = request.method === 'GET' ? request.query.payload : request.body const args = deserialize(payload) const { hash, methodName } = request.params - const [invokerHash, boundHash] = hash.split('-') + const [invokerHash, boundHash] = symbolHashSplit(hash) const key = `${invokerHash}.${methodName}` await load(boundHash || invokerHash) const invokerKlass = registry[invokerHash] @@ -154,7 +155,7 @@ server.start = function () { const payload = request.method === 'GET' ? request.query.payload : request.body const args = deserialize(payload) const { version, hash, methodName } = request.params - const [invokerHash, boundHash] = hash.split('-') + const [invokerHash, boundHash] = symbolHashSplit(hash) let [filePath, klassName] = (invokerHash || boundHash).split("___") const file = path.resolve('..', filePath.replaceAll('__', '/')) console.info('\x1b[1;37m%s\x1b[0m', ` [${request.method}] ${request.path}`) From a4fe03be041485234c17ced679ac0f5e24182285 Mon Sep 17 00:00:00 2001 From: hallexcosta Date: Fri, 18 Aug 2023 00:31:44 -0300 Subject: [PATCH 5/7] use utility function symbolHashSplit --- client/invoke.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/invoke.js b/client/invoke.js index 83b6df1..0c11a7e 100644 --- a/client/invoke.js +++ b/client/invoke.js @@ -13,7 +13,7 @@ export default function invoke(name, hash) { } else { worker.queues[name] = [...worker.queues[name], params] } - let finalHash = hash === this.hash ? hash : `${hash}-${this.hash}` + let finalHash = hash === this.hash ? hash : `${hash}---${this.hash}` let url = `${worker.api}/${prefix}/${finalHash}/${name}.json` if (module.hot) { const version = client.klasses[hash].__hashes[name] From 707943407751391c165c52120da1fca3be7d2a0c Mon Sep 17 00:00:00 2001 From: hallexcosta Date: Fri, 18 Aug 2023 14:49:52 -0300 Subject: [PATCH 6/7] feat: add new func symbolHashJoin and rename shared file to symbolHash.js --- client/invoke.js | 3 ++- server/server.js | 2 +- shared/symbolHash.js | 7 +++++++ shared/symbolHashSplit.js | 3 --- 4 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 shared/symbolHash.js delete mode 100644 shared/symbolHashSplit.js diff --git a/client/invoke.js b/client/invoke.js index 0c11a7e..315a06a 100644 --- a/client/invoke.js +++ b/client/invoke.js @@ -1,5 +1,6 @@ import deserialize from '../shared/deserialize' import prefix from '../shared/prefix' +import { symbolHashJoin } from '../shared/symbolHash' import page from './page' import worker from './worker' import client from './client' @@ -13,7 +14,7 @@ export default function invoke(name, hash) { } else { worker.queues[name] = [...worker.queues[name], params] } - let finalHash = hash === this.hash ? hash : `${hash}---${this.hash}` + let finalHash = hash === this.hash ? hash : symbolHashJoin(hash, this.hash) let url = `${worker.api}/${prefix}/${finalHash}/${name}.json` if (module.hot) { const version = client.klasses[hash].__hashes[name] diff --git a/server/server.js b/server/server.js index 5434993..2672164 100644 --- a/server/server.js +++ b/server/server.js @@ -2,7 +2,7 @@ import bodyParser from 'body-parser' import express from 'express' import path from 'path' import deserialize from '../shared/deserialize' -import symbolHashSplit from '../shared/symbolHashSplit' +import { symbolHashSplit } from '../shared/symbolHash' import prefix from '../shared/prefix' import context, { getCurrentContext, generateCurrentContext } from './context' import emulatePrerender from './emulatePrerender' diff --git a/shared/symbolHash.js b/shared/symbolHash.js new file mode 100644 index 0000000..53d59ad --- /dev/null +++ b/shared/symbolHash.js @@ -0,0 +1,7 @@ +export function symbolHashSplit(hash) { + return hash.split('---') +} + +export function symbolHashJoin(hash, joinHash) { + return `${hash}---${joinHash}` +} \ No newline at end of file diff --git a/shared/symbolHashSplit.js b/shared/symbolHashSplit.js deleted file mode 100644 index c395e33..0000000 --- a/shared/symbolHashSplit.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function symbolHashSplit(hash) { - return hash.split('---') -} \ No newline at end of file From a9ec053c3867a224333e083973e63696d6cef1d1 Mon Sep 17 00:00:00 2001 From: Christian Mortaro Date: Tue, 22 Aug 2023 19:26:29 -0300 Subject: [PATCH 7/7] :bookmark: version 0.20.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 75a446a..005279b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nullstack", - "version": "0.20.0", + "version": "0.20.1", "description": "Feature-Driven Full Stack JavaScript Components", "main": "./types/index.d.ts", "author": "Mortaro",