v0.15.0
Pre-release-
BREAKING CHANGES: require node 16.9.0 or above
-
BREAKING CHANGES: promote regular comments to doc-comments
Previously, bare-ts introduced a special syntax for doc-comments:
type Gender enum { ## Be inclusive :) FLUID MALE ## One is not born, but becomes a woman ## -- Simone de Beauvoir FEMALE } ## A Person with: ## - a name ## - a gender type Person { ## person's name name: str ## person's gender gender: optional<Gender> }
This syntax is not part of the BARE specification.
Thus, the syntax is not portable between BARE_ implementations.
To avoid this issue, bare-ts_ now uses regular comments as doc-comments.
Every comment that precedes a type definition, an enum value, or a field is a doc-comment.
The previous schema can now be written as follows:type Gender enum { # Be inclusive :) FLUID MALE # One is not born, but becomes a woman # -- Simone de Beauvoir FEMALE } # A Person with: # - a name # - a gender type Person { # person's name name: str # person's gender gender: optional<Gender> }
-
BREAKING CHANGES: remove option
--import-config
Instead of importing a custom config, you can now pass the config through any encode function.
For instance, using the example of the README:
const payload = encodeContacts(contacts, { initialBufferLength: 256 /* bytes */, maxBufferLength: 512 /* bytes */, })
A default configuration is applied if no one is passed:
const payload = encodeContacts(contacts) // use the default config
-
BREAKING CHANGES: replace locations with offsets
Previously, every node and compiler errors carried a
loc
orlocation
property.
A location object contained afilename
,line
,col
, andoffset
properties.The
filename
property is now contained in the AST root in the propertyfilename
.
loc
andlocation
are replaced byoffset
.The line and column numbers must now be computed using the offset.