Skip to content

Refactor: remove apps/templates, add examples/, restructure extension… - #3

Merged
LayerDynamics merged 5 commits into
mainfrom
feature/refactor-templates-to-examples
Dec 14, 2025
Merged

LayerDynamics merged 5 commits into
mainfrom
feature/refactor-templates-to-examples

Conversation

@LayerDynamics

@LayerDynamics LayerDynamics commented Dec 14, 2025 •

Copy link
Copy Markdown
Owner

Changes

  • Remove apps/ directory (moved to examples/)
  • Remove templates/ directory
  • Add examples/ with example-deno-app, react-app, svelte-app, nextjs-app, system-monitor, text-editor, todo-app, wasm-forge-example, weather-app
  • Refactor extension crates: move js/init.ts to ts/init.ts
  • Add forge-weld and forge-weld-macro crates
  • Replace resolver.js with resolver.ts
  • Remove sdk/preload.js
  • Add new documentation for host-ipc, host-window, and crate docs
  • Update build.rs files across extension crates
  • Update site docs and configuration

Code Review Fixes

  • Add forge-weld dependency to forge-weld-macro Cargo.toml
  • Fix weld_op macro to use ParamAttr::default() and Op2Attrs::default()
  • Implement rust_type_to_weld_type() for proper Rust → TypeScript type mappings
  • Add comprehensive type inference for primitives, generics (Option, Vec, Result, HashMap, etc.), and collections
  • Fix GTK window type mismatch using upcast_ref() for context menus on Linux
  • Add preload.ts transpilation to JavaScript in forge-host build.rs
  • Write comprehensive README documentation for forge-weld with architecture diagram and type mapping table
  • Fix flaky transpile tests to handle deno_ast output variations (quote styles, whitespace)

Compiler Warning Fixes

  • Fix unused window variable on Linux: implement native handle retrieval using GDK window pointer
  • Fix _app_menu unused assignment warning: properly reference variable in log message
  • Fix let _ = unit value binding: remove unnecessary binding from show_context_menu_for_gtk_window()

Build Fixes

  • Fix Linux build: use GDK window pointer as handle instead of unavailable gdk::ffi::gdk_x11_window_get_xid function

Summary by Sourcery

Refactor the Forge framework to use a new forge-weld-based extension build system, replace CLI templates with example apps, and expand documentation and APIs around window management and IPC.

New Features:

  • Introduce forge-weld and forge-weld-macro crates to generate TypeScript bindings, init modules, and extension wiring for host:* modules.
  • Add host:window and host:ipc API documentation pages and new crate-level docs for core and extension crates.
  • Provide new React, Svelte, and Next.js-style example apps under examples/ with updated manifests and front-end code.

Enhancements:

  • Simplify extension build scripts across ext_fs, ext_net, ext_sys, ext_process, ext_wasm, ext_ipc, and ext_window to use ExtensionBuilder and generated extension macros.
  • Refine host:ui and getting-started documentation to distinguish basic window operations from advanced host:window features and clarify IPC patterns.
  • Update architecture docs to describe the new crate structure, forge-weld build pipeline, and host:* module layout.
  • Adjust forge-host to load preload TypeScript and require explicit app-dir arguments, improving clarity and configurability.
  • Update documentation site navigation to include API, crates, and guides sections, and point links to the new examples/ location.

Build:

  • Remove CLI template embedding from the forge crate and its build script, eliminating templates/ in favor of file-based examples.
  • Update workspace, CI workflows, and helper scripts to use examples/example-deno-app instead of apps/example-deno-app and to package bundles from the new examples/ paths.
  • Add forge-weld as a build dependency to extension crates and wire it into their build.rs scripts for automated code generation.

CI:

  • Update GitHub Actions workflows to build and bundle the example app from examples/example-deno-app and adjust artifact collection paths accordingly.

Documentation:

  • Revise README, getting-started, and site docs to promote copying from examples/ instead of using forge init, and to highlight new example applications.
  • Document crate-level details for forge, forge-host, forge-weld, forge-weld-macro, and each ext_* crate under the new Crates section.
  • Expand host:ui documentation with clearer basic window, dialog, menu, and tray examples and add dedicated host:window and host:ipc API pages.

Chores:

  • Remove unused CLI init command, template assets, and legacy sdk/preload.js, cleaning up obsolete scaffolding and loader code.

… crates

- Remove apps/ directory (moved to examples/)
- Remove templates/ directory
- Add examples/ with example-deno-app, react-app, svelte-app, nextjs-app, system-monitor, text-editor, todo-app, wasm-forge-example, weather-app
- Refactor extension crates: move js/init.ts to ts/init.ts
- Add forge-weld and forge-weld-macro crates
- Replace resolver.js with resolver.ts
- Remove sdk/preload.js
- Add new documentation for host-ipc, host-window, and crate docs
- Update build.rs files across extension crates
- Update site docs and configuration
@sourcery-ai

sourcery-ai Bot commented Dec 14, 2025 •

Copy link
Copy Markdown

Reviewer's Guide

Refactors Forge’s extension build and docs around a new forge-weld codegen pipeline, replaces the old CLI templating/init flow with example-based onboarding, introduces new host:window and host:ipc documentation and crate docs, and updates paths and CI to use an examples/ directory instead of apps/ while modernizing extension build.rs and resolver/preload handling.

Sequence diagram for renderer–Deno IPC via host:ipc

sequenceDiagram
  actor Renderer
  participant WebView
  participant ForgeHost
  participant ext_ipc
  participant DenoApp

  Renderer->>WebView: window.host.send("button-click", payload)
  WebView->>ForgeHost: IPC message
  ForgeHost->>ext_ipc: op_ipc_recv (enqueue IpcEvent)
  ext_ipc->>DenoApp: windowEvents()/onChannel yields event
  DenoApp->>DenoApp: Handle "button-click" event
  DenoApp->>ext_ipc: sendToWindow(windowId, "button-response", payload)
  ext_ipc->>ForgeHost: op_ipc_send
  ForgeHost->>WebView: dispatch to window.__host_dispatch
  WebView->>Renderer: window.host.on("button-response", callback)
Loading

Class diagram for forge-weld IR and ExtensionBuilder

classDiagram
  class WeldPrimitive {
    <<enum>>
    +U8
    +U16
    +U32
    +U64
    +Usize
    +I8
    +I16
    +I32
    +I64
    +Isize
    +F32
    +F64
    +Bool
    +String
    +Str
    +Char
    +Unit
    +to_typescript() str
  }

  class WeldType {
    <<enum_like>>
    +Primitive(WeldPrimitive)
    +Option(WeldType)
    +Vec(WeldType)
    +Bytes
    +Result(ok:WeldType, err:WeldType)
    +HashMap(key:WeldType, value:WeldType)
    +BTreeMap(key:WeldType, value:WeldType)
    +HashSet(WeldType)
    +BTreeSet(WeldType)
    +Tuple(elements:WeldType[])
    +Array(element:WeldType, size:int)
    +Generic(base:str, params:WeldType[])
    +Struct(name:str)
    +Enum(name:str)
    +JsonValue
    +OpState
    +Box(WeldType)
    +Arc(WeldType)
    +Rc(WeldType)
    +RefCell(WeldType)
    +Mutex(WeldType)
    +RwLock(WeldType)
    +Reference(inner:WeldType, mutable:bool)
    +Pointer(inner:WeldType, mutable:bool)
    +Never
    +Unknown
    +to_typescript() str
    +is_async_result() bool
    +is_op_state() bool
  }

  class ParamAttr {
    <<enum>>
    +None
    +String
    +Serde
    +Buffer
    +Global
    +State
  }

  class Op2Attrs {
    +is_fast: bool
    +string_return: bool
    +serde_return: bool
    +is_async: bool
    +rename: str
  }

  class OpParam {
    +rust_name: str
    +ts_name: str
    +ty: WeldType
    +attr: ParamAttr
    +doc: str
    +optional: bool
    +to_typescript_param() str
  }

  class OpSymbol {
    +rust_name: str
    +ts_name: str
    +is_async: bool
    +params: OpParam[]
    +return_type: WeldType
    +doc: str
    +op2_attrs: Op2Attrs
    +module: str
    +visible_params() OpParam[]
    +ts_return_type() str
    +to_typescript_signature() str
  }

  class StructField {
    +rust_name: str
    +ts_name: str
    +ty: WeldType
    +optional: bool
    +doc: str
    +readonly: bool
    +to_typescript_field() str
  }

  class WeldStruct {
    +rust_name: str
    +ts_name: str
    +fields: StructField[]
    +doc: str
    +is_type_alias: bool
    +type_params: str[]
    +to_typescript_interface() str
  }

  class EnumVariant {
    +name: str
    +value: str
    +data: WeldType
    +doc: str
  }

  class WeldEnum {
    +rust_name: str
    +ts_name: str
    +variants: EnumVariant[]
    +doc: str
    +to_typescript_type() str
  }

  class WeldModule {
    +name: str
    +specifier: str
    +ops: OpSymbol[]
    +structs: WeldStruct[]
    +enums: WeldEnum[]
    +esm_entry_point: str
    +doc: str
    +error_type: str
    +error_code_start: int
    +op_names() str[]
    +deno_core_ops_declaration() str
    +validate() ModuleValidationError
  }

  class ExtensionBuilder {
    -module: WeldModule
    -ts_path: Path
    -sdk_path: Path
    -additional_watch: Path[]
    -dts_generator: fn() str
    +ts_path(path: Path) ExtensionBuilder
    +ops(names: str[]) ExtensionBuilder
    +generate_sdk_types(sdk_rel: Path) ExtensionBuilder
    +dts_generator(gen: fn() str) ExtensionBuilder
    +build() Result~void,ExtensionBuilderError~
  }

  WeldPrimitive <.. WeldType
  WeldType <.. OpParam
  WeldType <.. OpSymbol
  WeldType <.. StructField
  WeldType <.. WeldEnum
  ParamAttr <.. OpParam
  Op2Attrs <.. OpSymbol
  OpParam "*" --> "1" OpSymbol
  StructField "*" --> "1" WeldStruct
  EnumVariant "*" --> "1" WeldEnum
  OpSymbol "*" --> "1" WeldModule
  WeldStruct "*" --> "1" WeldModule
  WeldEnum "*" --> "1" WeldModule
  WeldModule <.. ExtensionBuilder
Loading

File-Level Changes

Change Details Files
Replaced per-extension manual TS transpile/build scripts with a shared forge-weld/forge-weld-macro codegen pipeline and updated extensions to include generated extension.rs at build time.
  • Added forge-weld and forge-weld-macro crates with IR, codegen, build utilities, and proc macros for ops/structs/enums.
  • Refactored ext_fs, ext_net, ext_sys, ext_process, ext_wasm, and ext_ipc build.rs to use ExtensionBuilder::new(...).ts_path("ts/init.ts").ops([...]) and generate SDK d.ts where appropriate.
  • Updated corresponding ext_* lib.rs files to drop inline deno_core::extension! invocations and instead include!("$OUT_DIR/extension.rs") so the build output is used at runtime.
  • Hooked forge-weld in as a build-dependency in the affected extension Cargo.toml files.
crates/forge-weld/**
crates/forge-weld-macro/**
crates/ext_fs/build.rs
crates/ext_sys/build.rs
crates/ext_wasm/build.rs
crates/ext_process/build.rs
crates/ext_net/build.rs
crates/ext_ipc/build.rs
crates/ext_fs/src/lib.rs
crates/ext_sys/src/lib.rs
crates/ext_wasm/src/lib.rs
crates/ext_process/src/lib.rs
crates/ext_net/src/lib.rs
crates/ext_ipc/Cargo.toml
crates/ext_fs/Cargo.toml
crates/ext_sys/Cargo.toml
crates/ext_wasm/Cargo.toml
crates/ext_process/Cargo.toml
crates/ext_net/Cargo.toml
Introduced the ext_window crate and host:window API surface, and re-scoped host:ui to basic operations while documenting host-ipc and host-window in the site.
  • Implemented ext_window crate build.rs using forge-weld::ExtensionBuilder defining all window/dialog/menu/tray ops and using a dts generator for host.window.d.ts.
  • Simplified WindowOpts in ext_window by deriving Default directly rather than hand-implementing it.
  • Added site docs for host:window and host:ipc plus crate docs for ext_window, ext_ipc, ext_fs, ext_net, ext_sys, ext_process, ext_wasm, forge, forge-host, forge-weld, and forge-weld-macro, and updated architecture docs to reference host:window/host:ipc and forge-weld.
  • Reworked host-ui docs to focus on basic window operations, dialogs, menus, and tray and to point advanced usage to host:window and host:ipc; added full examples and TypeScript-style interfaces.
  • Updated getting-started docs (site and docs/) to demonstrate createWindow/menu/dialog/host:ipc usage instead of openWindow/windowEvents-only flows.
crates/ext_window/build.rs
crates/ext_window/src/lib.rs
sdk/generated/host.window.d.ts
site/src/content/docs/api/host-window.md
site/src/content/docs/api/host-ui.md
site/src/content/docs/api/host-ipc.md
site/src/content/docs/architecture.md
site/src/content/docs/getting-started.md
docs/getting-started.md
docs/architecture.md
site/src/content/docs/crates/ext-window.md
site/src/content/docs/crates/ext-ipc.md
site/src/content/docs/crates/ext-fs.md
site/src/content/docs/crates/ext-net.md
site/src/content/docs/crates/ext-process.md
site/src/content/docs/crates/ext-sys.md
site/src/content/docs/crates/ext-wasm.md
site/src/content/docs/crates/forge.md
site/src/content/docs/crates/forge-host.md
site/src/content/docs/crates/forge-weld.md
site/src/content/docs/crates/forge-weld-macro.md
site/astro.config.mjs
site/src/components/Footer.astro
site/src/components/QuickStart.astro
Replaced the CLI template-based init flow and templates/ directory with an examples/-based onboarding story and removed template embedding from forge and forge-host.
  • Removed forge init implementation and the templates embedding build.rs in the CLI crate; dropped include!("templates.rs") and the templates/ tree in favor of pointing users to the examples/ directory.
  • Simplified forge CLI usage/help text to only cover dev/build/bundle/sign/icon, with explicit guidance to copy examples/example-deno-app, react-app, nextjs-app, and svelte-app.
  • Removed forge build defaulting to apps/example-deno-app, making app dir required for dev/build/bundle commands.
  • Switched forge-host to require an explicit --app-dir argument instead of defaulting to apps/example-deno-app, and changed its build.rs to copy sdk/preload.ts into OUT_DIR and inject it as TypeScript via preload_ts().
crates/forge/src/main.rs
crates/forge/build.rs
crates/forge-host/src/main.rs
crates/forge-host/build.rs
CLAUDE.md
site/public/install.sh
README.md
docs/guides/icons.md
docs/getting-started.md
CHANGELOG.md
.gitignore
templates/**
Renamed the apps/ directory to examples/, updated docs/README/CI paths, and added/ported example apps for React, Svelte, and a Next.js-style pattern.
  • Moved existing apps into examples/, updating manifests and deno.json where needed; renamed template HTML files appropriately and cleaned up styles.
  • Added or wired up example-deno-app, react-app, svelte-app, nextjs-app, system-monitor, text-editor, todo-app, wasm-forge-example, and weather-app in examples/.
  • Updated all docs, README tables, footer links, and architecture diagrams to reference examples/ instead of apps/.
  • Updated GitHub Actions workflows (release and bundle-app) and packaging scripts to build/bundle examples/example-deno-app instead of apps/example-deno-app.
examples/**
README.md
docs/getting-started.md
docs/architecture.md
site/src/content/docs/getting-started.md
site/src/content/docs/architecture.md
site/src/components/Footer.astro
site/src/components/QuickStart.astro
.github/workflows/release.yml
.github/workflows/bundle-app.yml
.github/workflows/**
site/public/install.sh
CLAUDE.md
Adjusted resolver/preload handling and small build/bundler fixes across the host and CLI.
  • Renamed the JS resolver to a typed resolver.ts with an explicit name export string type.
  • Switched forge-host preload injection from compiled JS to including the TypeScript source from sdk/preload.ts, updating helper naming from preload_js to preload_ts.
  • Fixed macOS pkgbuild/productbuild invocations in the CLI bundler to avoid borrowing temporary string references when passing paths to commands.
  • Tweaked tray menu and context menu examples to use the simpler separator representation and streamlined docs for platform-specific tray guidance.
crates/forge-host/src/resolver.ts
crates/forge-host/src/main.rs
crates/forge-host/build.rs
crates/forge/src/bundler/pkg.rs
site/src/content/docs/api/host-ui.md
site/src/content/docs/getting-started.md
docs/getting-started.md
site/src/content/docs/guides/icons.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and found some issues that need to be addressed.

  • In forge-host you now copy and inject sdk/preload.ts directly via with_initialization_script, but WebView engines expect JavaScript, so you should transpile this to JS in build.rs and embed the JS source instead of the TypeScript.
  • The new crates/forge-host/src/resolver.ts replaces resolver.js but there’s no corresponding build step to transpile it; make sure the runtime either loads the .ts file via a TS-aware pipeline or you generate a .js artifact like before.
  • The forge-weld macros currently default many parameter and field types to WeldType::Unknown; if these generated definitions are meant to drive the SDK typings, it would be helpful to start populating real type mappings (or clearly mark the generated d.ts as partial) to avoid misleading consumers.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In forge-host you now copy and inject `sdk/preload.ts` directly via `with_initialization_script`, but WebView engines expect JavaScript, so you should transpile this to JS in build.rs and embed the JS source instead of the TypeScript.
- The new `crates/forge-host/src/resolver.ts` replaces `resolver.js` but there’s no corresponding build step to transpile it; make sure the runtime either loads the `.ts` file via a TS-aware pipeline or you generate a `.js` artifact like before.
- The forge-weld macros currently default many parameter and field types to `WeldType::Unknown`; if these generated definitions are meant to drive the SDK typings, it would be helpful to start populating real type mappings (or clearly mark the generated d.ts as partial) to avoid misleading consumers.

## Individual Comments

### Comment 1
<location> `crates/forge-weld-macro/Cargo.toml:11` </location>
<code_context>
-deno_ast = { version = "*", features = ["transpiling"] }
+forge-weld = { path = "../forge-weld" }

 [dependencies]
 anyhow = "1"
</code_context>

<issue_to_address>
**issue (bug_risk):** The macro crate references `forge_weld` types/macros but does not declare a dependency on the `forge-weld` crate.

The macros in `weld_op.rs` and `weld_struct.rs` expand to code that uses `forge_weld::OpSymbol`, `forge_weld::WeldStruct`, `forge_weld::StructField`, `forge_weld::WeldType`, and `forge_weld::register_*` macros. Without declaring `forge-weld` as a dependency, these paths will not resolve when compiling the proc-macro crate. Please add `forge-weld` as a dependency (with a compatible version) so this crate builds successfully.
</issue_to_address>

### Comment 2
<location> `crates/forge-weld-macro/src/weld_op.rs:147-152` </location>
<code_context>
+    let metadata_fn_name = format_ident!("__{}_weld_metadata", fn_name);
+
+    // Generate parameter metadata
+    let param_tokens: Vec<_> = params
+        .iter()
+        .map(|(name, _ty, optional)| {
+            let ts_param_name = to_camel_case(name);
+            quote! {
+                forge_weld::OpParam {
+                    rust_name: #name.to_string(),
+                    ts_name: #ts_param_name.to_string(),
</code_context>

<issue_to_address>
**issue (bug_risk):** `weld_op` macro generates struct initializers that don’t match the `forge_weld` IR types (e.g. `attr: None`, `op2_attrs: None`).

In `symbol.rs`, `OpParam.attr` is `ParamAttr` (not `Option<ParamAttr>`), and `OpSymbol.op2_attrs` is `Op2Attrs` (not `Option<_>`), so using `attr: None` / `op2_attrs: None` will not compile. Please construct concrete values instead (e.g. `ParamAttr::None`, `Op2Attrs::default()`). Also verify the `forge_weld::register_op!` path resolves correctly when this macro is invoked.
</issue_to_address>

### Comment 3
<location> `crates/forge-host/src/main.rs:61-63` </location>
<code_context>
 }

-fn preload_js() -> &'static str {
+fn preload_ts() -> &'static str {
     // Generated from sdk/preload.ts at build time
-    include_str!(concat!(env!("OUT_DIR"), "/preload.js"))
+    include_str!(concat!(env!("OUT_DIR"), "/preload.ts"))
 }

</code_context>

<issue_to_address>
**issue (bug_risk):** Injecting `preload.ts` as the WebView initialization script will likely fail because the WebView expects JavaScript, not TypeScript.

This now embeds the raw TypeScript source (`preload.ts`) instead of the transpiled JS that was previously produced at build time, and that string is passed directly to `with_initialization_script`. Unless the WebView layer transpiles TS at runtime (which is very unlikely), the preload will no longer execute. Please restore a build step that outputs JS (e.g., `preload.js` in `OUT_DIR`) and reference that JS file here instead of the TS source.
</issue_to_address>

### Comment 4
<location> `crates/forge-weld/README.md:3` </location>
<code_context>
+# Forge Weld
+
+This Module provides the glue/bindings for the forge framework, it glues the rust/deno methods and generates the code that is output by the framework.
+
+## How the Binding/Glue works
</code_context>

<issue_to_address>
**suggestion (typo):** Polish grammar and capitalization in this sentence for readability.

This sentence is a comma splice and uses inconsistent capitalization (e.g., "Module", "rust/deno"). Consider something like: `This module provides the glue/bindings for the Forge framework. It connects Rust and Deno methods and generates the code that the framework exposes.` Also ensure proper names (Rust, Deno, Forge) are capitalized consistently.

```suggestion
This module provides the glue/bindings for the Forge framework. It connects Rust and Deno methods and generates the code that the framework exposes.
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

[lib]
proc-macro = true

[dependencies]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): The macro crate references forge_weld types/macros but does not declare a dependency on the forge-weld crate.

The macros in weld_op.rs and weld_struct.rs expand to code that uses forge_weld::OpSymbol, forge_weld::WeldStruct, forge_weld::StructField, forge_weld::WeldType, and forge_weld::register_* macros. Without declaring forge-weld as a dependency, these paths will not resolve when compiling the proc-macro crate. Please add forge-weld as a dependency (with a compatible version) so this crate builds successfully.

Comment thread crates/forge-weld-macro/src/weld_op.rs Resolved
Comment thread crates/forge-host/src/main.rs Outdated
Comment on lines +61 to +63
fn preload_ts() -> &'static str {
// Generated from sdk/preload.ts at build time
include_str!(concat!(env!("OUT_DIR"), "/preload.js"))
include_str!(concat!(env!("OUT_DIR"), "/preload.ts"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Injecting preload.ts as the WebView initialization script will likely fail because the WebView expects JavaScript, not TypeScript.

This now embeds the raw TypeScript source (preload.ts) instead of the transpiled JS that was previously produced at build time, and that string is passed directly to with_initialization_script. Unless the WebView layer transpiles TS at runtime (which is very unlikely), the preload will no longer execute. Please restore a build step that outputs JS (e.g., preload.js in OUT_DIR) and reference that JS file here instead of the TS source.

Comment thread crates/forge-weld/README.md Outdated
@@ -0,0 +1,12 @@
# Forge Weld

This Module provides the glue/bindings for the forge framework, it glues the rust/deno methods and generates the code that is output by the framework.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (typo): Polish grammar and capitalization in this sentence for readability.

This sentence is a comma splice and uses inconsistent capitalization (e.g., "Module", "rust/deno"). Consider something like: This module provides the glue/bindings for the Forge framework. It connects Rust and Deno methods and generates the code that the framework exposes. Also ensure proper names (Rust, Deno, Forge) are capitalized consistently.

Suggested change
This Module provides the glue/bindings for the forge framework, it glues the rust/deno methods and generates the code that is output by the framework.
This module provides the glue/bindings for the Forge framework. It connects Rust and Deno methods and generates the code that the framework exposes.

…ge-weld

- Add forge-weld dependency to forge-weld-macro Cargo.toml
- Fix weld_op macro to use ParamAttr::default() and Op2Attrs::default()
- Implement rust_type_to_weld_type() for proper Rust→TypeScript type mappings
- Add comprehensive type inference for primitives, generics, and collections
- Fix GTK window type mismatch using upcast_ref() for context menus
- Add preload.ts transpilation to JS in forge-host build.rs
- Write comprehensive README documentation for forge-weld
- Fix flaky transpile tests to handle quote style variations
Comment thread crates/forge-host/src/main.rs Fixed
@LayerDynamics
LayerDynamics merged commit a01f4a5 into main Dec 14, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants