Skip to content
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

Open
7 tasks
KhudaDad414 opened this issue Apr 5, 2024 · 5 comments
Open
7 tasks

extract glee-core from glee #795

KhudaDad414 opened this issue Apr 5, 2024 · 5 comments
Labels

Comments

@KhudaDad414
Copy link
Member

KhudaDad414 commented Apr 5, 2024

Problem

There is no way to run it on the browser.

Solution

Proposed solution with mockups, views...

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:

  1. the parsed AsyncAPI spec file.
  2. a set of lifecycle functions and operation functions.
  3. some options to configure it further.

not exactly sure what the final interface would look like but it would be something like:

const glee = new Glee(asyncAPI: AsyncAPIDocument, handlers: {lifecycle, operations}, options: Options)
glee.start()

Rabbit holes

Since Glee was not designed for browser execution, there might be compatibility issues with its current dependencies.

Scope

Describe a list of tasks or issues that needs to be done ( you don't need to have an exhaustive list of all the tasks in the beginning)

  • Create a working POC example with Websockets
  • Implement HTTP adapters.
  • Implement Kafka adapter.
  • Implement MQTT adapter.
  • Implement Socket.io adapter.
  • Document how to add new adapters.
  • Deployment how to the project works (tailored to contributors)

Out of bounds

  • Integrating "glee-core" into the existing Glee project.
  • Adding new features to glee is also not included. (unless added to the scope above)

Success criteria

  • completed 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)
  • it contains contribution guides, as well as a well documented API.
  • it can run current glee example both on server and on the browser (excluding examples featuring a server for the browser).
@KhudaDad414 KhudaDad414 self-assigned this Apr 5, 2024
@KhudaDad414 KhudaDad414 changed the title Divide glee into glee-core and glee-node extract glee-core from glee Apr 6, 2024
@fmvilas
Copy link
Member

fmvilas commented Apr 7, 2024

Evaluate bun for the glee-core project.

Is there a justification for this? 🤔

@fmvilas
Copy link
Member

fmvilas commented Apr 7, 2024

Implement HTTP adapters.
Implement Kafka adapter.
Implement MQTT adapter.
Implement Socket.io adapter.

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.

@KhudaDad414
Copy link
Member Author

KhudaDad414 commented Apr 15, 2024

Is there a justification for this? 🤔

for starters: #794 (comment)

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.

That is a great Idea.
I suggest we go even further, extracting the middleware and allowing the glee-core user to import and use it with the operations that they like.
something like:

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()

@fmvilas
Copy link
Member

fmvilas commented Apr 15, 2024

for starters: #794 (comment)

Left a comment there.

Copy link
Contributor

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 ❤️

@github-actions github-actions bot added the stale label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants