mirror of
https://github.com/penpot/penpot.git
synced 2025-02-09 00:28:20 -05:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
da33d539bf
4 changed files with 46 additions and 18 deletions
|
@ -79,6 +79,28 @@ goog.scope(function() {
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
function getBigUint64(view, byteOffset, le) {
|
||||||
|
const a = view.getUint32(byteOffset, le);
|
||||||
|
const b = view.getUint32(byteOffset + 4, le);
|
||||||
|
const leMask = Number(!!le);
|
||||||
|
const beMask = Number(!le);
|
||||||
|
return ((BigInt(a * beMask + b * leMask) << 32n) |
|
||||||
|
(BigInt(a * leMask + b * beMask)));
|
||||||
|
}
|
||||||
|
|
||||||
|
function setBigUint64(view, byteOffset, value, le) {
|
||||||
|
const hi = Number(value >> 32n);
|
||||||
|
const lo = Number(value & 0xffffffffn);
|
||||||
|
if (le) {
|
||||||
|
view.setUint32(byteOffset + 4, hi, le);
|
||||||
|
view.setUint32(byteOffset, lo, le);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
view.setUint32(byteOffset, hi, le);
|
||||||
|
view.setUint32(byteOffset + 4, lo, le);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self.v8 = (function () {
|
self.v8 = (function () {
|
||||||
const buff = new ArrayBuffer(16);
|
const buff = new ArrayBuffer(16);
|
||||||
const int8 = new Uint8Array(buff);
|
const int8 = new Uint8Array(buff);
|
||||||
|
@ -104,7 +126,7 @@ goog.scope(function() {
|
||||||
|
|
||||||
const nextLong = () => {
|
const nextLong = () => {
|
||||||
fill(tmpInt8);
|
fill(tmpInt8);
|
||||||
return tmpView.getBigUint64(0, false);
|
return getBigUint64(tmpView, 0, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
lastRd = nextLong() & 0xffff_ffff_ffff_f0ffn;
|
lastRd = nextLong() & 0xffff_ffff_ffff_f0ffn;
|
||||||
|
@ -118,8 +140,9 @@ goog.scope(function() {
|
||||||
| ((ts << 14n) & 0x3fff_ffff_ffff_c000n)
|
| ((ts << 14n) & 0x3fff_ffff_ffff_c000n)
|
||||||
| lastCs);
|
| lastCs);
|
||||||
|
|
||||||
view.setBigUint64(0, msb, false);
|
setBigUint64(view, 0, msb, false);
|
||||||
view.setBigUint64(8, lsb, false);
|
setBigUint64(view, 8, lsb, false);
|
||||||
|
|
||||||
return core.uuid(toHexString(int8));
|
return core.uuid(toHexString(int8));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ PLATFORM=${PENPOT_BUILD_PLATFORM:-linux/amd64};
|
||||||
IMAGE=${1:-backend};
|
IMAGE=${1:-backend};
|
||||||
|
|
||||||
DOCKER_IMAGE="$ORG/$IMAGE";
|
DOCKER_IMAGE="$ORG/$IMAGE";
|
||||||
OPTIONS="-t $DOCKER_IMAGE:$PENPOT_BUILD_BRANCH";
|
OPTIONS="-t $DOCKER_IMAGE:$PENPOT_BUILD_VERSION";
|
||||||
|
|
||||||
IFS=", "
|
IFS=", "
|
||||||
read -a TAGS <<< $PENPOT_BUILD_TAGS;
|
read -a TAGS <<< $PENPOT_BUILD_TAGS;
|
||||||
|
|
|
@ -54,7 +54,7 @@ services:
|
||||||
- penpot
|
- penpot
|
||||||
|
|
||||||
penpot-postgres:
|
penpot-postgres:
|
||||||
image: "postgres:13"
|
image: "postgres:14"
|
||||||
restart: always
|
restart: always
|
||||||
stop_signal: SIGINT
|
stop_signal: SIGINT
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ services:
|
||||||
- penpot
|
- penpot
|
||||||
|
|
||||||
penpot-redis:
|
penpot-redis:
|
||||||
image: redis:6
|
image: redis:7
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- penpot
|
- penpot
|
||||||
|
|
|
@ -19,24 +19,29 @@
|
||||||
|
|
||||||
;; The main broadcast channel instance, used for emit data
|
;; The main broadcast channel instance, used for emit data
|
||||||
(defonce default-channel
|
(defonce default-channel
|
||||||
(js/BroadcastChannel. default-topic))
|
(when (exists? js/BroadcastChannel)
|
||||||
|
(js/BroadcastChannel. default-topic)))
|
||||||
|
|
||||||
(defonce stream
|
(defonce stream
|
||||||
|
(if (exists? js/BroadcastChannel)
|
||||||
(->> (rx/create (fn [subs]
|
(->> (rx/create (fn [subs]
|
||||||
(let [chan (js/BroadcastChannel. default-topic)]
|
(let [chan (js/BroadcastChannel. default-topic)]
|
||||||
(unchecked-set chan "onmessage" #(rx/push! subs (unchecked-get % "data")))
|
(unchecked-set chan "onmessage" #(rx/push! subs (unchecked-get % "data")))
|
||||||
(fn [] (.close ^js chan)))))
|
(fn [] (.close ^js chan)))))
|
||||||
(rx/map t/decode-str)
|
(rx/map t/decode-str)
|
||||||
(rx/map map->BroadcastMessage)
|
(rx/map map->BroadcastMessage)
|
||||||
(rx/share)))
|
(rx/share))
|
||||||
|
(rx/subject)))
|
||||||
|
|
||||||
(defn emit!
|
(defn emit!
|
||||||
([type data]
|
([type data]
|
||||||
|
(when default-channel
|
||||||
(.postMessage ^js default-channel (t/encode-str {:id nil :type type :data data}))
|
(.postMessage ^js default-channel (t/encode-str {:id nil :type type :data data}))
|
||||||
nil)
|
|
||||||
([id type data]
|
|
||||||
(.postMessage ^js default-channel (t/encode-str {:id id :type type :data data}))
|
|
||||||
nil))
|
nil))
|
||||||
|
([id type data]
|
||||||
|
(when default-channel
|
||||||
|
(.postMessage ^js default-channel (t/encode-str {:id id :type type :data data}))
|
||||||
|
nil)))
|
||||||
|
|
||||||
(defn type?
|
(defn type?
|
||||||
([type]
|
([type]
|
||||||
|
|
Loading…
Add table
Reference in a new issue