Releases: mscgenjs/mscgenjs-core
v4.0.5
v4.0.1
v4.0.0
v3.0.3
v3.0.2
v3.0.1
v3.0.0
What's changed & new?
- π₯ support for ES modules, so you can rollpack, webup and shake trees to your heart's content
- modernized tool chain, that's easier to get into and (far) easier to work with:
- π· straight webpack & npm scripts
- π· more stuff automated (a.o. version bumping, mirror-pushing)
- π§ the codebase is now in typescript
- π mscgenjs-core now uses jest for testing
- β¬οΈ latest versions of all dependencies & development dependencies
- π§ various refactorings that should make it easier to hack on mscgenjs-core and add some features.
If you're a user of the mscgenjs atom package, the online interpreter or the cli: you have been using version 3 of mscgenjs for some months already.
Breaking change: internal interfaces
Although the external interface (mscgenjs = require('mscgenjs')
+ accompanying method signatures) have remained the same from 2.0.0 -> 3.0.0, some of the internal interfaces have moved to a new spot:
Impact
- None for typical use.
- Low if you were using modules directly from the distribution instead of the root module.
Migrating
- If you're using modules directly from the distribution instead of the root module:
- try to use the root module instead and/ or ...
- if that fails: the individual modules have just moved from
src/yadda
todist/cjs/yadda
, so just updating that should get you sorted:
before:
var xuParser = require('mscgenjs/src/parse/xuparser');
var lAST = xuParser.parse('msc { a;b; a=> b [label="hello"];}');
// do nice things with the AST
after
var xuParser = require('mscgenjs/dist/cjs/parse/xuparser');
var lAST = xuParser.parse('msc { a;b; a=> b [label="hello"];}');
// do nice things with the AST
- If you're using AMD/ requirejs and internal modules
- try to use the root module instead and/ or ...
- migrate to something that can handle either commonjs or ES modules and then use the strategy mentioned above.
v2.0.0
A major release for the first time in 2.5 years. The major 'breaking change' for this release is that mscgenjs doesn't support running or building on node 4 anymore. This version also gets rid of some deprecated interfaces and simplifies one function in the external interface. More information below.
- π§ External API change:
translateMsc
doesn't take a callback anymore, but is properly sync now. - π§ moves all sources under
src
and remove/ rename some deprecated internal interfaces -> if you depended on mscgenjs' internal modules (which you shouldn't) you got to migrate - see below for more information. - π₯ adds a json schema for the AST so it's easier to guarantee correctness
- π§ Various refactoring to ease readability and maintenance.
- π de-support node 4
- π mscgenjs is now using
jest
for test automation. Mocha was doing fine (and is in fact (a lot!) faster), but jest has some features that save time in other aspects: snapshot testing (which mscgenjs was using anyway, but hand rolled - eases maintenance) and automatically testing stuff that has changed (so no need to muck around withdescribe.only
andit.only
's anymore ...).
Breaking changes
translateMsc
signature from async(y) to sync
Impact: none to medium
Only applicable if you were using the translateMsc
function in the first place.
Migration is straightforward (see below) but has to be done if you were using it.
Rationale
The translateMsc
was never asynchronous in nature in the first place, so the
signature with the callback just added unnecessary hassle, while offering no
benefits - so it got killed.
Migration path:
where you did that thing with a callback before ...
const mscgenjs = require("mscgenjs");
let lResult = mscgenjs.translateMsc(
"Mac=>Beth: shall I compare thee to a Summer's day?;",
{ inputType: "msgenny", outputType: "mscgen" },
function(pError, pResult) {
if (pError) {
console.error(pError);
}
console.log(pResult);
}
);
You can now simply use a try/ catch:
const mscgenjs = require("mscgenjs");
try {
let lResult = mscgenjs.translateMsc(
"Mac=>Beth: shall I compare thee to a Summer's day?;",
{ inputType: "msgenny", outputType: "mscgen" }
);
console.log(lResult);
} catch (pError) {
console.error(pError);
}
node 4 de-support
Impact: low
Migration to a higher version is usually a doddle. The number of people still on node 4 should be super low.
Rationale
Node 4 is not supported anymore by the Node.js foundation
Migration path
Upgrade to a more recent version of node. If you (really) can't there's still version 1 of mscgenjs. Note that mscgenjs might still run & build on node 4 - I just don't support it anymore
source re-organization
Impact: very low
... Unless you were using internal mscgenjs modules to get things done, in which case you had to
Rationale
It makes maintaining mscgenjs-core more straightforward.
Migration path
- use the external, documented API (see the readme for a howto) or
- If you can't (yet): sources got moved into
src
, so where you used something likemscgenjs/render/graphics/renderast
before, you would now usemscgenjs/src/render/graphics/renderast
remove the deprecated indexAMD
Impact: very low
Rationale
It was already deprecated
Migration path
Instead use the regular index
- it has the same functions & function signatures.
internal API: removed renderAST
from the graphics renderer
Impact: non-existent to very low
Only some impact if you were using internal mscgenjs modules directly.
Rationale
Simplify the internal interfaces for easier maintenance.
Migration paths:
- use the external, documented API (see the readme for a howto) or
- use the new
render
function which has the same functionality
internal API: renamed renderASTNew
to render
Impact: non-existent to very low
Only some impact if you were using internal mscgenjs modules directly.
Rationale
Simplify the internal interfaces for easier maintenance.
Migration paths:
- use the external, documented API (see the readme for a howto) or
- replace
renderASTNew
withrender
- which is a function with the same signature and internal working.
v1.13.0-beta-1
- π£ add typescript type definitions