Closed ac-z closed 1 month ago
I really don't see the point It's JavaScript, users can just rename it, or make their own object referencing mine
This would just add complexity
Users could just as easily:
globalThis.myFunctions = {
rustyscript.functions.a, rustyscript.functions.b
}
I really don't see the point It's JavaScript, users can just rename it, or make their own object referencing mine
Was under the impression that freezing in JavaScript doesn't let you delete or rename. Closing.
Right now, registered functions are made available under the
functions
andasync_functions
proxies within the globalrustyscript
object, alongside the essential functionsbail
andregister_entrypoint
.This is a good default, but I think it would be good to allow more flexibility here. I have the following additions to the API in mind:
None
, default to the current name,rustyscript
.appname.category.subcategory.foo()
) https://github.com/rscarson/rustyscript/blob/4745154b371255d75d120f6c32abafa432672740/src/ext/rustyscript/rustyscript.js#L35-L52 The best way to avoid making this overly complex is to simply allow users implement their own replacement for this bit of code with their own extension.Things to consider