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

WIP: Use vite instead of webpack #214

Closed
wants to merge 83 commits into from
Closed

WIP: Use vite instead of webpack #214

wants to merge 83 commits into from

Conversation

OmniTroid
Copy link
Contributor

@OmniTroid OmniTroid commented Jan 28, 2024

Using webpack's dev server exhibits some strange and inconsistent behavior, such as failing to display the dev URL, the build process hanging (shows as disconnected from process in VSC). This behavior seems to appear on both VSC and WebStorm. Vite also has faster rebuild times and should all in all provide a better development environment. This PR is an experiment in replacing webpack with vite and should not be merged before it is confirmed that all use cases work correctly. That is:

  • Initializing development environment works correctly (npm install works out of the box)
  • The dev environment itself works correctly (npm run dev starts a development webserver which can be accessed at localhost AND debugger+breakpoints work correctly)
  • Tests run correctly (They are detected and pass)
  • Deployment works correctly (npm run build produces a dist folder with correct behavior that can be served with a standard webserver)

This PR makes the following changes:

  • Edit package.json to use vite, and make corresponding changes to required packages
  • Move index.html from public to project root (vite strongly prefers index.html to be here) and remove webpack-templating (one line)
  • Makes the project use vite instead of webpack for dev
  • Add .ts files to linting as well and fix lint issues
  • Replace CJS module loading with ESModule (CJS support in vite is deprecated), which necessitates some changes to import as it's a bit different than CJS

Work in progress, do not merge

Remove onerror tags where they are obsolete. imgError also
fails to load in production, so it looks like dead code.
Remove imgError.ts as well.
It appears that if 2factor is started, the client sends the HI
with the current fingerprint (as hdid), but in the 2fa block
it also sends the cookie hdid with no header. It seems unlikely
that the server can parse this packet correctly, so this looks
like a mistake. Remove this sendServer line and only do the
2factor flow when it's enabled, do not send handshake to the
server otherwise.
This is broken in production and hence is not used
@OmniTroid OmniTroid closed this Mar 9, 2024
<meta http-equiv="X-WebKit-CSP"
content="default-src 'self' 'unsafe-inline' 'unsafe-eval' *.aceattorneyonline.com data:; frame-src http://servers.aceattorneyonline.com https://servers.aceattorneyonline.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; connect-src 'self' http://servers.aceattorneyonline.com https://servers.aceattorneyonline.com ws:;">
content="default-src 'self' 'unsafe-inline' 'unsafe-eval' *.aceattorneyonline.com data:;
script-src 'self' 'unsafe-inline' https://static.cloudflareinsights.com;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this breaks loading the serverlist and also i don't want the analytics to track all users

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't have shit in detroit

loadResources: () => void
isLowMemory: () => void
// loadResources: () => void
// isLowMemory: () => void
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has been done for a reason, it actually helps

*/
export function imgError(image: HTMLImageElement) {
image.onerror = null;
image.src = ""; // unload so the old sprite doesn't persist
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will cause little error images to be all over the viewport

@@ -10,7 +10,7 @@ import { appendICLog } from '../../client/appendICLog'
export const handleMC = (args: string[]) => {
const track = prepChat(args[1]);
let charID = Number(args[2]);
const showname = args[3] || "";
// const showname = args[3] || "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?????????
why ignore shownames??

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.

2 participants