Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.69 KB

File metadata and controls

31 lines (24 loc) · 1.69 KB

Build Gitpod Ready-to-Code


This example project demonstrates the usage of Langium in the browser without any backend. The language server is run in a web worker. It parses and validates the input text on change and — in this special case — sends a serialized snapshot of the abstract syntax tree (AST) to the browser's main thread, provided the text is free of errors. The code generation is than executed in the browser's main thread, and the obtained code is executed subsequently.
Remark: This setup well-suited for the sake of this demostration, but it is not common in production (yet 😁).

Get started

Run

npm i
npm run serve

and open http://localhost:3000 in your browser. Open the browser's developer tools, and put a break point at https://github.com/langium/langium-in-browser-codegen-example/blob/a2e590d9aeccf94178ebed83ab64ad40ebe1c635/src/arithmeticsEditor/index.ts#L44