Total rewrite in TypeScript - #204
Merged
Merged
Conversation
|
I would rather have ES6 with |
|
This is great. @jakesgordon would you be willing to add new community members as maintainers for this library to keep it updated? |
|
how can i install 4.0.0-beta use yarn. |
|
It's cool for the async support. May I ask is there any install guide for this branch? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a total rewrite of the whole library in TypeScript, and the changes are almost completely compatible with the original version.
rollupinstead ofwebpackwith three formats:umd,cjsandes.class.bin/example.jsand the example state machines in theexamplesfolder) was modified accordingly and all work.testfolder usingjestinstead ofava, due toavarequiring changes that conflicts withrollup(look at this ava issue) in order to support TypeScript.test-jsfolder with minimal changes which will be covered later. All test cases passed except one.const machine = StateMachine()anymore without thenewkeyword. One of the test cases was covering this, which is the case that didn't pass.factorymethod to create the machine and you have an base class constructor, you don't need to explicitly runthis._fsm()in it anymore.applymethod to extend your object to a state machine, you will get a new object instead of mutating the original object, that is runningStateMachine.apply(obj)and useobjas it is, you have to doconst newObj = StateMachine.apply(obj)and usenewObjinstead.All in all, changes are mostly compatible with a few enhancements, and with type support .