Skip to content

feat: init API system with new crate metassr-api-handler#67

Open
fahdfady wants to merge 8 commits intometacall:masterfrom
fahdfady:feat-api-handler
Open

feat: init API system with new crate metassr-api-handler#67
fahdfady wants to merge 8 commits intometacall:masterfrom
fahdfady:feat-api-handler

Conversation

@fahdfady
Copy link
Collaborator

resolves #25

…l hello.js test

Signed-off-by: Fahd Ashour <fahd.fady212@gmail.com>
@fahdfady fahdfady requested a review from hulxv December 22, 2025 18:28
// This is a testing behavior that might change to use a dedicated
// MetaCall runtime thread for better async handling and isolation.
// Passing None as handle to use the global context.
load::from_memory(load::Tag::NodeJS, &code, None)
Copy link
Collaborator

Choose a reason for hiding this comment

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

if we have multiple endpoints, the handler names will be duplicated (GET, POST, etc..). I think that will make metacall panics because it doesn't accept duplicated names

CC: @viferga

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@hulxv Yeah you're right. that's a problem i encountered in my demo and @viferga helped me solve this.
I'll make a HashMap of <Path, Handle> so each file has it's own handle in a scope.
Thanks Mohamed.

Copy link
Collaborator

@hulxv hulxv left a comment

Choose a reason for hiding this comment

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

Dont miss resolving conflicts

Copy link
Collaborator

@hulxv hulxv left a comment

Choose a reason for hiding this comment

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

it seems you have an error

 error[E0061]: this function takes 3 arguments but 2 arguments were supplied
   --> crates/metassr-bundler/src/lib.rs:103:29
    |
103 |             if let Err(e) = load::from_memory(load::Tag::NodeJS, BUILD_SCRIPT) {
    |                             ^^^^^^^^^^^^^^^^^--------------------------------- argument #3 of type `std::option::Option<&mut metacall::load::Handle>` is missing
    |
note: function defined here
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/metacall-0.5.6/src/load.rs:172:8
    |
172 | pub fn from_memory(
    |        ^^^^^^^^^^^
help: provide the argument
    |
103 |             if let Err(e) = load::from_memory(load::Tag::NodeJS, BUILD_SCRIPT, /* std::option::Option<&mut metacall::load::Handle> */) {
    |            

@fahdfady
Copy link
Collaborator Author

it seems you have an error

Yeah my bad that was because of the conflicts. It should work now

@fahdfady fahdfady marked this pull request as draft December 31, 2025 11:31
@fahdfady fahdfady marked this pull request as ready for review February 24, 2026 00:48
@hulxv
Copy link
Collaborator

hulxv commented Feb 24, 2026

What's the current status? Does it work as expected?

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.

feat: api route

2 participants