webx-net / webx

A DSL and framework for hypermedia driven web backends, and REST APIs
https://webx.sh
6 stars 1 forks source link

Add import statements #3

Open WilliamRagstad opened 8 months ago

WilliamRagstad commented 8 months ago

Add a new compile-time statement to import models and handlers from other module files. This feature requires new syntax and semantics to be implemented in the parser and WXModule file logic. A new analysis pass should also be added to detect circular dependencies.

Below is a suggestion for import syntax:

import { Todo, renderTodo } from "./todos"
include "../common.webx"

It would be nice if module file paths could be located automatically based on the standardized file extensions .webx and .wx. Also the ./ could be omitted.