diff --git a/shared/js/tree/Channel.ts b/shared/js/tree/Channel.ts index 1b699b7d..e189d163 100644 --- a/shared/js/tree/Channel.ts +++ b/shared/js/tree/Channel.ts @@ -620,20 +620,21 @@ export class ChannelEntry extends ChannelTreeEntry { } updateVariables(...variables: {key: string, value: string}[]) { - /* devel-block(log-channel-property-updates) */ - let group = log.group(log.LogType.DEBUG, LogCategory.CHANNEL_PROPERTIES, tr("Update properties (%i) of %s (%i)"), variables.length, this.channelName(), this.getChannelId()); + let group; + if(__build.mode === "debug") { + group = log.group(log.LogType.DEBUG, LogCategory.CHANNEL_PROPERTIES, tr("Update properties (%i) of %s (%i)"), variables.length, this.channelName(), this.getChannelId()); - { - const entries = []; - for(const variable of variables) - entries.push({ - key: variable.key, - value: variable.value, - type: typeof (this.properties[variable.key]) - }); - log.table(LogType.DEBUG, LogCategory.PERMISSIONS, "Clannel update properties", entries); + { + const entries = []; + for(const variable of variables) + entries.push({ + key: variable.key, + value: variable.value, + type: typeof (this.properties[variable.key]) + }); + log.table(LogType.DEBUG, LogCategory.PERMISSIONS, "Clannel update properties", entries); + } } - /* devel-block-end */ /* TODO: Validate values. Example: channel_conversation_mode */ @@ -664,9 +665,9 @@ export class ChannelEntry extends ChannelTreeEntry { } } } - /* devel-block(log-channel-property-updates) */ - group.end(); - /* devel-block-end */ + + group?.end(); + { let properties = {}; for(const property of variables) diff --git a/shared/js/tree/Client.ts b/shared/js/tree/Client.ts index 1ec2217f..36e72e4d 100644 --- a/shared/js/tree/Client.ts +++ b/shared/js/tree/Client.ts @@ -731,19 +731,20 @@ export class ClientEntry extends Cha let reorder_channel = false; let update_avatar = false; - /* devel-block(log-client-property-updates) */ - let group = log.group(log.LogType.DEBUG, LogCategory.CLIENT, tr("Update properties (%i) of %s (%i)"), variables.length, this.clientNickName(), this.clientId()); - { - const entries = []; - for(const variable of variables) - entries.push({ - key: variable.key, - value: variable.value, - type: typeof (this.properties[variable.key]) - }); - log.table(LogType.DEBUG, LogCategory.PERMISSIONS, "Client update properties", entries); + let group; + if(__build.mode === "debug") { + group = log.group(log.LogType.DEBUG, LogCategory.CLIENT, tr("Update properties (%i) of %s (%i)"), variables.length, this.clientNickName(), this.clientId()); + { + const entries = []; + for(const variable of variables) + entries.push({ + key: variable.key, + value: variable.value, + type: typeof (this.properties[variable.key]) + }); + log.table(LogType.DEBUG, LogCategory.PERMISSIONS, "Client update properties", entries); + } } - /* devel-block-end */ for(const variable of variables) { const old_value = this._properties[variable.key]; @@ -788,9 +789,7 @@ export class ClientEntry extends Cha this.channelTree.client?.fileManager?.avatars.updateCache(this.avatarId(), this.properties.client_flag_avatar); } - /* devel-block(log-client-property-updates) */ - group.end(); - /* devel-block-end */ + group?.end(); { let properties = {}; diff --git a/shared/js/ui/modal/whats-new/Definitions.ts b/shared/js/ui/modal/whats-new/Definitions.ts new file mode 100644 index 00000000..dfecde52 --- /dev/null +++ b/shared/js/ui/modal/whats-new/Definitions.ts @@ -0,0 +1,7 @@ +export interface ModalWhatsNewVariables { + +} + +export interface ModalWhatsNewEvents { + +} \ No newline at end of file diff --git a/webpack.config.ts b/webpack.config.ts index a3676a0b..3d610a2d 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -5,7 +5,7 @@ import {exec} from "child_process"; import * as util from "util"; import { Plugin as SvgSpriteGenerator } from "webpack-svg-sprite-generator"; -import LoaderIndexGenerator = require("./loader/IndexGenerator"); +import LoaderIndexGenerator from "./loader/IndexGenerator"; import {Configuration} from "webpack"; const path = require('path'); @@ -20,7 +20,7 @@ const { WebpackManifestPlugin } = require('webpack-manifest-plugin'); export let isDevelopment = process.env.NODE_ENV === 'development'; console.log("Webpacking for %s (%s)", isDevelopment ? "development" : "production", process.env.NODE_ENV || "NODE_ENV not specified"); -const generate_definitions = async (target: string) => { +const generateDefinitions = async (target: string) => { const git_rev = fs.readFileSync(path.join(__dirname, ".git", "HEAD")).toString(); let version; if(git_rev.indexOf("/") === -1) @@ -83,7 +83,7 @@ export const config = async (target: "web" | "client"): Promise = minSize: 1024 * 8, maxSize: 1024 * 128 }), - new webpack.DefinePlugin(await generate_definitions(target)), + new webpack.DefinePlugin(await generateDefinitions(target)), new SvgSpriteGenerator({ dtsOutputFolder: path.join(__dirname, "shared", "svg-sprites"), configurations: { diff --git a/webpack/DevelBlocks.ts b/webpack/DevelBlocks.ts deleted file mode 100644 index 06431988..00000000 --- a/webpack/DevelBlocks.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {RawSourceMap} from "source-map"; -import * as webpack from "webpack"; -import * as loaderUtils from "loader-utils"; - -import LoaderContext = webpack.loader.LoaderContext; - -export default function loader(this: LoaderContext, source: string | Buffer, sourceMap?: RawSourceMap): string | Buffer | void | undefined { - this.cacheable(); - - const options = loaderUtils.getOptions(this); - if(!options.enabled) { - this.callback(null, source); - return; - } - - const start_regex = "devel-block\\((?\\S+)\\)"; - const end_regex = "devel-block-end"; - - const pattern = new RegExp("[\\t ]*\\/\\* ?" + start_regex + " ?\\*\\/[\\s\\S]*?\\/\\* ?" + end_regex + " ?\\*\\/[\\t ]*\\n?", "g"); - source = (source as string).replace(pattern, (value, type) => { - if(type === "log-networking-commands") - return value; - - return "/* snipped block \"" + type + "\" */"; - }); - this.callback(null, source); -} \ No newline at end of file