Skip to content

Releases: jhlywa/chess.js

v1.0.0-beta.7

17 Dec 02:05
Compare
Choose a tag to compare
v1.0.0-beta.7 Pre-release
Pre-release

Breaking Changes

These two changes only impact users that retain PGN headers when calling .clear or .load.

  • clear(true) should now be written as clear({ preserveHeader: true })
  • load(myFen, true) should now be written as load(myFen, { preserveHeader: true })

Enhancements

Bug Fixes

  • Fix README shield links (@JamJomJim - #416)
  • Fix three-fold repetition to only return true if the immediate position has been repeated 3 times (@gavin-lb - #144)
  • Update internal king cache when overwriting the king via put() (@Manukyanq #426)
  • Always clear Setup and FEN when calling .clear() (@jhlywa - be03fe0)

v1.0.0-beta.6

17 May 01:49
Compare
Choose a tag to compare
v1.0.0-beta.6 Pre-release
Pre-release

Enhancements

v1.0.0-beta.5

21 Apr 00:12
Compare
Choose a tag to compare
v1.0.0-beta.5 Pre-release
Pre-release

Enhancements

Bug Fixes

  • Revert module type to CommonJS (@jhlywa)

v1.0.0-beta.4

20 Mar 01:10
Compare
Choose a tag to compare
v1.0.0-beta.4 Pre-release
Pre-release

Enhancements

  • Add before and after FEN to Move object (@jhlywa)

Bug Fixes

v1.0.0-beta.3

03 Feb 11:36
Compare
Choose a tag to compare
v1.0.0-beta.3 Pre-release
Pre-release

Bug Fixes

v1.0.0-beta.2

19 Jan 13:12
Compare
Choose a tag to compare
v1.0.0-beta.2 Pre-release
Pre-release

Bug Fixes

v1.0.0-beta.1

15 Jan 02:57
Compare
Choose a tag to compare
v1.0.0-beta.1 Pre-release
Pre-release

Bug Fixes

  • Remove postinstall script
  • Add "types": "dist/chess.d.ts" entry to package.json

v1.0.0-beta.0

14 Jan 19:53
Compare
Choose a tag to compare
v1.0.0-beta.0 Pre-release
Pre-release

Changes

This is a major version update and there are many breaking changes. Please ead below for more info.

Typescript

chess.js has been rewritten in TypeScript. Exported types are as follows:

  • Chess object
  • Piece
  • Color
  • Square
  • PieceSymbol
  • Move

Exceptions

The following functions no longer return null in the event of an error. They now throw exceptions. This change was made to provide the user with more informative error messages.

  • .load()
  • .loadPgn()
  • .move()
  • Chess() constructor

Function Names

The functions below have been renamed and are now camel-cased:

  • 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

Improvements

  • Change .load to throw an exception when loading invalid FEN (#ac977ed)
  • Change .move to throw an exception on illegal move (#8523db8)
  • Change .loadPgn to throw an exception when encountered error (#TODO)
  • Allow the user to omit castling rights, en passant square, and move numbers when calling .load (#8523db8)
  • Add isAttacked to determine attackers of a specific square (#9b49454)
  • Validate king presence in validateFen (#a137478)
  • Allow spaces between the bracket and tag in PGN header (#5f48a68)
  • Allow user to specify a promotion piece (when supplying a verbose move) even if the move is not a promotion (#8e71084)
  • Add a fen field FEN position when calling .history

Bug Fixes

  • Fix loadPgn() to handle PGN without any moves (#d12f78f)
  • Fix pgn() export when comment precedes black to move (#4fd6069)

v1.0.0-alpha.0

14 Jan 19:52
Compare
Choose a tag to compare
v1.0.0-alpha.0 Pre-release
Pre-release
1.0.0-alpha.0

v0.13.4

26 Jul 00:48
Compare
Choose a tag to compare

Bug Fixes

  • [PGN] Fix bug that omitted comments preceding the initial move of a setup position when black is the first to move.