Commit Graph

43 Commits

Author SHA1 Message Date
Guangcong Luo
79b4d0d5e2 Preact: Support News
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
2026-03-18 07:34:08 +00:00
Guangcong Luo
ae69319e63 Preact minor updates batch 25
- Fix various reconnect bugs
- Move table styling to battle-log
- Fix highlighting bugs
- Bump cookie expiration another month

Trivial
- Fix rounding in build time
- Fix left border in vertical tabs dark mode
- Improve README wording
2025-06-02 15:20:48 +00:00
Guangcong Luo
0990e13c2d Preact minor updates batch 21
- Fix Rooms state when pressing Enter after searching
- Fix (workaround, but still) opening popups on testclient
- Fix team menu in challenge/search
- Change "Preact Alpha" to "Preact Beta"
- Support side servers

Teambuilder
- Fix Upload button and teambuilding links leaking through focus editor
- Use `inputmode="numeric"` for better number keyboard in phones
  - You can't type `+` or `-` on EVs on phones, but oh well, the Nature
    dropdown is good enough. I think it's worth it for easier EV inputs.

Trivial
- Align main menu battle search labels to the left
- Fix flicker when searching Rooms
- Hide "Open battles in right panel" option when it doesn't do anything
- Get rid of PSTeambuilder.*packTeam/export* in favor of Teams
2025-05-17 16:19:58 +00:00
Guangcong Luo
94a1876f61 Support non-full builds in testclient
Non-Preact testclients don't deal well with non-full builds anymore,
now that battledata includes data/text.js. This fixes it so that
they're usable (although no longer being able to edit battle-dex etc
without an initial full build still sucks, it's unavoidable).
2025-04-26 06:02:06 -07:00
Guangcong Luo
2ec10bc172 Preact: Improve teambuilder
- Add format chooser
- Show team name in title
- Support selecting species/item/ability/move from menu
- Clicking species/item/ability/move selects the text for easy replace
- Add Stats menu
- Add placeholder Details menu
- Add types and item icon
- "Add Pokemon" button

It's still a very long way to go, but it's starting to look properly
like the vision I have in my mind.

Minor
- Refactor
- Fix cachebuster for teambuilder CSS
- Improve teambuilder resources HTML
2025-04-25 11:38:45 +00:00
Mia
60ee938a1d Teams: Add a back button to the search/view pages
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-12 01:31:28 -05:00
Mia
8e378c6129 Add static website for viewing server-side teams 2025-04-09 19:36:58 -05:00
Guangcong Luo
399289a3f7 April Fool's 2025 updates
The main new joke is #2337, but I made a number of other tweaks.
In particular:

- Bringing back some text from AFD 2019, and adding some more
- Showing the Taunt and Chilly Reception jokes in `/afd sprites`
2025-04-02 04:36:17 +00:00
Guangcong Luo
b90195346c Hide ugly error when PHP is installed
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
2025-03-24 04:23:30 -07:00
Guangcong Luo
a10821ab8b
Update to ESLint 9 (#2326)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
This finally removes the tslint dependency and switches to eslint.

There are a lot of other changes here, too, to bring the codebase up to
server standards. TSLint never had much in the way of indentation
enforcement.

Not very happy about eslint splitting itself up over 6 dependencies,
or its documentation over three websites, nor how poorly documented the
new flat config is, but I mean, eslint's gonna eslint. Customizing
would be even harder if we tried to use Biome or something. They mostly
seem to go full Prettier.

Also here are some changes to our style rules. In particular:

- Curly brackets (for objects etc) now have spaces inside them. Sorry
  for the huge change. ESLint doesn't support our old style, and most
  projects use Prettier style, so we might as well match them in this way.
  See https://github.com/eslint-stylistic/eslint-stylistic/issues/415

- String + number concatenation is no longer allowed (except in ES3
  code). We otherwise now consistently use template strings for this.
2025-02-25 20:05:32 -08:00
Guangcong Luo
c1ced5dbe3 Update Privacy Policy for new ad company 2024-10-18 00:29:44 +00:00
Guangcong Luo
c2ec42310c Support test configs
This adds support for test configs, to make it easier to test config
changes without affecting the live service.
2024-07-20 22:33:16 +00:00
Guangcong Luo
5f614debe4 Satisfy eslint
At some point we need to update eslint but now is not that point.
2023-11-17 00:39:33 +00:00
Guangcong Luo
7732ec78f3 Refactor build tools for readability
(Also fixes the build error.)
2023-11-16 23:50:15 +00:00
Mia
4fa3ed7c33 Build-tools: Always try to update news 2023-11-16 16:51:11 -06:00
Guangcong Luo
5d41f3ec93
Reorganize directories (#2187)
Files meant to be served have been moved into
`play.pokemonshowdown.com/` and `pokemonshowdown.com/`.

We now have three directories for the three subdomains handled by this
repo:

- `pokemonshowdown.com/`
- `play.pokemonshowdown.com/`
- `replay.pokemonshowdown.com/`

Naming them after the subdomains will make it much easier to tell where
the files for each go.

The diff is probably useless; it'll be easier if you just look at the
new tree:
https://github.com/smogon/pokemon-showdown-client/tree/reorganize
2023-11-16 03:39:29 -08:00
Guangcong Luo
dc8e6cf254 Replays: Correct link previews
This should make Google search results and Discord link previews
for replays work correctly.

This actually involved a ton of work, but at least this work also
makes replays load faster.
2023-11-10 00:59:11 +00:00
Guangcong Luo
7a2b323eaf Deploy New Replays
The idea is to eventually move all client parts to their domain name
subdirectory, for clarity and better organization. New Replays is
just first.

Anyway, yeah, minor updates to New Replays, but otherwise it's just
getting deployed as-is, straight to

https://replay.pokemonshowdown.com/

The old URLs are getting taken down; they were only used for
development anyway.
2023-11-05 23:37:14 +00:00
Guangcong Luo
235056ba75 Update New Replays
The main difference is that the main search screen should look
much nicer now.

https://pokemonshowdown.com/replays/

Putting search/featured/recent in separate sections makes the new
design look much nicer. And dark mode is now fully supported.
2023-10-26 21:38:59 +00:00
Guangcong Luo
fd28aca33f WIP New Replays
New Replays isn't done yet but I've done a lot of work on it and
probably it deserves a commit.

Why rewrite Replays:

- I redesigned pokemonshowdown.com to look more modern and support
  dark mode, and rejiggering Old Replays would be a lot of work
  anyway.

- It'd be nice to actually deploy some of PS's whole Preact
  infrastructure somewhere, instead of it just being in development
  hell.

- Nice to get a second look at the relevant code, leading to fixes
  like fc00e68231 and f28b1e9bf3.

- Replays is due for a migration from JS/PHP to TS anyway.

Anyway, feel free to try out New Replays, it's live in:

https://pokemonshowdown.com/replays/

Old Replays will stick around until we hit feature parity, but
that shouldn't be too long (I know, famous last words).
2023-10-26 14:56:05 +00:00
Guangcong Luo
efa553d96b Build: Move ads/analytics into config
This keeps ads/analytics out of the repository, since they
shouldn't be used in forks and dev machines anyway.

Hiding ads in `website/news/include.php` was a thing I did in
the early days because one of the devs was ashamed of ads, and
`website/` wasn't in a public repository at the time. At this
point, though, I'm done being ashamed of it. You can obviously
see ads on the website and everyone knows they fund the server.
2021-11-25 20:52:51 -05:00
Guangcong Luo
c24cbd6891 Compile chat-formatter from server
This is the point at which all these refactors to the build system pay
off: we can now directly share code from server. First off:
chat-formatter is now built directly from the server!
2021-04-13 14:06:25 -07:00
Guangcong Luo
2cd13d9de2 Remove babel-cli dependency
At this point, we might as well use babel-core directly.

New system supports source maps for `battledata` and `graphics`! Woo!

It also logs the compile step.
2021-04-13 14:06:25 -07:00
Adam Tran
1f3c8cf450
Add sourceMaps and vscode debug configurations (#1707)
* launch json

* vscode updates

* clientUrl rename
2021-01-10 16:58:28 -08:00
Guangcong Luo
7fc87cad1c Build data/text.js from server
text.js is no longer maintained in the client repo; it's now built
directly from the server's data/text/ directory.
2020-10-27 17:09:49 +00:00
Annika
367ed82e56
Support configurable URLs (#1543) 2020-07-21 15:27:21 -07:00
Kirk Scheibelhut
a9bf84ba2a Fix HEAD vs. origin dupe check
git rev-parse --short sometimes returns less than 8 characters,
meaning the dedup logic is off. One alternative is just to check
origin.startsWith instead, but making them both a uniform 8 works as
well.
2019-06-16 14:10:49 -07:00
Kirk Scheibelhut
a2bbae3b35 Include origin hash in Config.version if different 2019-06-15 21:51:00 -07:00
Kirk Scheibelhut
bbad2828b0 Include commit hash in client config version (#1303) 2019-06-16 13:02:38 +09:00
Guangcong Luo
e6e65dde4f Update AFD 2019 implementation
AFD messages are now disabled by `/afd off`
2019-04-01 19:18:28 +08:00
Guangcong Luo
eb38544200 Support serving the Preact client
If you want to access it, I'm sure you can figure out how from this
code. ;)
2019-03-17 06:21:49 -04:00
Guangcong Luo
096f037a07 Put battle text in battledata.js
This makes it so a regular build will rebuild battle text, instead of
requiring a full build.

battle text is under active development, so this is pretty useful,
even if conceptually, text is purely a graphical thing and not actually
needed by headless battles.
2018-11-24 01:14:28 -06:00
Guangcong Luo
f6c03e0370 Implement new battle-text-parser
All battle text messages have been moved out of `src/battle.ts` and
into its own file `data/text.js`.

Code for handling this is in the new files `src/battle-log.ts` and
`src/battle-text-parser.ts`.

`data/text.js` is now extremely self-contained, and nearly ready for
translation support!

This is a significant modernization of battle.ts. In addition to moving
messages out:

Functions for getting names (`pokemon.getLowerName()` etc) have been
removed.

`battle.minorQueue` has been removed. Minor lines are now processed
directly on the main queue, with a new `battle.waitForAnimations`
flag to decide whether or not the main queue should wait for animations
to finish before moving on to the next line.

`battle.waitForResult()` and `battle.endPrevAction()` have been
removed. These confusingly-named functions closed the messagebar (and
flush the minor queue). They've been replaced with
`scene.maybeCloseMessagebar()`.

`pokemon.markMove()` and `pokemon.markAbility()` have been renamed
`pokemon.rememberMove()` and `pokemon.rememberAbility()`.
2018-11-15 18:52:53 -06:00
Guangcong Luo
5f05adc856 Split battle-log.ts off from battle-dex.ts
This splits battle-dex.ts up into:

- `battle-dex.ts`
  - dex data access, misc tools
- `battle-log.ts`
  - manipulating HTML, especially in battle logs

This turned out to be a pretty significant portion of what was
previously battle-dex.
2018-11-15 18:52:53 -06:00
Guangcong Luo
f86245febb Add mocha tests to npm test 2018-10-16 03:31:27 -05:00
Guangcong Luo
9019543dc1 Don't build graphics.js by default
graphics.js will still be built by `./build full`, and once it already
exists, `./build` will rebuild it when it's modified.

Fixes #1150
2018-10-16 03:26:51 -05:00
Guangcong Luo
f09d917110 Support incremental builds
`./build` should run a lot faster now.
2018-10-16 00:31:07 -05:00
Guangcong Luo
4e7f998afa TypeScript data/graphics.js 2018-05-18 17:10:58 -05:00
Guangcong Luo
399f1735b6 Fix build tools
It should now be possible to build from a fresh checkout with
`node build`.
2018-05-17 11:52:32 -05:00
asgdf
6933d5a6e6 Fix build script on Windows (#1118) 2018-05-14 17:50:24 -05:00
Guangcong Luo
b3c6c2a308 Make eslint ignore compiled files 2018-05-14 12:53:34 -05:00
Guangcong Luo
a15ec64d1d Move battledata.js to TypeScript
This is the first step of moving the entire client over to
TypeScript + Preact!!!!

The main change here is that battledata.js has been split into three
files:
- `src/battle-dex.ts`
- `src/battle-dex-data.ts`
- `src/battle-dex-misc.js`

These are concatenated back into `battledata.js` in the client, so
third parties (and specifically, old replay files) should be
unaffected. Also, this makes sure that we don't have more than two
dependencies right now.

The compilation is done with Babel 7 beta, because no stable version
of Babel supports TypeScript. We're not using `tsc` because it can't
compile to ES3 and it doesn't support preserving line numbers.

`toRoomid` has been moved from client.js to battle-dex.ts.
2018-05-14 12:53:34 -05:00
Guangcong Luo
15c73c922f Refactor build system
We no longer have the relevant Githook for automatic building, so
putting it in `githooks/` no longer makes much sense. It's now manually
called with a build script `./build`, like other PS websites (most
notably PSDex and the damagecalc).
2017-12-04 17:37:01 -05:00