GeezerVison is showing github.com — feat: add new func symbolHashJoin and rename shared file to symbolHas… · nullstack/nullstack@7079434
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: client/invoke.js +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import deserialize from '../shared/deserialize' |
2 | 2 | import prefix from '../shared/prefix' |
| 3 | +import { symbolHashJoin } from '../shared/symbolHash' |
3 | 4 | import page from './page' |
4 | 5 | import worker from './worker' |
5 | 6 | import client from './client' |
@@ -13,7 +14,7 @@ export default function invoke(name, hash) { |
13 | 14 | } else { |
14 | 15 | worker.queues[name] = [...worker.queues[name], params] |
15 | 16 | } |
16 | | - let finalHash = hash === this.hash ? hash : `${hash}---${this.hash}` |
| 17 | + let finalHash = hash === this.hash ? hash : symbolHashJoin(hash, this.hash) |
17 | 18 | let url = `${worker.api}/${prefix}/${finalHash}/${name}.json` |
18 | 19 | if (module.hot) { |
19 | 20 | const version = client.klasses[hash].__hashes[name] |
|
Collapse file
Copy file name to clipboardExpand all lines: server/server.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,7 +2,7 @@ import bodyParser from 'body-parser' |
2 | 2 | import express from 'express' |
3 | 3 | import path from 'path' |
4 | 4 | import deserialize from '../shared/deserialize' |
5 | | -import symbolHashSplit from '../shared/symbolHashSplit' |
| 5 | +import { symbolHashSplit } from '../shared/symbolHash' |
6 | 6 | import prefix from '../shared/prefix' |
7 | 7 | import context, { getCurrentContext, generateCurrentContext } from './context' |
8 | 8 | import emulatePrerender from './emulatePrerender' |
|
Collapse file
Copy file name to clipboard +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +export function symbolHashSplit(hash) { |
| 2 | + return hash.split('---') |
| 3 | +} |
| 4 | + |
| 5 | +export function symbolHashJoin(hash, joinHash) { |
| 6 | + return `${hash}---${joinHash}` |
| 7 | +} |
Collapse file
Copy file name to clipboardExpand all lines: shared/symbolHashSplit.js -3Lines changed: 0 additions & 3 deletions