Skip to content

v0.15.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 19 Oct 10:38
· 19 commits to main since this release
v0.15.0
e53bd48
  • 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 or location property.
    A location object contained a filename, line, col, and offset properties.

    The filename property is now contained in the AST root in the property filename.
    loc and location are replaced by offset.

    The line and column numbers must now be computed using the offset.