-
Notifications
You must be signed in to change notification settings - Fork 230
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
Refactor functions docs #433
Conversation
Your Render PR Server URL is https://appwrite-pr-433.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cm11i0md3nmc739v9llg. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Your Render PR Server URL is https://appwrite-io-docker-pr-433.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cmopn2q1hbls739b09h0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logs background here looks like a bug. I'm pretty sure it should be dark.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it to an issue. It is
{% cards_item href="/docs/products/functions/execution" title="Execute" %} | ||
Appwrite Functions can be executed in a variety of ways, like SDK, domains, schedules, events, and more. Learn about executions. | ||
{% /cards_item %} | ||
{% cards_item href="/docs/products/functions/execution#domains" title="Domains" %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah I broke all these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
description: Learn what an Appwrite Function can do for you and how to create a new Appwrite Function | ||
--- | ||
|
||
Each Appwrite Function is a piece of user defined code that can be executed on demand. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldnt call it user-defined. either deveoper-defined, or defined by you.
User-defined sounds like end user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
Each Appwrite Function is a piece of user defined code that can be executed on demand. | ||
When you create a new Appwrite Function, you select a name, ID, and [runtime language](/docs/products/functions/runtimes). | ||
|
||
Each time a function changes, a [deployment](/docs/products/functions/deployments) is created, which is like a version of a function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each time a function changes, a [deployment](/docs/products/functions/deployments) is created, which is like a version of a function. | |
Each time a function's code changes, a [deployment](/docs/products/functions/deployments) is created, which is like a version of a function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
{% /tabsitem %} | ||
|
||
{% tabsitem #cli title="CLI" %} | ||
You can create functions using the CLI, without needing to access the console. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can create functions using the CLI, without needing to access the console. | |
You can create functions using the CLI, without needing to access the Console. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
{% /tabsitem %} | ||
{% /tabs %} | ||
|
||
After creating your function, create a [deployment](/docs/products/functions/deployments) to add code to the function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In all tabs it also explains how to make first deployment. I don't think we need this sentence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
{% tabsitem #manual title="Manual" %} | ||
You can also create Appwrite Functions manually by uploading your code in a zipped file. | ||
In the **Create Function** modal, click **create a function manually** at the bottom to switch to manual create wizard. | ||
You will asked to upload a zip file with your code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will asked to upload a zip file with your code. | |
You will be asked to upload a zip file with your code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
└── index.js | ||
``` | ||
|
||
Package your code files into the `.tar.gz` format. **Don't include your dependencies folder**, such as **node_modules**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Package your code files into the `.tar.gz` format. **Don't include your dependencies folder**, such as **node_modules**. | |
Package your code files into the `.tar.gz` format. **Don't include your dependencies folder**, such as node_modules. |
Too much boldness, this makes it better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
1. In the Appwrite Console's sidebar, click **Functions**. | ||
2. Click **Create function**. | ||
3. Connect your project to a Git repository. Your functions will build and deploy when the repository receives a push. | ||
4. If you already have a repository containing an Appwrite Function, connect to it under **Connect Git repository**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4. If you already have a repository containing an Appwrite Function, connect to it under **Connect Git repository**. | |
4. If you already have a repository containing an Appwrite Function, select it under **Connect Git repository**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
This lets you track your code using Git, which makes it easy to integrate Appwrite Functions into your existing code base. | ||
1. In the Appwrite Console's sidebar, click **Functions**. | ||
2. Click **Create function**. | ||
3. Connect your project to a Git repository. Your functions will build and deploy when the repository receives a push. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. Connect your project to a Git repository. Your functions will build and deploy when the repository receives a push. | |
3. Connect your project to your Git provider. You will be asked to authorize Appwrite and grant access to some resources necessary for the Git deployments to work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
When you update a function's runtime, the code of your function may not be compatible with the new runtime. | ||
Remember to update your code and redeploy your function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you update a function's runtime, the code of your function may not be compatible with the new runtime. | |
Remember to update your code and redeploy your function. | |
When you update a function's runtime, you may need to update code of your function to make it compatible with the new runtime. |
Above we already have big alert box teiing to redeploy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to add something to the Request
section here noting that req.body
will contain the object of the event that invoked it, like for buckets.*.files.*.create
it'll contain the file that triggered that event
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -464,7 +464,7 @@ You'll be able to mock executions by configuring the path, method, headers, and | |||
{% /only_light %} | |||
|
|||
|
|||
## Events {% #events %} | |||
# Events {% #events %} | |||
|
|||
Changes in Appwrite emit events. You can configure Functions to be executed in response to these events. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here for the events section, we should explain that the event trigger can be found in x-appwrite-event
header and the body will contain the data of the resource that triggered it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
* | ||
This event triggers when a verification token for a user is validated. | ||
Returns [Token Object](/docs/references/cloud/models/token) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to make sure we have the 1.5 events
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oi, review this: appwrite/appwrite#7744
2. Appwrite passes in request information like headers, body or path through the `context.req` object. | ||
3. The runtime executes the code you defined, you can log through the `context.log()` or `context.error()` methods. | ||
4. Function terminates when you return results using `return context.res.send()`, `return context.res.json()` or similar. | ||
1. The active [deployment](/docs/products/functions/deploy)'s executor will handle the request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These steps are all 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes markdown renders them as 1.2.3.4 ;) This in fact works
|
||
# Generated domains {% #generated-domains %} | ||
|
||
1. In the Appwrite Console's sidebar, click **Functions**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These steps are all 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes markdown renders them as 1.2.3.4 ;) This in fact works
1. In the Appwrite Console's sidebar, click **Functions**. | ||
1. Under the **Domains** tab, you'll find the generated domain from Appwrite and your custom domains. | ||
1. Under **Execute access**, set the access to `Any` so that anyone can execute the function. You will use [JWTs](/docs/products/auth/jwt) to authenticate users. | ||
1. Under the **Domains** tab, you'll find the generated domain from Appwrite and your custom domains. [Learn about adding a custom domain](/docs/products/functions/domains). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These steps all both 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes markdown renders them as 1.2.3.4 ;) This in fact works
--- | ||
layout: article | ||
title: Templates | ||
description: Learn about Appwrite Functions' templates that let you jump start function development to extend your Appwrite APIs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the '
in this description cause problems with the parser? I vaguely remember an issue like this, please check it doesn't result in a server error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll check :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small issues here and there
…/website into feat-functions-refactor
What does this PR do?
Refactor some of function docs, so they're easier to digest
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)