Skip to content

Bebop v2.7.0

Compare
Choose a tag to compare
@github-actions github-actions released this 24 May 11:55

REPL

The REPL has gotten some much needed love. Gone are the <textarea> and Prism highlighting and in their place a REPL that utilizes Monaco Editor.

repl

Diagnostics will be reported as you write schemas in the REPL now and there is basic highlighting.

Services

It is now possible to define a service method which can accept a stream of records or return a stream of records. Just use the new stream keyword before writing the type identifier.

service Music {
    getSongsByMusician(Musician): stream Song;
}

To utilize streams, update to the latest version of Tempo.

Documentation will now also generate alongside service code
A screenshot showing that documentation is generated along with service now

You can now also apply the deprecated attribute to service definitions and their methods

/** A service for getting songs */
service Music {
    /** Gets a stream of songs by the specified musician */
    [deprecated("Use of getSongsByMusician is not recommended")]
    getSongsByMusician(Musician): stream Song;
}

bebopc fixes

Block Comment Crash

In previous versions of bebopc not completing a block comment could in some cases cause the compiler to crash rather than provide diagnostics. This has now been fixed.

A screenshot showing the improved diagnostics for improper block comments

Block comments @ EOF

In previous versions of bebopc a block comment left at the end of a schema would produce a diagnostic error; the compiler has been updated to allow this behavior.
A screenshot showing that a block comment can now be used at the end of a schema

--watch crash

In previous versions of bebopc while quickly editing and committing changes to a schema, watch mode could hard crash. A fix has been put in place to mitigate this.
watch-fix

Improved service diagnostics

When attempting to use an undefined type in a service method, it now reports the correct parent in the diagnostic
A screenshot showing the improved diagnostic for undefined types in a service method
Attempting to use a scalar or enum type in a service method produces a more understandable error
A screenshot showing the improved language of the diagnostic error unsupported types in service methods

Notices

bebopc 3.0.0 is on the horizon and some major changes are on the way

  • We plan to introduce compiler plugins. Give us your feedback here
  • the readonly modifier is deprecated and a struct will soon be immutable by default. Give us your feedback here.
  • The Dart generator will be removed from the compiler. Give us your feedback here

Misc

  • In #253 we removed the NodeJS Polyfill present in the Typescript runtime. If you encounter a BebopRuntimeError while using the runtime under node, you'll need to polyfill TextDecoder so it is on the global scope (just as we were doing for you.) This was removed because it would make non-node projects be detected as such.
  • Also in #253 we removed an erroneous dependency on @types/node which would cause bundlers to bundle them.
  • #244 fixed an issue on some linux distributions where the compiler would crash because it couldn't find a file dotnet was looking for.