Merge branch 'main' into setup/prettier

This commit is contained in:
Faisal Amir 2023-10-20 11:40:14 +07:00 committed by GitHub
commit fa3db5ade2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,36 @@
# ADR 006: jan-core-module
## Changelog
- 2023-10-19: Initial draft
## Authors
- Louis
## Status
Accepted
## Context
Currently, developers face several challenges while writing a plugin, which include:
- Registering functions using the function name as a string
- Invoking anonymous functions
- No access to native APIs or common functions for data insertion or retrieval
- Lack of communication between the app and plugins.
## Decision
Let developers install and import an npm module to develop our Plugin easier.
Upon boot, Web plugs in window modules. Its components and plugins can then import the core to access exposed functions.
![Jan Core Module](./images/jan-core-module.png)
## Consequences
Separate PRs should be created for updating the core and app. For instance, if a new app enhancement requires the core module to expose a new API, a new core update must be published on npm to prevent CI failure.
## Alternatives
## Reference

View File

@ -0,0 +1,35 @@
# ADR 007: jan-plugin-catalog
## Changelog
- 2023-10-19: Initial draft
## Authors
- Louis
## Status
Proposed
## Context
Users should be able to explore plugins, and developers need a channel to publish their plugins
Lesson learned from the Model Catalog: we hosted everything on Github and attempted to retrieve it anonymously, which cost us a lot of effort and led to a limit rate issue. Let's say there are N items in the catalog, and we attempted to send N+1 requests at a time. It was costly and led to an API limit rate issue.
## Decision
1. Combine all JSON items in the catalog into one JSON catalog. Now we just need to work with one catalog file, which means only one request, but the rate limit issue still exists.
2. CDN - there are cool services out there which support OSS projects, such as [JSDELIVR](https://www.jsdelivr.com).
3. Downloading a JSON file is not a good approach, though. Exporting a module works better. Webpack + DefinePlugin should work.
4. Since we have created a new module, we want to publish it as well. Let's publish it on npm so everyone can install and use it. This is also to add a versioning feature.
5. Installing this npm module would require the user to update their app to the latest version. Instead, let's import the remote module via CDN, which requires just a few lines of code.
![Jan Plugin Catalog](./images/jan-plugin-catalog.png)
## Consequences
## Alternatives
## Reference

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB