Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preact rewrite #1229

Merged
merged 24 commits into from
Mar 17, 2019
Merged

Preact rewrite #1229

merged 24 commits into from
Mar 17, 2019

Conversation

Zarel
Copy link
Member

@Zarel Zarel commented Feb 19, 2019

Apparently I can't convert a pull request into a draft pull request, but I can re-create the pull request. Since the Preact rewrite is probably our longest-term project, this is probably the correct thing to do here.

@Zarel Zarel mentioned this pull request Feb 19, 2019
@Zarel

This comment has been minimized.

@Zarel

This comment has been minimized.

@Zarel

This comment has been minimized.

@Zarel

This comment has been minimized.

@Zarel
Copy link
Member Author

Zarel commented Feb 26, 2019

If YOU TOO want to send messages to rooms, all you need is to add a config/testclient-key.js file, with the contents:

const POKEMON_SHOWDOWN_TESTCLIENT_KEY = 'sid';

Replace sid with the contents of your actual PS sid cookie. Anyone who can't figure out how to get cookie data probably shouldn't be screwing around with extremely alpha software in the first place, but if you want a fast way to get at your cookies:

image

image

@Zarel

This comment has been minimized.

@Zarel

This comment has been minimized.

@Zarel Zarel force-pushed the preact-rewrite branch 3 times, most recently from d45761c to afd367d Compare March 10, 2019 22:23
@Zarel

This comment has been minimized.

Zarel added 13 commits March 17, 2019 10:21
HIGHLY UNFINISHED CODE
This is kind of a break of purity, because it reads
`window.offsetWidth`, but this is the lowest-overhead way to
automatically recalculate the leftRoom width whenever PS updates
(i.e. whenever leftRoom or rightRoom change).
Considering all the individual panels start with `panel-`, this should
make it easier to find and in general be a more intuitive name.

All other tsx files will start with `panel-`, putting them together in
one place when sorting alphabetically.
Room layout code is now better commented and more readable.
There's still a lot more to do, but this is a start
Unlike the old router, this one has no dependencies, and also tracks
left/right panel state, for more accurate back/forward button support.

It also sets the URL to the last selected panel, instead of always
using the left panel.
The actual connect function is commented out, because there's no reason
for it to do anything. But it can actually connect to a server now.
Zarel added 8 commits March 17, 2019 10:21
This at least lets me test some router features without pushing it to
the live server.
You can't actually log in through the Preact client anyway, but now
if you set the right config file, you can _be_ logged in.
Using arrow keys to switch rooms is now in! Unlike in the old client,
the new system supports switching to all rooms, and supports arrow keys
in all situations, rather than only being able to switch between chat
rooms, and only with textareas focused.

Also, focusing chat rooms now focuses the input box. This was
surprisingly hard to implement with React, which has an annoying
all-or-nothing approach to state it doesn't control.
Zarel added 2 commits March 17, 2019 10:26
This involves a relatively substantial refactor to how panels work, but
it should be somewhat finalized now. Popups are now fully supported.
@Zarel Zarel marked this pull request as ready for review March 17, 2019 01:26
@Zarel

This comment has been minimized.

@Zarel

This comment has been minimized.

@Zarel
Copy link
Member Author

Zarel commented Mar 17, 2019

This is getting merged into master now!

@Zarel Zarel merged commit 7479cf6 into master Mar 17, 2019
@Zarel
Copy link
Member Author

Zarel commented Mar 17, 2019

The Preact branch is nowhere near done, of course. But it's intentionally designed to be able to run parallel to the regular client, so that's what'll happen from now on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant