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

Improve Module API docs & example #26637

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build_config.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ modules:
# An example of pulling a module from NPM
- "@vector-im/element-web-ilag-module@^0.0.1"

# An example of pulling a module from github
- "github:vector-im/element-web-ilag-module#main"
# An example of pulling a module from local filesystem during development
- "file:/home/user/development/element-web-ilag-module"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to mention here that you'll have to build it yourself in the folder?

Copy link
Member Author

@t3chguy t3chguy Nov 24, 2023

Choose a reason for hiding this comment

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

That depends on your module though, if your module is JS then you don't need to build, nowhere do we state that we build your module for any dependency type, when installing an npm dependency it may or may not be built depending on what the lifecycle scripts do. So this could cause more confusion than good IMO

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, I see. 👍

2 changes: 2 additions & 0 deletions docs/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ The following requirements are key for any module:
which takes a single parameter: a `ModuleApi` instance. This instance is passed to `super()`.
3. The module must be deployed in a way where `yarn add` can access it, as that is how the build system will try to
install it. Note that while this is often NPM, it can also be a GitHub/GitLab repo or private NPM registry.
Be careful when using git dependencies in yarn classic, many lifecycle scripts will not be executed which may mean
that your module is not built and thus may fail to be imported.

... and that's pretty much it. As with any code, please be responsible and call things in line with the documentation.
Both `RuntimeModule` and `ModuleApi` have extensive documentation to describe what is proper usage and how to set things
Expand Down
Loading