mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 09:01:39 -05:00
Switch to dynamically loaded imports
This doesn't actually seem to work though - TridactylThemeDefault still appears in the root classes
This commit is contained in:
parent
6c701fd83b
commit
c2a3dfab61
2 changed files with 37 additions and 37 deletions
|
@ -13,7 +13,7 @@ import "@src/lib/html-tagged-template"
|
||||||
/* import "@src/content/commandline_content" */
|
/* import "@src/content/commandline_content" */
|
||||||
/* import "@src/excmds_content" */
|
/* import "@src/excmds_content" */
|
||||||
/* import "@src/content/hinting" */
|
/* import "@src/content/hinting" */
|
||||||
import * as Config from "@src/lib/config"
|
import * as config from "@src/lib/config"
|
||||||
import * as Logging from "@src/lib/logging"
|
import * as Logging from "@src/lib/logging"
|
||||||
const logger = new Logging.Logger("content")
|
const logger = new Logging.Logger("content")
|
||||||
logger.debug("Tridactyl content script loaded, boss!")
|
logger.debug("Tridactyl content script loaded, boss!")
|
||||||
|
@ -24,46 +24,45 @@ import {
|
||||||
addContentStateChangedListener,
|
addContentStateChangedListener,
|
||||||
} from "@src/content/state_content"
|
} from "@src/content/state_content"
|
||||||
|
|
||||||
|
import { CmdlineCmds } from "@src/content/commandline_cmds"
|
||||||
|
import { EditorCmds } from "@src/content/editor"
|
||||||
|
|
||||||
|
import { getAllDocumentFrames } from "@src/lib/dom"
|
||||||
|
|
||||||
|
import state from "@src/state"
|
||||||
|
import { EditorCmds as editor } from "@src/content/editor"
|
||||||
|
/* tslint:disable:import-spacing */
|
||||||
|
|
||||||
|
config.getAsync("disable").then(async TRI_DISABLE => {
|
||||||
// Set up our controller to execute content-mode excmds. All code
|
// Set up our controller to execute content-mode excmds. All code
|
||||||
// running from this entry point, which is to say, everything in the
|
// running from this entry point, which is to say, everything in the
|
||||||
// content script, will use the excmds that we give to the module
|
// content script, will use the excmds that we give to the module
|
||||||
// here.
|
// here.
|
||||||
import * as controller from "@src/lib/controller"
|
const controller = await import("@src/lib/controller")
|
||||||
import * as excmds_content from "@src/.excmds_content.generated"
|
const excmds_content = await import("@src/.excmds_content.generated")
|
||||||
import { CmdlineCmds } from "@src/content/commandline_cmds"
|
const hinting_content = await import("@src/content/hinting")
|
||||||
import { EditorCmds } from "@src/content/editor"
|
|
||||||
import * as hinting_content from "@src/content/hinting"
|
|
||||||
|
|
||||||
// Hook the keyboard up to the controller
|
// Hook the keyboard up to the controller
|
||||||
import * as ContentController from "@src/content/controller_content"
|
const ContentController = await import("@src/content/controller_content")
|
||||||
import { getAllDocumentFrames } from "@src/lib/dom"
|
|
||||||
|
|
||||||
// Add various useful modules to the window for debugging
|
// Add various useful modules to the window for debugging
|
||||||
import * as commandline_content from "@src/content/commandline_content"
|
const commandline_content = await import("@src/content/commandline_content")
|
||||||
import * as convert from "@src/lib/convert"
|
const convert = await import("@src/lib/convert")
|
||||||
import * as config from "@src/lib/config"
|
const dom = await import("@src/lib/dom")
|
||||||
import * as dom from "@src/lib/dom"
|
const excmds = await import("@src/.excmds_content.generated")
|
||||||
import * as excmds from "@src/.excmds_content.generated"
|
const finding_content = await import("@src/content/finding")
|
||||||
import * as finding_content from "@src/content/finding"
|
const itertools = await import("@src/lib/itertools")
|
||||||
import * as itertools from "@src/lib/itertools"
|
const messaging = await import("@src/lib/messaging")
|
||||||
import * as messaging from "@src/lib/messaging"
|
const State = await import("@src/state")
|
||||||
import state from "@src/state"
|
const webext = await import("@src/lib/webext")
|
||||||
import * as State from "@src/state"
|
const perf = await import("@src/perf")
|
||||||
import * as webext from "@src/lib/webext"
|
const keyseq = await import("@src/lib/keyseq")
|
||||||
import * as perf from "@src/perf"
|
const native = await import("@src/lib/native")
|
||||||
import * as keyseq from "@src/lib/keyseq"
|
const styling = await import("@src/content/styling")
|
||||||
import * as native from "@src/lib/native"
|
const updates = await import("@src/lib/updates")
|
||||||
import * as styling from "@src/content/styling"
|
const urlutils = await import("@src/lib/url_util")
|
||||||
import { EditorCmds as editor } from "@src/content/editor"
|
const scrolling = await import("@src/content/scrolling")
|
||||||
import * as updates from "@src/lib/updates"
|
const R = await import("ramda")
|
||||||
import * as urlutils from "@src/lib/url_util"
|
const visual = await import("@src/lib/visual")
|
||||||
import * as scrolling from "@src/content/scrolling"
|
const metadata = await import("@src/.metadata.generated")
|
||||||
import * as R from "ramda"
|
|
||||||
import * as visual from "@src/lib/visual"
|
|
||||||
import * as metadata from "@src/.metadata.generated"
|
|
||||||
/* tslint:disable:import-spacing */
|
|
||||||
|
|
||||||
config.getAsync("disable").then(TRI_DISABLE => {
|
|
||||||
|
|
||||||
if (TRI_DISABLE === "true") return
|
if (TRI_DISABLE === "true") return
|
||||||
|
|
||||||
|
@ -334,7 +333,7 @@ config.getAsync("modeindicator").then(mode => {
|
||||||
} else {
|
} else {
|
||||||
result = mode
|
result = mode
|
||||||
}
|
}
|
||||||
const modeindicatorshowkeys = Config.get("modeindicatorshowkeys")
|
const modeindicatorshowkeys = config.get("modeindicatorshowkeys")
|
||||||
if (modeindicatorshowkeys === "true" && suffix !== "") {
|
if (modeindicatorshowkeys === "true" && suffix !== "") {
|
||||||
result = mode + " " + suffix
|
result = mode + " " + suffix
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
|
"module": "es2020",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"noEmitOnError": true,
|
"noEmitOnError": true,
|
||||||
"outDir": "build/tsc-out",
|
"outDir": "build/tsc-out",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"target": "es2019",
|
"target": "es2019",
|
||||||
"lib": ["es2019", "dom", "dom.iterable"],
|
"lib": ["es2020", "dom", "dom.iterable"],
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"alwaysStrict": true,
|
"alwaysStrict": true,
|
||||||
"strictBindCallApply": true,
|
"strictBindCallApply": true,
|
||||||
|
|
Loading…
Add table
Reference in a new issue