Skip to content

Pretty Diff v2 #292

Description

@prettydiff

v2.0.0

Breaking changes

  • Updated mode "parse" to output an object with two keys: definition and data. The definition property stores a text description of each data type supplied in the data property. The data property stores the parsed data.
  • Added mode "analysis" to generate reports of code evaluation. The program now outputs only the desired data instead of an array of desired data plus a report.
  • Due to the other changes the Node.js only option report is removed.
  • There is no longer a global.report property to store extra information. This is replaced with global.meta which stores parse errors, execution duration, number of differences, input size, output size, and can be extended to store additional metadata into the future.
  • Pretty Diff will no longer publish to NPM. - Investigate alternatives to NPM #291

New Options

  • nodeasync. Asynchronous bulk operations like reading from a directory produces cross-talk when assigning meta data to a global object. The desired goal of version 2 is to have the prettydiff function return a single string and meta data to a global object. In this case, for reliability, the prettydiff function will return an array of [data, meta] where data is the desired string output and meta is the metadata object similar to Pretty Diff version 1.
  • nodeerror. Sometimes it is desirable and informative to log parse errors to the console. Such a feature can become excessive noise and break unit tests though.
  • parseRecord. If false the output of mode "parse" is a collection of parallel data types. If the option is true the output is a sequential array where each index is a child array of data respective to a given parsed token.
  • parseSpace. Determines whether white space content tokens should exist in the parse tree output of the parse mode.

Minor fixes:

  • Enabling accessibility analysis and reporting in the new "analysis" mode.
  • Fixed some missing semicolon insertion during JavaScript parsing.
  • Fixed a curly brace insertion bug in JavaScript do/while loops.
  • Fixes a javascript defect in generated diff report HTML files.
  • Fixes a defect in "varword: list" where comments precede the reference.
  • Option varword now accounts for var, let, and const
  • Expands JavaScript conversion of operators ++ and -- under the correct option.
  • Fixes CSS beautify transposes !important on margin #294
  • Fixes escape single quote in jsx #293
  • Modified markup </li> insertion logic
  • Updated test runner file system simulation to work correctly on Windows.

Activity

  1. added this to the V2.0.0 milestone on Mar 30, 2016
  2. prettydiff commented on Apr 9, 2016

    @prettydiff
    OwnerAuthor

    Alpha version up for review: http://prettydiff.com/ignore/testlocation/

    The Node and WSH api files will be updated later today.

  3. prettydiff commented on Apr 11, 2016

    @prettydiff
    OwnerAuthor

    New branch created v2.0.0.

    All pending items are complete and the new version is ready for publication!

    • Create a unit test for the new analysis mode for CSS and markup
    • Conduct a final and formal review of documentation
    • Create a unit test to examine population of global.meta
    • Add unit tests for option varword
    • Resolve and update unit tests and test runner to work with breaking changes
    • Create Node only option to suppress logging of parse errors (while this is generally convenient it will be necessary for the unit tests to pass)
    • Attach a Lint dependency from outside of NPM
    • The new global.meta object conflicts with batch asynchronous execution, such as running the Node utility against a directory or sub-directories. A possible resolution is to pass into prettydiff.js from node-local.js an original object on the options object that matches the scheme of global.meta.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions