fix typos (#94)

This commit is contained in:
champ 2021-07-15 16:46:15 +08:00 committed by GitHub
parent fb271ed9c1
commit 20f3684b0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 44 additions and 44 deletions

View file

@ -4,12 +4,12 @@ set -e
# This script won't work for aws, as it's black listed
echo -e "This script won't work for aws default domain names assosiated with public ips, as it's black listed in letsencrypt\nso if youre running on aws with default domain names, please press ctrl+c with in 5 seconds"
echo -e "This script won't work for aws default domain names associated with public ips, as it's black listed in letsencrypt\nso if you're running on aws with default domain names, please press ctrl+c with in 5 seconds"
sleep 5
homedir=${HOME}
echo please enter your dns name :
echo please enter your dns name :
read dns_name
echo please enter your email id:
read emai_id

View file

@ -1,6 +1,6 @@
## Helm charts for installing OpenReplay components
Installation components are separated by namepaces.
Installation components are separated by namespaces.
**Namespace:**

View file

@ -130,11 +130,11 @@ export default class App {
try {
fn.apply(this, args);
} catch (e) {
app.send(new TechnicalInfo("error", JSON.stringify({
time: timestamp(),
name: e.name,
app.send(new TechnicalInfo("error", JSON.stringify({
time: timestamp(),
name: e.name,
message: e.message,
stack: e.stack
stack: e.stack
})));
}
} as any // TODO: correct typing
@ -163,7 +163,7 @@ export default class App {
target.removeEventListener(type, listener, useCapture),
);
}
getSessionToken(): string | undefined {
const token = sessionStorage.getItem(this.options.session_token_key);
if (token !== null) {
@ -188,7 +188,7 @@ export default class App {
if (!this.isActive) {
this.isActive = true;
if (!this.worker) {
throw new Error("Stranger things: no worker found");
throw new Error("Stranger things: no worker found");
}
let pageNo: number = 0;
@ -200,15 +200,15 @@ export default class App {
sessionStorage.setItem(this.options.session_pageno_key, pageNo.toString());
const startTimestamp = timestamp();
const messageData: WorkerMessageData = {
ingestPoint: this.options.ingestPoint,
pageNo,
const messageData: WorkerMessageData = {
ingestPoint: this.options.ingestPoint,
pageNo,
startTimestamp,
connAttemptCount: this.options.connAttemptCount,
connAttemptGap: this.options.connAttemptGap,
}
this.worker.postMessage(messageData); // brings delay of 10th ms?
window.fetch(this.options.ingestPoint + '/v1/web/start', {
this.worker.postMessage(messageData); // brings delay of 10th ms?
window.fetch(this.options.ingestPoint + '/v1/web/start', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -235,9 +235,9 @@ export default class App {
})
.then(r => {
const { token, userUUID, sessionID } = r;
if (typeof token !== 'string' ||
if (typeof token !== 'string' ||
typeof userUUID !== 'string') {
throw new Error("Incorrect server responce");
throw new Error("Incorrect server response");
}
sessionStorage.setItem(this.options.session_token_key, token);
localStorage.setItem(this.options.local_uuid_key, userUUID);
@ -245,7 +245,7 @@ export default class App {
this._sessionID = sessionID;
}
if (!this.worker) {
throw new Error("Stranger things: no worker found after start request");
throw new Error("Stranger things: no worker found after start request");
}
this.worker.postMessage({ token });
this.observer.observe();

View file

@ -17,7 +17,7 @@ import Scroll from './modules/scroll';
import Viewport from './modules/viewport';
import Longtasks from './modules/longtasks';
import CSSRules from './modules/cssrules';
import { IN_BROWSER, depricationWarn } from './utils';
import { IN_BROWSER, deprecationWarn } from './utils';
import { Options as AppOptions } from './app';
import { Options as ExceptionOptions } from './modules/exception';
@ -27,7 +27,7 @@ import { Options as TimingOptions } from './modules/timing';
export type Options = Partial<
AppOptions & ConsoleOptions & ExceptionOptions & InputOptions & TimingOptions
> & {
projectID?: number; // For the back compatibility only (depricated)
projectID?: number; // For the back compatibility only (deprecated)
projectKey: string;
sessionToken?: string;
respectDoNotTrack?: boolean;
@ -46,10 +46,10 @@ function processOptions(obj: any): obj is Options {
if (typeof obj.projectKey !== 'number') {
if (typeof obj.projectID !== 'number') { // Back compatability
console.error(`OpenReplay: projectKey is missing or wrong type (string is expected). Please, check https://docs.openreplay.com${ DOCS_SETUP } for more information.`)
return false
return false
} else {
obj.projectKey = obj.projectID.toString();
depricationWarn("`projectID` option", "`projectKey` option", DOCS_SETUP)
deprecationWarn("`projectID` option", "`projectKey` option", DOCS_SETUP)
}
} else {
console.warn("OpenReplay: projectKey is expected to have a string type.")
@ -99,7 +99,7 @@ export default class API {
Longtasks(this.app);
(window as any).__OPENREPLAY__ = (window as any).__OPENREPLAY__ || this;
} else {
console.log("OpenReplay: broeser doesn't support API required for tracking.")
console.log("OpenReplay: browser doesn't support API required for tracking.")
const req = new XMLHttpRequest();
const orig = options.ingestPoint || DEFAULT_INGEST_POINT;
req.open("POST", orig + "/v1/web/not-started");
@ -125,7 +125,7 @@ export default class API {
return this.app.active();
}
active(): boolean {
depricationWarn("'active' method", "'isActive' method", "/")
deprecationWarn("'active' method", "'isActive' method", "/")
return this.isActive();
}
@ -159,7 +159,7 @@ export default class API {
return this.app.getSessionID();
}
sessionID(): string | null | undefined {
depricationWarn("'sessionID' method", "'getSessionID' method", "/");
deprecationWarn("'sessionID' method", "'getSessionID' method", "/");
return this.getSessionID();
}
@ -169,7 +169,7 @@ export default class API {
}
}
userID(id: string): void {
depricationWarn("'userID' method", "'setUserID' method", "/");
deprecationWarn("'userID' method", "'setUserID' method", "/");
this.setUserID(id);
}
@ -179,7 +179,7 @@ export default class API {
}
}
userAnonymousID(id: string): void {
depricationWarn("'userAnonymousID' method", "'setUserAnonymousID' method", "/")
deprecationWarn("'userAnonymousID' method", "'setUserAnonymousID' method", "/")
this.setUserAnonymousID(id);
}
@ -193,7 +193,7 @@ export default class API {
}
}
metadata(key: string, value: string): void {
depricationWarn("'metadata' method", "'setMetadata' method", "/")
deprecationWarn("'metadata' method", "'setMetadata' method", "/")
this.setMetadata(key, value);
}
@ -231,7 +231,7 @@ export default class API {
handleErrorEvent = (e: ErrorEvent | PromiseRejectionEvent) => {
if (
(e instanceof ErrorEvent ||
(e instanceof ErrorEvent ||
('PromiseRejectionEvent' in window && e instanceof PromiseRejectionEvent)
) &&
this.app !== null

View file

@ -33,11 +33,11 @@ export const warn = console.warn
const DOCS_HOST = 'https://docs.openreplay.com';
const warnedFeatures: { [key: string]: boolean; } = {};
export function depricationWarn(nameOfFeature: string, useInstead: string, docsPath: string = "/"): void {
export function deprecationWarn(nameOfFeature: string, useInstead: string, docsPath: string = "/"): void {
if (warnedFeatures[ nameOfFeature ]) {
return;
}
warn(`OpenReplay: ${ nameOfFeature } is depricated. ${ useInstead ? `Please, use ${ useInstead } instead.` : "" } Visit ${DOCS_HOST}${docsPath} for more information.`)
warn(`OpenReplay: ${ nameOfFeature } is deprecated. ${ useInstead ? `Please, use ${ useInstead } instead.` : "" } Visit ${DOCS_HOST}${docsPath} for more information.`)
warnedFeatures[ nameOfFeature ] = true;
}
@ -48,7 +48,7 @@ export function getLabelAttribute(e: Element): string | null {
}
value = e.getAttribute("data-asayer-label");
if (value !== null) {
depricationWarn(`"data-asayer-label" attribute`, `"data-openreplay-label" attribute`, "/");
deprecationWarn(`"data-asayer-label" attribute`, `"data-openreplay-label" attribute`, "/");
}
return value;
}
@ -60,7 +60,7 @@ export function hasOpenreplayAttribute(e: Element, name: string): boolean {
}
const oldName = `data-asayer-${name}`;
if (e.hasAttribute(oldName)) {
depricationWarn(`"${oldName}" attribute`, `"${newName}" attribute`, "/installation/sanitize-data");
deprecationWarn(`"${oldName}" attribute`, `"${newName}" attribute`, "/installation/sanitize-data");
return true;
}
return false;

View file

@ -61,13 +61,13 @@ const textEncoder: { encode(str: string): Uint8Array } =
export default class Writer {
private offset: number = 0;
private checkpontOffset: number = 0;
private checkpointOffset: number = 0;
private readonly data: Uint8Array;
constructor(private readonly size: number) {
this.data = new Uint8Array(size);
}
checkpoint(): void {
this.checkpontOffset = this.offset;
this.checkpointOffset = this.offset;
}
isEmpty(): boolean {
return this.offset === 0;
@ -100,10 +100,10 @@ export default class Writer {
}
reset(): void {
this.offset = 0;
this.checkpontOffset = 0;
this.checkpointOffset = 0;
}
flush(): Uint8Array {
const data = this.data.slice(0, this.checkpontOffset);
const data = this.data.slice(0, this.checkpointOffset);
this.reset();
return data;
}

View file

@ -18,9 +18,9 @@ let pageNo: number = 0;
let timestamp: number = 0;
let timeAdjustment: number = 0;
let nextIndex: number = 0;
// TODO: clear logic: isEmpty here means presense of BatchMeta but absence of other messages
// TODO: clear logic: isEmpty here means presence of BatchMeta but absence of other messages
// BatchWriter should be abstracted
let isEmpty: boolean = true;
let isEmpty: boolean = true;
function writeBatchMeta(): boolean { // TODO: move to encoder
return new BatchMeta(pageNo, nextIndex, timestamp).encode(writer)
@ -56,7 +56,7 @@ function sendBatch(batch: Uint8Array):void {
self.postMessage(null);
return
}
//if (this.response == null)
//if (this.response == null)
const nextBatch = sendQueue.shift();
if (nextBatch) {
sendBatch(nextBatch);
@ -72,7 +72,7 @@ function sendBatch(batch: Uint8Array):void {
return
}
attemptsCount++;
setTimeout(() => sendBatch(batch), ATTEMPT_TIMEOUT);
setTimeout(() => sendBatch(batch), ATTEMPT_TIMEOUT);
}
req.send(batch.buffer);
}
@ -146,10 +146,10 @@ self.onmessage = ({ data }: MessageEvent<WorkerMessageData>) => {
}
}
writer.checkpoint(); // TODO: incapsulate in writer
writer.checkpoint(); // TODO: encapsulate in writer
if (!message.encode(writer)) {
send();
// writer.reset(); // TODO: sematically clear code
// writer.reset(); // TODO: semantically clear code
if (!message.encode(writer)) { // Try to encode within empty state
// MBTODO: tempWriter for one message?
while (!message.encode(writer)) {
@ -163,9 +163,9 @@ self.onmessage = ({ data }: MessageEvent<WorkerMessageData>) => {
writer = new Writer(beaconSize);
writeBatchMeta();
}
}
}
};
nextIndex++; // TODO: incapsulate in writer
nextIndex++; // TODO: encapsulate in writer
isEmpty = false;
});
};