Commit Graph
124 Commits
Author SHA1 Message Date
JeremiahandGitHub 3ed7d7c276 you can now write unit tests for tgui interfaces (#94971)
## About The Pull Request
now the trick is wanting to, amirite

... anyway you can write tests with [React Testing
Library](https://testing-library.com/docs/react-testing-library/intro/).
It looks pretty bare bones but I still had to fight this to get it
working ~:^)
## Why It's Good For The Game
Devs can have little a tests, as a treat
## Changelog
nothing *directly* player facing
2026-01-24 17:56:30 -05:00
JeremiahandGitHub 74dd1e48fe Bumps biome, fixes linter errors (#94614)
## About The Pull Request
I was debugging when I found that holding alt spams the UI with log
messages. The source UI causing this also wrote in old ES5 syntax . I
updated our linter to error when you write JS code like an ancient
scribe (circa 2009).

I also bumped some dependencies and fixed all the linter warnings in
tgui:lint.

The alt-click-drag functionality still works:

![dreamseeker_9Cloa5wwW1](https://github.com/user-attachments/assets/46935dfe-40c8-404c-ade9-c73608311fa8)
## Why It's Good For The Game
Less linter errors
Automatically flags/updates ES5 JS code 
## Changelog
N/A
2025-12-29 13:01:56 -05:00
e2d1fd9351 Fixes some rspack build errors (#94557)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
If you delete bun.lock for whatever reason, it'll update to a newer
rspack version which will break build 😃
So, I'm fixing it before we get hit by this. This comes bundled with
some other fixes from build time errors:

1. Rspack output path (as stated above)
2. Highlightjs doesn't bundle github dark anymore seemingly
3. Panel can read the wrong backend state, so a shim is inserted to
prevent it from erroneously suspending
4. Circular deps fixed with tgui-panel via
[plugin](https://rspack.rs/plugins/rspack/circular-dependency-rspack-plugin)
5. Fixed chat renderer functions via @ Kashargul
6. Coalesced chat settings imports courtesy @ Kashargul
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
Bug fixes before an issue is even made. The first will outright fail
builds
<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and its effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->


<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
2025-12-20 19:14:58 -08:00
JeremiahandGitHub a1313809ae Rewrites tgui kitchensink into something usable (#94400) 2025-12-11 18:28:55 +01:00
JeremiahandGitHub d49cd3337f [tgui] Replaces eslint with biome (#92144) 2025-07-26 09:13:45 +02:00
JeremiahandGitHub 87a4c082ab [tgui] Retvrn to rspack (#91982)
## About The Pull Request
Swaps us back to RSPack. I keep getting pings about this #91925, which I
can only guess is webpack related. That, and I don't want to just give
up on rspack, I was merely frustrated with it while fixing bun builds.

## Why It's Good For The Game
Less javascript. Puts us back on our last build tool. Might fix the html
entity issue
We can also run the config in ts which I think is sweet

## Changelog
2025-07-09 12:17:09 +12:00
JeremiahandGitHub 6dccb679c0 [tgui] Reworks dev server into Bun + TS (#91695)
## About The Pull Request
This started out as just a small fix for dev server crashing but lo, I
cannot keep my hands off of such a juicy rework, it now uses Bun's own
websocket server and is written entirely in typescript. It makes much
more use of console.log (you can see these in client) as well
## Why It's Good For The Game
Lets devs use tgui-dev again

## Changelog
2025-06-22 00:17:28 -07:00
JeremiahandGitHub c0c8ebe979 [tgui] Removes some unused features (#91681)
## About The Pull Request
I don't know anyone that uses these. I don't think bench is even
relevant for webview2. Even the documents are outdated (referencing
ie8).
## Why It's Good For The Game
Anything these were testing for is probably old news, which makes this
just a maintenance burden
## Changelog
2025-06-19 18:24:08 +00:00
JeremiahandGitHub e1c3946591 [tgui] Replaces node with bun (#91359)
## About The Pull Request
Swaps out node & yarn in favor of [bun](https://bun.sh/)

![image](https://github.com/user-attachments/assets/3df68cdf-98ed-477b-a9b6-5072d0de27ed)

sub tasks
- [x] add bun setup script
- [x] fix tgui-dev-server (bun glob is different)
- [x] set juke to run bun
- [x] remove all yarn stuff 
- [x] convert all tests from vitest to bun 
- [x] fight with CI/tgs

## Why It's Good For The Game
Yarn has served us over the years as our package manager but the method
it bundles dependencies has lead to issues and setbacks, notably needing
to wait on rspack support, but more recently in trying to switch to
biome
1. I can add in packages that do not need these workarounds, like god
intended
2. We won't need to [keep around
sdks](https://yarnpkg.com/getting-started/editor-sdks) which rely on
yarn to even publish
3. We're not committing the yarn cache or .pnp file, which kind of
defeats the purpose
4. Native typescript support and testing
5. Because it'd be cool

## Caveats
Rspack was throwing errors on TGS while doing this. I needed to switch
back to webpack/swc, which seems to work flawlessly. It was too tiring
for anyone involved to debug and this was the simplest route. It adds a
completely negligible amount of time to build. It might even resolve
some issues elsewhere.

Making this switch extends that very first setup time! I'm working on
cutting it down, but as of right now, it takes about 80 seconds just for
TGUI to download all the packages. Afterwards, it's the same.
## Changelog
2025-06-17 09:03:23 +12:00
JeremiahandGitHub 9db2f6916b Sets prettier to run on the repo (#91379)
## About The Pull Request
Prettier (an auto formatter) is set to only run within the tgui folder
currently. This removes that limitation, allowing it to automatically
format all supported files in the repo (.js, .html, .yml
[etc](https://prettier.io/docs/))

I made a few exceptions for bundled and generated files
## Why It's Good For The Game
I'm of the opinion that code should look uniform and am lazy enough to
want CTRL-S to format files without having to think beyond that
## Changelog
2025-05-29 21:23:59 -07:00
JeremiahandGitHub c21ad3e2f6 [tgui] Removes url-loader (#91329)
## About The Pull Request
Url loader is deprecated as of webpack v5 as its functionality is
included in both webpack and rspack

We also had a file icon module for whatever reason. It's gone now, and
the file diff is MASSIVE.
Here's how to add your own icon themes
https://medium.com/nerd-for-tech/my-top-vscode-themes-and-icons-8f5754054639

This allows me to do other things, like change the package manager
## Why It's Good For The Game
It should be faster and I want to do aforementioned things
## Changelog
2025-05-24 20:41:22 -04:00
JeremiahandGitHub 3ff737f3f8 [tgui] dependencies + css loading switch (#90840)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
a) updates some dependencies in the project, hopefully fixing this
server lockup bug
b) if a. does not fix it, this uses two separate build methods for tgui.
it's kind of gross, I really dislike that this needs to exist, but
experimental css breaks tgui-dev and css-extract breaks tgui live.
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
So the server doesn't lock up sometimes
<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and its effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->
2025-04-28 09:36:10 +12:00
JeremiahandGitHub c34057b49b [tgui] Fixes dev server issues (#90646)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
The dev server has had an issue where it required devs to press F5 just
to link in for quite some time. Now with 516, it required F5 for *every*
update and would bluescreen at random due to a css issue. This PR fixes
those problems, making the dev server hook in and load updates like it
should. It's interesting to see that both the 515 issue and the 516
issue were simple url problems that have compounded in the same place.

If you're on a downstream and wish to make this change without the
additional typings and conversions to esm, it's just the url - there's
an extra slash in the base url and the dummy file must be dummy.htm /
dummy.html.

Other changes:
- bumps rspack minor version
- readds file system caching that was on webpack
- removes a deprecated module w/ warnings
- converts the debug tgui kitchensink to TS

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
The tgui dev server should work
Fixes #89387
<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->
2025-04-16 23:44:14 -05:00
JeremiahandGitHub 8cfd21022e tgui: Shiny new dev tools (#90522)
## About The Pull Request
Old project that I have been waiting on for some time. We can swap out
our javascript bundler with a rust version. We still have webpack to
some extent because sass-loader requests it, but it's unused.

This was originally suggested by stylemistake years ago but it depended
on tgui using a modern browser #90397 and rspack supporting yarn pnp
https://github.com/web-infra-dev/rspack/pull/7639.

I want to also replace jest with vitest for this PR since it's deep
internals and no one else is really tinkering here. Drafting for now
## Why It's Good For The Game
Both of these tools are the drop in replacement of the modern decade
Makes the dev server borderline instant


https://rspack.dev/misc/faq#what-are-the-advantages-of-rspack-compared-to-webpack--swc-loader
## Changelog
2025-04-12 09:55:13 -04:00
d7d22f7c85 [TGUI v6] Migration to CSS Variables, styles refactor & React 19 (#90424)
## About The Pull Request
> [!IMPORTANT]  
> This PR need's a tgui-core v2 release
> Until then, and until I'm sure everything is fine and I'm satisfied,
PR will be in the draft.
> Also TestMerge would be useful as there are quite a lot of changes and
I might have made a mistake somewhere

Moving all SCSS variables to 21th century technology - [CSS
Variables](https://developer.mozilla.org/en-US/docs/Web/CSS/var)
All variables are taken from and depend on tgui-core. However, you are
free to create completely new variables as well as tgui-core-dependent
variables.
This step gives you much more flexibility when creating themes and
manipulating colors
For more details, go
[here](https://github.com/tgstation/tgui-core/pull/112)

Also a few little things:
- Links in chat got a new colors and no underline on hover
- TGsay scrollbar replaced with thin default scrollbar

### Themes
Some themes started to look a little different, as well as more
coherent, since the replaced color changes in all components, not just
the imported ones
<details> <summary> Examples </summary>

Terminal
| Before | After | Before - KitchenSink | After -  KitchenSink
| - | - | - | - |
|
![image](https://github.com/user-attachments/assets/df285eb7-5809-49cd-8b84-87b5d3d48852)
|
![image](https://github.com/user-attachments/assets/6faeb9bf-b078-4587-b0eb-c04b141d862b)
|
![image](https://github.com/user-attachments/assets/db5829c6-8ade-4bde-8ca4-bbe7d25e2d25)
|
![image](https://github.com/user-attachments/assets/e0195ace-be38-480c-ace8-dcd299a43099)
|

NTOS95
| Before | After | Before - KitchenSink | After -  KitchenSink
| - | - | - | - |
|
![image](https://github.com/user-attachments/assets/78842609-7216-4679-9b28-dd87c473f533)
|
![image](https://github.com/user-attachments/assets/c9b01ef6-67b8-4821-ba0c-210f1c715829)
|
![image](https://github.com/user-attachments/assets/378c4a6b-6a1a-4828-9e32-aafff88e45c7)
|
![image](https://github.com/user-attachments/assets/17a55ee8-2c79-4838-a520-2f409e7096fc)
|

</details>

These are not all the themes that have received improvements, but in the
rest of them they are small
There may also be bugs, so TestMerge is highly recommended

### TGchat unread counter
I've made some changes into the chat tab unread coutner, you can see it
bellow
It now takes up no space in the tab and has absolute positioning in the
top right corner


![image](https://github.com/user-attachments/assets/43c59cd5-00b4-4872-8a79-42a1de70567e)

### TODO

- [x] Migrate all themes to CSS Variables
- [x] Migrate all UI styles to CSS Variables
- [x] _Test everything I can get with my hands on to make sure nothing
is missing or broken_

Also, I think in the future it would be good to drop color.scss,
base.scss and functions.scss files from the repository and use tgui-core
files.

### Removed as unused style files
I can't find any defined in it classes as used

1. PersonalCrafting.scss
2. TachyonArray.scss
3. UtilityModulesPane.scss

## Why It's Good For The Game
All compiled styles have a much smaller size, as there is no need to use
SCSS to compile themes, in fact it is enough just to change the values
of variables
It also gives you the ability to use custom cursors in themes if you
override --cursor-xxx variables

After all themes migration: 763kb -> 210kb tgui.bundle.css

As well as more consistent colors in the theme and the ability to create
MORE diverse themes, of varying degrees of complexity
And... maybe... light theme for TGUI

## Changelog

🆑
refactor: All TGUI styles was migrated to CSS Variables, if you find
something odd in styles, feel free to make an issue on GitHub
/🆑

---------

Co-authored-by: jlsnow301 <jlsnow301@pm.me>
2025-04-09 02:34:49 -07:00
JeremiahandGitHub 6e4eb7ab61 516 only tgui (#90397)
## About The Pull Request
oooooh boy, have I been waiting on this PR. It was one of the first
things I tried when I got into 516 alpha. With this, we shuffle off all
the polyfills that makes TGUI build like it's still on IE.

TGUI should look and function exactly the same.

1. updated webpack build targets
2. removed polyfills
3. removed trident references
4. removed trident-only storage
5. updated documentation
6. bumped yarn (sorry, this makes the file diff huge but it seems to be
required)
7. fixed some prettier warnings
## Why It's Good For The Game
TGUI builds without restraint. Smaller bundle size, smaller overhead
## Changelog

🆑
add: TGUI is now v6! No more internet explorer. All gloves are off, it's
running edge under the hood now. Report any issues to the github,
please. Yes, I look!
/🆑
2025-04-06 21:25:24 +02:00
KashargulandGitHub 721e12ed8b tg chat settings export and import (#89811)
In rare cases, we could lose the telemetry or ready message. We'll now
have a check to re-request once if we did not receive any telemetry.

Also the chat was able to init before the setting were loaded, even
though a rare condition, this could lead to the setting wiped.

Recommending to TM, as our chat differs heavily from the original and I
only gave it a short test.

## About The Pull Request
## Why It's Good For The Game
## Changelog
🆑
fix: TG chat can no longer initialize before the settings loading was
called
qol: chat settings can be exported and imported
/🆑
2025-03-05 14:14:23 -08:00
JeremiahandGitHub 2e5642f4d9 Fully converts tgui to use tgui-core (#88648)
## About The Pull Request
Giant file diff, but 99% of this PR is just swapping imports

We've tested changes slowly with #83789, #84660, and #87763. I think
tgui-core is in a good place and the risk of not fully switching is
outweighing inaction (in that people are getting confused that there's
two sets of ui components #86495).

This PR makes some small changes here and there that I saw, spot checks
like importing `TableCell` when you don't need to, triple boolean casts
`!!!` etc.
## Why It's Good For The Game
Most of all, code improvement. Tgui has been sitting in limbo as I
ironed out errors with tgui core.

We now have one source of all components, common functions etc for tgui.
This enables cross-game collaboration between the different versions of
SS13 running TGUI.
2025-01-03 07:35:58 +00:00
JeremiahandGitHub 13ac419b9b [tgui] Fixes sassy warnings (#87776)
## About The Pull Request
Sass was warning about deprecated APIs in our codebase. Went through and
fixed them

Used sass-migrator tool as much as I could, some were by hand

### Updated:
Sass would no longer let you run functions on hex color codes so I went
through and HSL'd them all, how cool! If you have a simpler way to
approach this, let me know

Adds a tool to convert hex to HSL
## Why It's Good For The Game
None of this

![image](https://github.com/user-attachments/assets/35d3dbeb-f62f-4485-bb2e-889c5d4453e2)
## Changelog

N/A
2024-11-13 16:08:26 +13:00
JeremiahandGitHub d131084830 [tgui] Dependency updates (#87723)
## About The Pull Request
Some various dependency updates for tgui
## Why It's Good For The Game
Shiny!
## Changelog

N o p e n/a
2024-11-08 16:08:29 +13:00
JeremiahandGitHub 8522aeac41 [tgui] Bumps node & yarn versions (#87700)
## About The Pull Request
- Node 22 LTS and Yarn 4.5.1
- Removes windows 7 compatibility support
- Set to install for you on the next build
- CI also bumped to Node LTS
## Why It's Good For The Game
Oil change for TGUI. Up to date and fresh!
## Changelog

N/A
2024-11-05 18:18:48 -05:00
JeremiahandGitHub 708a5a1498 TGUI: updated dependencies (#82377)
## About The Pull Request
Updates some of the dependencies in tgui. Should have zero gameplay
impact at all.

This puts our typescript version up to 5.4.3! And it detected errors
immediately

## Why It's Good For The Game
Bzzz here comes the airplane

## Changelog
N/A
2024-04-02 21:51:16 -06:00
JeremiahandGitHub 0ae28c6f0e TGUI: bumps yarn version (#82385)
## About The Pull Request
Bumps our bundled yarn version up to 4.1.1.

This seemed previously impossible due to an indecipherable error
message:
```
SyntaxError: missing ) after argument list
    at wrapSafe (internal/modules/cjs/loader.js:979:16)
```

I'm assuming this was a bug in (earlier) versions of yarn ~4.0.2.
Meaning, this is probably worth testing or test merging, as it seems to
be running fine currently.
## Why It's Good For The Game
Better build tools
## Changelog
N/A
2024-04-02 17:36:21 -06:00
jimmylandGitHub c7d5e6d72b two new tgui commands (for coders) (#81381)
## About The Pull Request

tgui:prettier-fix runs prettier fixes
tgui:eslint-fix runs eslint fixes

## Why It's Good For The Game


![image](https://github.com/tgstation/tgstation/assets/70376633/dadf7047-5fc0-498b-93a5-53d03a706b73)
2024-02-11 00:43:50 +01:00
JeremiahandGitHub b22835545d Replaces eslint radar with sonarjs (#80454)
## About The Pull Request
Radar is deprecated and a poor linter.

[Sonarjs](https://github.com/SonarSource/eslint-plugin-sonarjs) is the
(maintained) successor

This replaces it
## Why It's Good For The Game
Better dev tools and no more error during build
## Changelog
N/A nothing player facing
2023-12-23 20:05:14 +01:00
JeremiahandGitHub 6ccb751678 Updates eslint + sorts imports (#80430)
## About The Pull Request
General maintenance for eslint + adds an autofix for import sorting

If you're a reviewer/downstream, don't worry s'much about the file diff,
these are automated changes. To port this is pretty simple:
- `cd tgui`
- Update other packages (optional)
- `yarn add eslint-plugin-simple-import-sort`
- Add linter rules: eslintrc.yml
[guide](https://github.com/lydell/eslint-plugin-simple-import-sort?tab=readme-ov-file#usage)
&& file format rules to eslintignore
- `yarn eslint packages --fix`

Done!

## Why It's Good For The Game
Dev exp ++
## Changelog
N/A nothing player facing
2023-12-18 13:15:59 -08:00
JeremiahandGitHub d32693e5e6 Replaces babel with swc (#80310)
## About The Pull Request
Revival of #79943. I was not done with Babel. For some reason, swc was
running very high memory. It was the minifier. If we use our current,
only swapping out babel (the previous PR swapped the minifier AND
transpiler), we not only keep the memory usage down to current levels
but we **slash** TGUI build times. Look at these numbers!

<details>
<summary>Test environment / My specs</summary>

intel i7-13700kf 
32GB RAM
windows 11 
intel 660p m.2 SSD
asus 4080 TUF series

</details>

<details>
<summary>Benchmarks</summary>

### To perform these tests, build/install/compile once, then delete
everything in the tgui/.yarn/webpack folder and all files in tgui/public
**EXCEPT** tgui.html and tgui-polyfill.min.js

Babel is our CURRENT.

Build time 

![2](https://github.com/tgstation/tgstation/assets/42397676/05324a54-2230-4173-a443-ef2aaa82e034)
SWC is 64.36% faster than our current solution

Peak memory usage

![1](https://github.com/tgstation/tgstation/assets/42397676/ab84a91d-7e48-43f8-be1b-7b7b9b36f30a)

</details>

What's the catch? Do we need to use node_modules now? No!

## Why It's Good For The Game
Faster build tools!
## Changelog
N/A nothing player facing
2023-12-14 23:02:19 -08:00
JeremiahandGitHub 6b30843774 Converts some of tgui-panel to typescript (#80057)
## About The Pull Request
Converted some files to typescript, removed some of the ie8
functionality of tgui panel.

There should be no functional difference to this UI.
## Why It's Good For The Game
More maintainable code.
## Changelog
N/A nothing player facing
2023-12-09 18:29:56 +01:00
JeremiahandGitHub 2631b0b8ef Replaces prettierx with the normal prettier (#80189)
## About The Pull Request
Oh god the file diff... I'm so, so sorry.

No need to worry though. This just replaces the prettierx version that
we were using and replaces it with normal prettier. Most of the settings
were default or no longer valid with this version.
## Why It's Good For The Game
You no longer get this warning #70484

It actually drives me up the wall and I have to click it each time I
open my editor.
## Changelog
N/A nothing player facing
2023-12-09 11:18:17 +13:00
0454525d75 Ports React [READY] (#80044)
## About The Pull Request
Moves us from Inferno 7.4.11 to React 18.2. This is a big project! You
might find errors here. Sometimes I get carried away fixing external
issues, I'll try to atomize them into separate PRs.

- [x] Implements React
- [x] CSS kebab to camel case
- [x] Some typescript refactors 
- [x] Atomize what I can
- [x] Fix dropdowns (opens in the wrong location)
- [x] Fix wonky button placement in a few UIs
- [x] Cleanup
## Why It's Good For The Game
- It'd be nice to just have real hooks. Our implementation is probably
the best possible for Inferno, don't get me wrong.
- React is just easier to maintain and easier to read. It's the web dev
standard.

Closes #78221 
## Changelog
🆑
refactor: TGUI V5: The UI has had its entire engine replaced with React
v18.2. This might cause obvious or laughably broken UIs in places you
wouldn't expect. Please report any issues you find to the repo!
/🆑

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2023-12-08 22:30:49 +01:00
JeremiahandGitHub 60cf2629e5 Drops ie8 support (#79974)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
We currently transpile TGUI down into ie8. This was primarily for Linux
compatibility, which, to my understanding, hasn't worked for quite some
time. As we approach 2024, consider that ie8 is nearly 15 years old and
had its support ended in 2016. I believe sunsetting ie8 is in order.

>I have no objections to remove IE8 support and fully target IE11.

https://github.com/tgstation/tgstation/issues/79943#issuecomment-1826735705_

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
- Probably improves performance to some degree, you're only as slow as
your weakest link.
- Reduced maintenance burden
<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

N/A if they can even see this message it doesn't affect them

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
2023-11-28 13:54:11 -08:00
JeremiahandGitHub 5766fbaf6d Improves tgui build speed (#79916)
## About The Pull Request
Swaps out our minimizer, Terser, with esbuildplugin. This is the engine
behind vite. This is a pretty straight forward replacement, let's let
the numbers do the talking:


<details>
<summary>Test environment / My specs</summary>

intel i7-13700kf 
32GB RAM
windows 11 
intel 660p m.2 SSD
asus 4080 TUF series

</details>

<details>
<summary>Fresh build</summary>

Test steps:

1. Delete `tgui/.yarn/webpack` folder
2. `CTRL SHIFT B`

Results:

![fresh](https://github.com/tgstation/tgstation/assets/42397676/f337366f-2260-41b7-9ad6-f81f6f78e9e7)

terser averages `25.16s`
esbuild averages `19.37s` - 23% faster

</details>

<details>
<summary>Cached build</summary>

(assuming files are already there, CTRL SHIFT B if not)

1. add a comment to an interface file
2. `CTRL SHIFT B`

Results:

![cached](https://github.com/tgstation/tgstation/assets/42397676/89dc1c4b-a5b4-436d-a7e2-86683b6168f4)

terser averages `9s`
esbuild averages `3.52s` - 60.91% faster

</details>

## Why It's Good For The Game
Faster dev environment
## Changelog
N/A nothing player facing
2023-11-28 13:25:29 +13:00
JeremiahandGitHub 40b1c35428 Updates several packages for tgui (#79895)
## About The Pull Request
Woah! Shiny!

Updates most of tgui's internals. Nothing player facing. Tested and
working
## Why It's Good For The Game
Good housekeeping
## Changelog
N/A nothing player facing
2023-11-25 15:33:25 -08:00
AnturKandGitHub dec62713b5 Updates webpack to latest (#73457)
Alright this node situation is pretty complicated, so let's start with
making it work.
The surface level issue is webpack version we use does not support new
node provided in windows images.
This doesn't change any node dependencies/how we install it in the
runners.
2023-02-16 10:56:11 -08:00
a32522d0d8 tgui: Updates typescript, other dependencies (#72279)
## About The Pull Request
The largest change to this is that it updates typescript from 4.3.5 to
4.9.4.

It also does some QoL to update @ types, yarn version, and
typescript-eslint-parser (OPTIONAL)

I did this by:
1. Updating typescript `yarn add typescript`
2. Updating other types `yarn add @types/...`
3. Repackaging typescript (and other) workplace sdks `yarn dlx
@yarnpkg/sdks`
4. Updates yarn via corepack `yarn set version stable`
5. Fixes a couple places where typescript was mad

## Why It's Good For The Game
- I want to do things like make discriminating type unions
- Huge leap into typescript so I can better type out tgui core
- TS >>> JS

## Changelog
N/A Nothing player facing

Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2022-12-31 14:38:57 -08:00
AnturKandGitHub 4ae83ab362 Disables browserlist update message (#69209)
We only care about IE functionality here, the data updates are pretty irrelevant for us and it's confusing for new coders.
2022-08-15 12:31:20 -07:00
731ab29aa7 Adds Prettierx - or how I broke TGUI for the nth time (#67935)
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2022-06-23 18:10:22 -07:00
Aleksej KomarovandGitHub b86cf89125 tgui: API improvements + docs (#65943)
About The Pull Request

This pull request improves tgui API in many ways.

Using TGUI for custom HTML popups

This standardizes and simplifies the process of HTML popup creation and DM <-> JS communication.

Makes tgui window API a perfect alternative for old-style browser panels. It will be super useful for @Iamgoofball since he wanted to make a lightweight browser element that plays background music, and this will make his life a lot easier.

It is now possible to create tgui windows with fully inlined JS and CSS, which can be used to make unkillable tgui-based UIs (can't white/blue screen due to network errors). You can split files into JS and CSS, and still serve a single HTML file using this.

Moved sendMessage function to the Byond API object, where it rightfully belongs, and now supports a shorthand form: Byond.sendMessage(type, payload). This shortens and simplifies a lot of code.

Refactored window.update to no longer be public. Now to subscribe to incoming messages, you should use new public APIs: Byond.subscribe(fn) and Byond.subscribeTo(type, fn), and TGUI internally uses these functions as well, which reduces boilerplate in index.js.

Renamed window.__windowId__ to Byond.windowId (old variable is still available for backwards compatibility).

Byond API now supports null id, e.g. Byond.winget(null, 'url'), which makes things like this possible:

// Fetch URL of a currently connected server
Byond.winget(null, 'url').then((serverUrl) => {
  // Connect to this server (opens a new dreamseeker instance)
  Byond.call(serverUrl);
  // Close this client because new instance is connecting
  Byond.command('.quit');
});

Certain polyfills are now statically compiled (commited into git) and are baked into tgui.html. The downside is that HTML went 16 kB -> 50 kB. The upside is that you can now use a relatively modern level API with full support for IE8 when writing plain old html UIs using /datum/tgui_window directly. They are committed into git, because polyfills will never need to be updated (unless of course we randomly decide to get rid of ie8.js and html5shiv.js).
Breaking Changes

No breaking changes. This should be tested for regressions. Upgrading is simple if you're on a relatively up-to-date branch - copy paste all affected tgui files and you're good.
2022-04-18 14:07:55 +12:00
Aleksej KomarovandGitHub 8707ea0755 Yarn 3.1 (#63088) 2021-11-29 00:49:55 +01:00
MothblocksandGitHub 5a4c87a9fc tgui Preferences Menu + total rewrite of the preferences backend (#61313)
About The Pull Request

Rewrites the entire preferences menu in tgui. Rewrites the entire backend to be built upon datumized preferences, rather than constant additions to the preferences base datum.

Splits game preferences into its own window.

Antagonists are now split into their individual rulesets. You can now be a roundstart heretic without signing up for latejoin heretic, as an example.

This iteration matches parity, and provides very little new functionality, but adding anything new will be much easier.

Fixes #60823
Fixes #28907
Fixes #44887
Fixes #59912
Fixes #58458
Fixes #59181
Major TODOs

Quirk icons, from @Fikou (with some slight adjustments from me)
Lore text, from @EOBGames (4/6, need moths and then ethereal lore from @AMonkeyThatCodes)
Heavy documentation on how one would add new preferences, species, jobs, etc

    A lot of specialized testing so that people's real data don't get corrupted

Changelog

cl Mothblocks, Floyd on lots of the design
refactor: The preferences menu has been completely rewritten in tgui.
refactor: The "Stop Sounds" verb has been moved to OOC.
/cl
2021-09-15 10:11:11 +12:00
Aleksej KomarovandGitHub 26f56653c6 tgui-bench (#61081)
Added a package that allows precisely benchmarking tgui components on IE11 without having the game launched.

It has a convenient syntax for writing tests, just create a file packages/tgui-bench/tests/*.test.tsx, and export a function which you want to benchmark

Performance improvements
As part of this PR, I have also improved the raw performance of some tgui components:

Button component - 1.8x faster
Flex component - 1.1x faster
Stack component - 1.3x faster
This improves performance of heavy UIs by a tiny bit.
2021-09-09 18:11:41 +01:00
Aleksej KomarovandGitHub a7753ad6fd Juke Build 0.9.0 (#61005)
* Juke Build 0.9.0

* Fix a small bug with build.js

* Distill cmds

* Return sonar

* Revert those build.cmd changes

* Some improvements

* Treat all sonar warnings as errors because they should fail the sonar target

* Do not clean up bootstrap cache because it locks up on removing it
2021-08-25 16:09:00 +02:00
Aleksej KomarovandGitHub 9bbabfe36b tgui maintenance chores (#60859)
## About The Pull Request

**Upgrades:**

- Yarn 3.0
- TypeScript 4.3
- Sass 1.37
  - Required some refactoring of `/` into `math.div()` in CSS

**Dependency removals:**

- Removed ESM package, see: https://github.com/standard-things/esm/pull/902

I initially thought it was impossible to stop relying on this package, but fortunately, ES module support in Node 12+ now comes standard and I only had to convert the very few external module imports to `require()` (because Yarn PnP).

I also moved `logging.js` directly into `tgui-dev-server` package, because that's where it is used. One less internal dependency.

**Sidegrades:**

- Removed creation of a common tgui chunk, because in practice it creates unnecessary complexity (devs sometimes get a white screen due to this chunk being invalid) and doesn't really save that much data on CDN, and **definitely** doesn't make tgui load faster.

I think that is all. I tested it a bit and everything seemingly works.
2021-08-16 12:21:45 -04:00
Aleksej KomarovandGitHub b4d526f768 Upgrade tgui dependencies (#58484) 2021-04-17 22:49:40 -07:00
Aleksej KomarovandGitHub 29556e879b Upgrade tgui dependencies, make yarn task skippable (#58081)
* Upgrade tgui dependencies, make yarn task skippable

* Use a phony target to avoid double rebuilds
2021-04-01 11:00:35 +02:00
Aleksej KomarovandGitHub 8080a5132c tgui: ESLint and VSCode settings improvements (#57905)
Added column 80 rulers to all javascript and scss files.
    Added a "prettier" config to have sensible defaults for those who prefer to use it.
    Added RadarJS (fork of SonarQube's SonarJS). Launchable only via bin/tgui --lint-harder for now.
    Disabled ESLint rule for parens around arrow function arguments, because in TypeScript they're pretty much always required, and I don't want to replace it throughout the codebase.
    Removed unused javascript extensions from tooling (jsx, mjs).
2021-03-23 23:35:19 +00:00
Aleksej KomarovandGitHub 9447383f5a tgui: Upgrade to Yarn 2.4.1 and TypeScript 4.2 (#57465) 2021-03-06 14:42:56 -08:00
Aleksej KomarovandGitHub 21d5a65346 Fix a number of build issues (#57251)
* Fix finding of dreamseeker instances and not die on cache copy failures

* Upgrade dependencies, resolve webpack dependencies explicitly

* Preload tgui asset to fix reloading of a not yet sent tgui asset

* Rewrite node bootstrap and DM build task

* Redundant array accessor

* Add install-state.gz to tgui build dependencies

* Update build.js

* Use a proper dmlang vscode var
2021-02-28 14:24:34 +01:00
1fb5d68b53 tgui: Typescript and Jest update (#57081)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-02-22 01:18:35 -08:00
Aleksej KomarovandGitHub 25aae82af1 Upgrade marked to 2.0.0, along with other deps (#56767) 2021-02-08 20:56:16 -08:00