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

Add miniflare docs #18690

Open
wants to merge 3 commits into
base: production
Choose a base branch
from
Open

Add miniflare docs #18690

wants to merge 3 commits into from

Conversation

penalosa
Copy link
Contributor

@penalosa penalosa commented Dec 11, 2024

Adds the contents of https://miniflare.dev/, with non-relevant sections removed/modified. There are two commits—one with a full import of the content, and one with sections removed.

I imagine this will be a process of keeping these up to date and making them more detailed, but this should be a good start to allow us to retire https://miniflare.dev/ and the Miniflare 2 repo.

Copy link
Contributor

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

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

22 files reviewed, 30 total issue(s) found.

src/content/docs/workers/miniflare/core/standards.md Outdated Show resolved Hide resolved
src/content/docs/workers/miniflare/core/queues.md Outdated Show resolved Hide resolved
src/content/docs/workers/miniflare/index.mdx Outdated Show resolved Hide resolved
src/content/docs/workers/miniflare/migrations/from-v2.mdx Outdated Show resolved Hide resolved
src/content/docs/workers/miniflare/storage/d1.md Outdated Show resolved Hide resolved
src/content/docs/workers/miniflare/core/scheduled.md Outdated Show resolved Hide resolved
Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
Copy link
Contributor

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

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

21 files reviewed, 10 total issue(s) found.


## HTTP Requests

Whenever an HTTP request is made, a `Request` object is dispatched to your worker, then the generated `Response` is returned. The
Copy link
Contributor

Choose a reason for hiding this comment

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

Issues:

  • Style Guide - (Terms-error) Use 'Worker' instead of 'worker'.

Fix Explanation:

The term 'worker' is a code reference, so no change is needed.

## Manipulating Outside Workers

For testing, it can be useful to make requests to your Durable Objects from
outside a worker. You can do this with the `getDurableObjectNamespace` method.
Copy link
Contributor

Choose a reason for hiding this comment

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

Issues:

  • Style Guide - (Terms-error) Use 'Worker' instead of 'worker'.

Fix Explanation:

The term 'worker' is a code reference, as indicated by the surrounding tick marks. Therefore, no correction is needed according to the guidelines.

## Using a Class Exported by Another Script

Miniflare supports the `script_name` option for accessing Durable Objects
exported by other scripts. This requires mounting the other worker as described
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
exported by other scripts. This requires mounting the other worker as described
exported by other scripts. This requires mounting the other Worker as described

Issues:

  • Style Guide - (Terms-error) Use 'Worker' instead of 'worker'.

Fix Explanation:

The capitalization of 'worker' to 'Worker' is recommended by the style guide. This is a straightforward capitalization correction.

## Manipulating Outside Workers

For testing, it can be useful to put/get data from R2 storage
outside a worker. You can do this with the `getR2Bucket` method:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
outside a worker. You can do this with the `getR2Bucket` method:
outside a Worker. You can do this with the `getR2Bucket` method:

Issues:

  • Style Guide - (Terms-error) Use 'Worker' instead of 'worker'.

Fix Explanation:

The term 'worker' should be capitalized to 'Worker' as per the style guide recommendation. It is not a code reference, so the capitalization correction is applicable here.

title: "🔌 Multiple Workers"
---

Miniflare allows you to run multiple workers in the same instance. All Workers can be defined at the same level, using the `workers` option.
Copy link
Contributor

Choose a reason for hiding this comment

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

Issues:

  • Style Guide - (Terms-error) Use 'Workers' instead of 'workers'.

Fix Explanation:

The term 'workers' is a code reference, so we should not change its capitalization. The style guide's recommendation is a false positive in this context.

});
```

You can now access KV namespaces in your workers:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can now access KV namespaces in your workers:
You can now access KV namespaces in your Workers:

Issues:

  • Style Guide - (Terms-error) Use 'Workers' instead of 'workers'.

Fix Explanation:

The capitalization of 'workers' should be corrected to 'Workers' as per the style guide recommendation. This is not a code reference, so the correction is valid.


## Manipulating Outside Workers

For testing, it can be useful to put/get data from KV outside a worker. You can
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
For testing, it can be useful to put/get data from KV outside a worker. You can
For testing, it can be useful to put/get data from KV outside a Worker. You can

Issues:

  • Style Guide - (Terms-error) Use 'Worker' instead of 'worker'.

Fix Explanation:

The capitalization of 'worker' should be corrected to 'Worker' as per the style guide recommendation. This is not a code reference, so the correction is valid.

Copy link

Deploying cloudflare-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 58f0dd6
Status: ✅  Deploy successful!
Preview URL: https://5a9372f4.cloudflare-docs-7ou.pages.dev
Branch Preview URL: https://penalosa-miniflare-docs.cloudflare-docs-7ou.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product:workers Related to Workers product size/xl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants