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.
## 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>
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.
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#60823Fixes#28907Fixes#44887Fixes#59912Fixes#58458Fixes#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
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.
* 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
## 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.
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).
* 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
Fixes#56237
Unblocks #56704
Besides fixing the above mentioned issue with ExoFab UI, I fixed a few tgui component bugs and added a few improvements. Not really atomizable, sorry.
Section changes
level property is now gone, section level is automatically calculated.
Nested sections automatically become transparent.
Nested sections are now properly incapsulated and won't inherit properties of parent sections.
This allows using nested non-scrollable sections, while parent is, for example, scrollable.
Tabs changes
Tabs without a parent section will pretend they are a section (and will look as such, with dark background).
Top corners of tabs are a bit rounded to make it look more like a tab.
Background color for selected and hovered tabs (previously it was just an underline).
2px margin around the tabs, to make them stand out a bit from the section background.
Two new props:
fill - Same as <Section fill>
fluid - Tabs use full width of the container.
scrollable property was not implemented because it's a bit complicated (requires converting it into a class, registering its scrollable node with tgui, etc). If you need scrollable, just wrap tabs with a Section like a good man.
Upgraded Yarn to 2.3.3
Fixes building for people who use non-latin characters and spaces in their paths to tgstation repo.
Removed webpack notifier
RIP
WSL users can now build tgui and not get errors about .pipe.
Refactoring of Flex, Fix Section scrollable
Getting presets working
wip
Upgrade dependencies
preset notice, tooltip fixes, pod spawnlocation fixes
finishes UI, final polish
quells one travismoment
Apply suggestions from code review
Co-authored-by: Rohesie <rohesie@gmail.com>
better var names
better vars
sound for loop
Further review addressing
runtime fixes
Update code/modules/asset_cache/asset_list_items.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
More review addressing
tgui merge
why was that there
Small improvements
Small Improvements Part 2
dropoff / wall moving improvements
compile!
more fixes
This pull request upgrades Yarn to version 2 (also known as Yarn Berry).
* Update build validator
* Provide inferno in the root level package
* Remove type module from package.json
* Powershell build script
This PR changes the message pipeline a little bit to support list-based messages, which can be annotated with custom data. Function signature of to_chat was slightly changed as well:
// Plain text message
to_chat(client,
type = MESSAGE_TYPE_INFO,
text = "foo")
// HTML message
to_chat(client,
type = MESSAGE_TYPE_INFO,
html = "<span class='notice'>foo</span>")
Old to_chat format is still supported, but handle_whitespace, trailing_newline and confidential flags have no effect. confidential flag could still be revived though, if there is enough merit in it, for example to filter out confidential messages when saving a chat log.
The reason for using /list and not /datum, is because lists are plain faster, and there are minimal data transformations - these lists are fed directly to json_encode and sent to tgchat.
Plain text messages do not need to be HTML-escaped, which makes them safer and more performant than HTML messages. Plain text messages can be made interactive (or formatted with CSS) by custom-handling them in javscript based on message type and annotations.
It would be impossible to annotate every single message in the game (at the moment of writing, there are 9447 to_chat calls in the code), but it could be done selectively, for only those messages that are hard to classify by span classes (and there are still A LOT of them).
Please annotate more messages. Thank you.
Fixes#52943Fixes#52908Fixes#52816
Changelog
cl
add: tgchat: Unread message count is now smarter and won't increase on other tabs if you have already read the same message in the active tab.
add: tgchat: Admin PMs are now properly annotated and can be filtered into separate tabs.
fix: tgchat: Fix: Highlighted message overlay no longer blocks clicks. Clicking a highlighted (F) link should work as it should.
fix: tgui: Fixed NTOS bluescreen due to calling .includes() on a stylesheet href which could be null on certain browsers.
code: tgchat: Chat schema bumped to version 5. All chat-related settings were reset to avoid breakage.
/cl
* removes duplicated tgui asset definition.
* Puts fa in separate asset
* Makes it work.
* Not needed anymore
* Removes brands css and font
* we're not using logos anywhere right
* duh
* Fixes the chat settings width while i'm at it.
* TGUI build
* Update AI Airlock UI
* Update to use TGUI for AI airlock interface
Update the TGUI package to allow you to natively run the gulp binaries, which makes it easier to work cross platform
`npm run build` and `npm run watch` are both supported.
Also fixed a few minor style changes in the files as i went through.
* Moves a base uid from machienry to a bunch of children as it was literally setting a var that most machines never used. This is probably a good candidate for a component replacement.
* Just checking something
* Does this fix the compiling not working properly?
* And this?
* What is going wrong ugh!
* params["target"] instead of params["set"] bug was there before I even touched it but my compiling of TGUI caused it or something?
* Slight tidying up for what Cyberboss and Antur likes.
* Fixes the things that I was asked to fix