Skip to content

Latest commit

 

History

History
185 lines (179 loc) · 8.3 KB

CHANGELOG.org

File metadata and controls

185 lines (179 loc) · 8.3 KB

Changelog

changelog

Upcoming

Breaking

Additions

Fixes

  1. Build process now transpiles all files. All dist files now work as Common.JS rather than a mix of Common.JS and ES6 modules.
  2. Fix build process when index.js.flow is not present on disk.

0.19.0

Breaking

Additions

Fixes

  1. We now use the prepare script to build the application. This makes maintenance life a little easier, and consumption is now easier for folks who want to iterate on a branch of flow-degen.
  2. Fix a syntax error in one of the examples (no executable change).
  3. Upgrade various build time dependencies - no runtime vulnerabilities were addressed (and none known).
  4. Add Github Actions!

0.18.0

Breaking

Additions

Fixes

  1. A bug was introduced in the recent addition of Flow utility type support. When degenEnum was used with a $PropertyType a syntax error would occurr due to unescaped quote characters. This bug is now fixed.
  2. Appease security gods by bumping dependency versions, even though there is zero security threat here.

0.17.0

Breaking

  1. degenList, degenMapping, and degenRefiner all now require MetaType information in the leading parameters. In the case of degenMapping there are two (key and value). The “Fixes” section outlines the motivations.
  2. The typeParams field in MetaType has been made optional. This could impact custom generators that use this field.

Additions

Fixes

  1. We are now explicitly using types at the call sites for degenList, degenMapping, and degenRefiner. This should reduce the level of type inferencing the generated refiners place upon Flow, and in many cases will reduce errors outright because Flow just didn’t have enough to go off of. See the “Breaking” section for details as to how this breaks the interfaces for these functions, and how you can address it.

0.16.0

Breaking

  1. degenObject now takes a list of optional fields as a new argument at the end of the argument list. The simplest thing to do is add [] as the last parameter to your calls, and you will have the same behavior as before.
  2. codeGen takes a prettify flag as the second argument. Use true for this argument to keep your original behavior.

Additions

  1. The degenObject generator now takes a list of optional fields so any field that is an optional type (not necessarily a maybe type) can also be supported by the system.
  2. Consumers of codeGen may now indicate whether or not to prettify the code when running. This can be helpful when running tests and you want the generated output to display and a syntax error causes prettier to fail. This way you can still limp by and see the generated code.
  3. typeHeader is now exported. Documentation to follow soon!
  4. degenMapping is properly exported.

Fixes

  1. Reduce the amount of type inferencing flow-degen relies upon. Consumers can easily run into a “recursion limit exceeded” issue with Flow. To work around this, some functions have been made to specifically indicate their type parameters at the call sites. This has been shown to fix the problem, but it is difficult to build tests towards.

0.15.0

Nothing here - Logan messed up the publish and hadn’t staged any changes. Derp.

Breaking

Additions

Fixes

0.14.0

Breaking

Additions

  • degenMaybe added to create refiners for maybe types (type Foo = ?string).

Fixes

0.13.0

Breaking

Additions

Fixes

  • Fix an issue where flow-degen could no longer be recognized as an imported module by Flow. This is related to recent changes to make flow-degen work when strict is enabled. It is not well understood what role strict played to cause a problem with the library, but it is suspected to be a difference in Flow versions. The old ./index.js.flow workaround has been restored, yet we still retain the original strict fix.

0.12.0

Breaking

Additions

Fixes

  • Actually expose degenRefiner for consumption.

0.11.0

Breaking

  • It’s possible your baseDir usage is now broken due to building upon flow-degen’s broken behavior regarding it.

Additions

  • degenRefiner added to link to other refiners by symbol name. This effectively turns into an import statement and a function call in the generated refiner code. The symbol name can allow for recursive calls, and will significantly reduce the size of refiners instead of inlining the entire refiner. Thanks @gyrfalcon!
  • A usage example has been added for degenList.

Fixes

  • How baseDir in the configuration is used is now fixed.
  • Consumption of flow-degen should actually work when you use strict options in your repository.

0.10.0

Breaking

  • The generators configuration key is now a new structure and will break old consumers’ configuration files. Instead of a flat input/output file mapping, each pairing is represented with a structure that indicates (still) an input and output file, but also input and output exports. Consumers will now need to identify the exports to be used (rather than assuming default) and indicate how those identifiers map to a generated version.
  • Consumers can no longer import the default of generated files. Instead consumers must indicate specific exported identifiers.
  • There is a verbiage change in the works to stop using the word “deserializer” due to its inaccuracy. Instead “refiner” is preferred. The input these generated functions take is already deserialized. “Validator” is a poor term. While flow-degen might be able to ensure the structure of data is valid, there are many ways to go about being valid such as accounting for state machine transitions or making sure a user token hasn’t expired. Perhaps one could make the generated functions do these things, this has not been the focus of this library. Ultimately flow-degen is about taking in some unknown input and emitting an expected structure or an error detailing why the input doesn’t satisfy the requirements.

Additions

  • An example of how to use degenString has been added.
  • An example of how to put together a custom generator has been added.
  • Configuration files can now indicate multiple refiners per file (both input and output). This paves the way for recursion - a feature in the near future. It also allows the refiner code to become significantly smaller when arranged for re-use.

Fixes

0.9.0

Breaking

  • The new generatedPreamble field is required and will break configurations that lack it.

Additions

  • Added generatedPreamble to the configuration, which gets added to the top of generated files.

Fixes

  • Use @flow strict for generated files. 0.8.0 did not actually accomplish this.
  • Fix some type coverage in deserializer.js which is a runtime file.

0.8.0

Breaking

Additions

Fixes

  • Use an exhaustive-union check to ensure your disjoint-union/sum types are checking for every member of the union.
  • When JSON.stringify receives a mixed it can be undefined as its output instead of string. The stringify utility has been added which will return the string =’undefined’= in the case of undefined.
  • Use =@flow strict= for generated files. Adding @flow strict did not happen in this release but instead in 0.9.0.
  • Fix a bug where the deString dependency from degenEnum wasn’t being chained out of degenSum. The test framework is still being put together so this wasn’t fully tested.

Internal

  • Add documentation for degenSentinelValue, degenSum, and degenValue.
  • Introduced a changelog.
  • Internally, there is now an automated test for generation and checking for Flow errors.
  • Internally, source files now use the @flow strict annotation.