question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Roadmap: chess.js 1.0.0

See original GitHub issue

After 13 years of pre-1.0.0 development … it’s time.

This is a working document to track planned features/changes and their statuses for version 1.0.0. Please comment if there’s something you’d like to see included or changed. I appreciate and value your feedback. Check back frequently for updates.

I’ll push a basic typescript implementation to dev branch to use as starting point.

Please wait for the dev branch before submitting PR’s.

dev branch is now active

Proposed 1.0.0 Changes

  • Code

    • Rewrite library in typescript
    • Use camelcase for API and everything else
      • enforce with eslint rule
    • Use exceptions in error states instead of returning null. This will allow the library to provide more detailed error messages for common issues (e.g. bad moves, bad FEN, bad PGN). The functions that throw exceptions are listed in the API Changes section.
    • Switch to using the sloppy FEN/PGN parser by default. The phrase sloppy is kind of passive aggressive, so maybe use the terms permissive and strict.
      • load in permissive mode (the default mode) should let the user load FEN without supplying castling rights, ep square, and move numbers (e.g. chess.load(rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w))
      • load and loadPgn should allow an option to use the strict parser (is this even needed)???
    • moves() should work even if there are no kings on the board.
    • Only set the en passant square when the opponent can legally make an en passant move. (see #294)
    • Add a ‘lan’ (better name or is this ok??) property for long algebraic notation (see #259)
    • Improve FEN validation. It should detect common hand-entered such as missing kings and incorrect castling rights.
    • Use fast-check for property-based testing
  • Docs

    • create a chess.js logo (maybe this is something the community can vote on??)
    • Move documentation to chessjs.org
    • Add an FAQ section to answer common questions
  • Other

    • Github issue template ensuring the reporter know the rules of chess before filing a bug (en passant gets flagged as a bug a few times a year)
    • Prefer stackoverflow for chess.js usage questions, github issues for bugs

API Changes

  • game_over -> isGameOver
  • in_check -> isCheck
  • in_checkmate -> isCheckmate
  • in_draw -> isDraw
  • is_stalemate -> isStalemate
  • in_threefold_repetition -> isThreefoldRepetition
  • insufficient_material -> isInsufficientMaterial
  • load_pgn -> loadPgn
  • set_comment -> setComment
  • get_comment -> getComment
  • get_comments -> getComments
  • delete_comment -> deleteComment
  • delete_comments -> deleteComments
  • validate_fen -> validateFen
  • The following functions should throw exceptions in the event of an error
    • Chess constructor
    • load
    • loadPgn

Questions

  • Should acronyms be capitalized in function names (e.g. loadPgn vs loadPGN)? Consider the impact this could have on the .fen() and .pgn() functions. I’m leaning towards no, but it’s up for discussion. Decided not to capitalize acronyns.
  • Should we adopt the chess.js TypeScript definitions from DefinitelyTyped as a basis for our types?

Future Changes beyond 1.0.0

  • use piece lists for increased move generation performance
  • use a parser generator to parse PGN
  • add support for RAV (recursive annotation variations)
  • add support for null moves
  • chess960 support

Issues for First Time Contributors

  • add a default separator=‘\n’ parameter to the ascii() function

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:18
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
DevAndrewGeorgecommented, May 13, 2022

Just began using this repo, but this is exciting! I’ll happily make some contributions once the FIX_ME branch is live.

1reaction
vicarycommented, Sep 23, 2022

Never use all caps for abbv. / acronyms, they tend to mess with other things.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · jhlywa/chess.js - GitHub
A Javascript chess library for chess move generation/validation, ... Roadmap: chess.js 1.0.0 ... chess.js not working in a typescript environment.
Read more >
5d-chess-js - NPM Package Overview - Socket.dev
Open source implementation of '5D Chess With Multiverse Time Travel' in the style of Chess.js library with built-in notation support.
Read more >
chess-js - npm
JavaScript chess engine for Node.js/Browser. Travis Build. Build Status. Alt text. Features. Minimax implementation with variable depth ...
Read more >
Ai chess.js on angular onDrop ugly - Stack Overflow
Seems you have just copy-pasted a Javascript file inside a component...and well...that is no going to work at all.
Read more >
Backbone.js
js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found