Skip to content

Commit

Permalink
Squash and cleanup of the following:
Browse files Browse the repository at this point in the history
- cca085e
  start of import/export

- f816da1
  start of changing stuff until I can get a bundle

- c92adde
  first bundle without errors

- e652dd2
  Bundling works with ts files

- 60fdb25
  meta info in compilation

- 8ccae78
  new build doesn't cause errors on page load as userscript

- 6fa11c4
  work in progress: load userscript in browser and fix bugs

- b15c557
  migrated yotsuba templates to plain js

  the old templates caused some variable be in a wrong scope after
decaffeinate, causing them to be unreadable from the old template

  the old templates caused some variable be in a wrong scope after
decaffeinate, causing them to be unreadable from the old template

- 9d763e8
  update readme

- 924eda8
  added more imports, and now the circular dependencies are haunting me

- ddd2d23
  jsx templates for escaped strings,
  more bug fixed from circular dependencies

- fee484d
  some fixes, clarify jsx

- e1d01d0
  Unpacked extension
  more fixes

- 97d9090
  fixed class on post that caused catalog to appear empty

- 96a2c7b
  A child class that's not supposed to run the parents constructor? That needs a workaround in es6 classes.

- fc06b4e
  changed jsx to make the tests pass

- 7b317b2
  revert archive and banners to json
  • Loading branch information
TuxedoTako committed Mar 15, 2023
1 parent 98dcd7c commit 73fdf1b
Show file tree
Hide file tree
Showing 154 changed files with 5,958 additions and 7,064 deletions.
51 changes: 49 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,52 @@
![screenshot](https://ccd0.github.io/4chan-x/img/screenshot.png)
# 4chan XT

**This repo is work in progress!** Use the build from the [repo this is forked from](https://github.com/ccd0/4chan-x) in the meantime.

The 4chan XT project is a migration of 4chan X from coffeescript to TypeScript/JavaScript. It is named XT both as a continuation of eXTended, and a T for TypeScript. The goals of this project is to first get a working bundle from js/ts files, and then gradually convert js files to ts and add types as needed.

## TODO

- find alternative for `<% if (`
- [x] made html templates jsx/txt functions
- this uses the typescript compiler to compile the jsx
- render code is in [src/globals/jsx.ts](./src/globals/jsx.ts)
- [x] binary files are included as base64 in the bundle step, they do need explicit imports
- [ ] \<% if (readJSON('/.tests_enabled')) { %\>, are these still used?
- build script
- [x] userscript
- [ ] .crx extension
- [x] crx directory that can be loaded as an unpacked extension is created
- [x] beta
- [x] noupdate
- [ ] run and debug
- [ ] port updates made to 4chan-X made since this was forked

## Other notes

- A lot of files have circular dependencies, but rollup can handle that
- but for some scripts that add to the same object I had to merge them, like Posting/QR and site/SW.yotsuba.js
- sometimes something might not be initialized before use, for example, `$.dict()` and `$.SECONDS`
- I moved these to a new file called helpers.ts, which shouldn't have dependencies itself, so it's also available
- tsconfig.json has `"checkJs": true,`, and a lot of js files report type errors when opened because of unknown properties on objects and reassigning variables with different types. These errors don't block the bundle at this moment.
- old files in the builds directory stay as reference until the new builds are functional, new files go in the builds/test directory
- old build scripts are also kept around for reference until the new build output is fully functional
- the es 2020 target was choses for optional chaining
- @violentmonkey/types was chosen over @types/greasemonkey because @types/greasemonkey only declares the GM object, and not GM\_ functions
- I don't really understand PostClone, so that might have bugs after migration

## Recommendations

- Visual studio code
- Format on save using default formatter
- extensions
- streetsidesoftware.code-spell-checker
- EditorConfig.EditorConfig

---

Original readme:

![screenshot](./img/screenshot.png)
# 4chan X
4chan X is a script that adds various features to anonymous imageboards. It was originally developed for 4chan but has no affiliation with it.

Expand Down Expand Up @@ -90,4 +138,3 @@ If you encounter a bug, try the steps [here](https://github.com/ccd0/4chan-x/blo
- [Frequently Asked Questions](https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions)
- [Report Bugs](https://github.com/ccd0/4chan-x/issues)
- [Contributing](https://github.com/ccd0/4chan-x/blob/master/CONTRIBUTING.md)

6 changes: 0 additions & 6 deletions decaffinate.md

This file was deleted.

Loading

0 comments on commit 73fdf1b

Please sign in to comment.