Skip to content

Commit 7cae88d

Browse files
authored
typescript update to 5.8.2 + lots of other misc (#8943)
# About the pull request Updates typescript to the latest version 5.8.2 Moves button confirm from the secondary click event to blur for the reset Also porting the scroll node searching from Monkestation/Monkestation2.0#6171 which should add some more reliability if the history was loading too slowly Additionally, porting the removal of all polyfills: tgstation/tgstation#90397 Splitting of tgui html: tgstation/tgstation#90340 Adding the changes to tgui say from tgstation/tgstation#90418 # Explain why it's good for the game # Testing Photographs and Procedure <details> <summary>Screenshots & Videos</summary> Put screenshots and videos here with an empty line between the screenshots and the `<details>` tags. </details> # Changelog :cl: fix: Fix fps / tick config not applying individually ui: Buttons now use blur to reset ui: Fix tgsay not scaling correctly when using small scale option ui: Fix edgecase with chat scrolling sometimes breaking when loading in large chat history code: Bump typescript version for tgui /:cl:
1 parent 8ebdbfa commit 7cae88d

File tree

161 files changed

+1823
-1563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+1823
-1563
lines changed

code/controllers/configuration/entries/general.dm

+2-2
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ Master controller and performance related.
324324
sync_validate = TRUE
325325
var/datum/config_entry/number/ticklag/TL = config.entries_by_type[/datum/config_entry/number/ticklag]
326326
if(!TL.sync_validate)
327-
TL.ValidateAndSet(10 / config_entry_value)
327+
TL.ValidateAndSet("[10 / config_entry_value]")
328328
sync_validate = FALSE
329329

330330
/datum/config_entry/number/ticklag
@@ -343,7 +343,7 @@ Master controller and performance related.
343343
sync_validate = TRUE
344344
var/datum/config_entry/number/fps/FPS = config.entries_by_type[/datum/config_entry/number/fps]
345345
if(!FPS.sync_validate)
346-
FPS.ValidateAndSet(10 / config_entry_value)
346+
FPS.ValidateAndSet("[10 / config_entry_value]")
347347
sync_validate = FALSE
348348

349349
/datum/config_entry/number/tick_limit_mc_init //SSinitialization throttling

code/controllers/subsystem/tgui.dm

+11-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,17 @@ SUBSYSTEM_DEF(tgui)
2828

2929
/datum/controller/subsystem/tgui/PreInit()
3030
basehtml = file2text('tgui/public/tgui.html')
31-
// Inject inline polyfills
32-
var/polyfill = file2text('tgui/public/tgui-polyfill.min.js')
33-
polyfill = "<script>\n[polyfill]\n</script>"
34-
basehtml = replacetextEx(basehtml, "<!-- tgui:inline-polyfill -->", polyfill)
31+
32+
// Inject inline helper functions
33+
var/helpers = file2text('tgui/public/helpers.min.js')
34+
helpers = "<script type='text/javascript'>\n[helpers]\n</script>"
35+
basehtml = replacetextEx(basehtml, "<!-- tgui:helpers -->", helpers)
36+
37+
// Inject inline ntos-error styles
38+
var/ntos_error = file2text('tgui/public/ntos-error.min.css')
39+
ntos_error = "<style type='text/css'>\n[ntos_error]\n</style>"
40+
basehtml = replacetextEx(basehtml, "<!-- tgui:ntos-error -->", ntos_error)
41+
3542
basehtml = replacetext(basehtml, "tgui:stylesheet", MAP_STYLESHEET)
3643

3744
/datum/controller/subsystem/tgui/OnConfigLoad()

dependencies.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export BYOND_MINOR=1655
1111
export RUST_G_VERSION=3.3.0
1212

1313
#node version
14-
export NODE_VERSION_LTS=22.11.0
14+
export NODE_VERSION_LTS=22.14.0
1515

1616
# SpacemanDMM git tag
1717
export SPACEMAN_DMM_VERSION=suite-1.8

tgui/.eslintrc.yml

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ plugins:
1515
- react
1616
- unused-imports
1717
- simple-import-sort
18+
- "@typescript-eslint"
1819
settings:
1920
react:
2021
version: '18.2'
@@ -768,3 +769,6 @@ rules:
768769
## https://github.com/lydell/eslint-plugin-simple-import-sort/
769770
simple-import-sort/imports: error
770771
simple-import-sort/exports: error
772+
773+
## Typescript
774+
"@typescript-eslint/consistent-type-imports": [error, { fixStyle: inline-type-imports }]

tgui/.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ package-lock.json
1616
/public/.tmp/**/*
1717
/public/**/*
1818
!/public/*.html
19-
!/public/tgui-polyfill.min.js
19+
!/public/ntos-error.min.css
20+
!/public/helpers.min.js
2021
/coverage
2122

2223
## Previously ignored locations that are kept to avoid confusing git

tgui/.prettierignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88

99
.swcrc
1010
/docs
11-
/public
1211
/packages/tgui-polyfill
1312
/packages/tgfont/static
1413
**/*.json
1514
**/*.yml
1615
**/*.md
16+
17+
# Avoid running on any bundles.
18+
/public/**/*
19+
# Running it on tgui.html is fine, however.
20+
!/public/tgui.html

tgui/.prettierrc.yml

+5
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
singleQuote: true
2+
overrides:
3+
- files: 'packages/tgui-setup/helpers.js'
4+
options:
5+
trailingComma: es5
6+
arrowParens: always

tgui/.yarn/releases/yarn-4.7.0.cjs renamed to tgui/.yarn/releases/yarn-4.8.1.cjs

+331-331
Large diffs are not rendered by default.

tgui/.yarn/sdks/eslint/bin/eslint.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire} = require(`module`);
4+
const {createRequire, register} = require(`module`);
55
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
67

78
const relPnpApiPath = "../../../../.pnp.cjs";
89

910
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
1012
const absRequire = createRequire(absPnpApiPath);
1113

14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
1217
if (existsSync(absPnpApiPath)) {
1318
if (!process.versions.pnp) {
1419
// Setup the environment to be able to require eslint/bin/eslint.js
1520
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
1624
}
1725
}
1826

27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
1931
// Defer to the real eslint/bin/eslint.js your application uses
20-
module.exports = absRequire(`eslint/bin/eslint.js`);
32+
module.exports = wrapWithUserWrapper(absRequire(`eslint/bin/eslint.js`));

tgui/.yarn/sdks/eslint/lib/api.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire} = require(`module`);
4+
const {createRequire, register} = require(`module`);
55
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
67

78
const relPnpApiPath = "../../../../.pnp.cjs";
89

910
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
1012
const absRequire = createRequire(absPnpApiPath);
1113

14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
1217
if (existsSync(absPnpApiPath)) {
1318
if (!process.versions.pnp) {
1419
// Setup the environment to be able to require eslint
1520
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
1624
}
1725
}
1826

27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
1931
// Defer to the real eslint your application uses
20-
module.exports = absRequire(`eslint`);
32+
module.exports = wrapWithUserWrapper(absRequire(`eslint`));
+14-2
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire} = require(`module`);
4+
const {createRequire, register} = require(`module`);
55
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
67

78
const relPnpApiPath = "../../../../.pnp.cjs";
89

910
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
1012
const absRequire = createRequire(absPnpApiPath);
1113

14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
1217
if (existsSync(absPnpApiPath)) {
1318
if (!process.versions.pnp) {
1419
// Setup the environment to be able to require eslint/use-at-your-own-risk
1520
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
1624
}
1725
}
1826

27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
1931
// Defer to the real eslint/use-at-your-own-risk your application uses
20-
module.exports = absRequire(`eslint/use-at-your-own-risk`);
32+
module.exports = wrapWithUserWrapper(absRequire(`eslint/use-at-your-own-risk`));

tgui/.yarn/sdks/eslint/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint",
3-
"version": "8.57.0-sdk",
3+
"version": "8.57.1-sdk",
44
"main": "./lib/api.js",
55
"type": "commonjs",
66
"bin": {
+14-2
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire} = require(`module`);
4+
const {createRequire, register} = require(`module`);
55
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
67

78
const relPnpApiPath = "../../../../.pnp.cjs";
89

910
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
1012
const absRequire = createRequire(absPnpApiPath);
1113

14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
1217
if (existsSync(absPnpApiPath)) {
1318
if (!process.versions.pnp) {
1419
// Setup the environment to be able to require prettier/bin/prettier.cjs
1520
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
1624
}
1725
}
1826

27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
1931
// Defer to the real prettier/bin/prettier.cjs your application uses
20-
module.exports = absRequire(`prettier/bin/prettier.cjs`);
32+
module.exports = wrapWithUserWrapper(absRequire(`prettier/bin/prettier.cjs`));

tgui/.yarn/sdks/prettier/index.cjs

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire} = require(`module`);
4+
const {createRequire, register} = require(`module`);
55
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
67

78
const relPnpApiPath = "../../../.pnp.cjs";
89

910
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
1012
const absRequire = createRequire(absPnpApiPath);
1113

14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
1217
if (existsSync(absPnpApiPath)) {
1318
if (!process.versions.pnp) {
1419
// Setup the environment to be able to require prettier
1520
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
1624
}
1725
}
1826

27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
1931
// Defer to the real prettier your application uses
20-
module.exports = absRequire(`prettier`);
32+
module.exports = wrapWithUserWrapper(absRequire(`prettier`));

tgui/.yarn/sdks/prettier/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "prettier",
3-
"version": "3.2.5-sdk",
3+
"version": "3.5.3-sdk",
44
"main": "./index.cjs",
55
"type": "commonjs",
66
"bin": "./bin/prettier.cjs"

tgui/.yarn/sdks/typescript/bin/tsc

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire} = require(`module`);
4+
const {createRequire, register} = require(`module`);
55
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
67

78
const relPnpApiPath = "../../../../.pnp.cjs";
89

910
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
1012
const absRequire = createRequire(absPnpApiPath);
1113

14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
1217
if (existsSync(absPnpApiPath)) {
1318
if (!process.versions.pnp) {
1419
// Setup the environment to be able to require typescript/bin/tsc
1520
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
1624
}
1725
}
1826

27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
1931
// Defer to the real typescript/bin/tsc your application uses
20-
module.exports = absRequire(`typescript/bin/tsc`);
32+
module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsc`));
+14-2
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire} = require(`module`);
4+
const {createRequire, register} = require(`module`);
55
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
67

78
const relPnpApiPath = "../../../../.pnp.cjs";
89

910
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
1012
const absRequire = createRequire(absPnpApiPath);
1113

14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
1217
if (existsSync(absPnpApiPath)) {
1318
if (!process.versions.pnp) {
1419
// Setup the environment to be able to require typescript/bin/tsserver
1520
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
1624
}
1725
}
1826

27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
1931
// Defer to the real typescript/bin/tsserver your application uses
20-
module.exports = absRequire(`typescript/bin/tsserver`);
32+
module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsserver`));

tgui/.yarn/sdks/typescript/lib/tsc.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire} = require(`module`);
4+
const {createRequire, register} = require(`module`);
55
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
67

78
const relPnpApiPath = "../../../../.pnp.cjs";
89

910
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
1012
const absRequire = createRequire(absPnpApiPath);
1113

14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
1217
if (existsSync(absPnpApiPath)) {
1318
if (!process.versions.pnp) {
1419
// Setup the environment to be able to require typescript/lib/tsc.js
1520
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
1624
}
1725
}
1826

27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
1931
// Defer to the real typescript/lib/tsc.js your application uses
20-
module.exports = absRequire(`typescript/lib/tsc.js`);
32+
module.exports = wrapWithUserWrapper(absRequire(`typescript/lib/tsc.js`));

0 commit comments

Comments
 (0)