-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extract glee-core from glee #795
Comments
Is there a justification for this? 🤔 |
I think adapters shouldn't go into glee-core. Actually, I think adapters should also be extracted as independent packages. Some adapters would work on the browser and some not. |
for starters: #794 (comment)
That is a great Idea. import Glee, {string2json} from "@asyncapi/glee-core"
const glee = new Glee(AsyncAPIDocument)
//hello is the operation id.
glee.use('hello', (message: Message, context: Context) => {
const replyText = `you said: ${message.payload}`
message.reply(replyText)
}
})
glee.use('hi', string2json)
glee.use('hi', (message, context) => {
const replyText = `you sent the following json: ${message.payload}`// or maybe message.payload.json() 🤔
message.reply(replyText)
})
glee.start() |
Left a comment there. |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
Problem
There is no way to run it on the browser.
Solution
Extract Glee's core logic into a separate project called "glee-core." As the name suggests, glee-core would be the foundation of Glee, capable of running on both servers and in browsers. It should expose a class called "Glee" with the following parameters:
not exactly sure what the final interface would look like but it would be something like:
Rabbit holes
Since Glee was not designed for browser execution, there might be compatibility issues with its current dependencies.
Scope
Out of bounds
Success criteria
glee-core
that can run in browser and node environment.glee-core
supports all of the features that glee currently supports (without dealing with files of-course)The text was updated successfully, but these errors were encountered: