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 gRPC blockquote #1229

Merged
merged 1 commit into from
Jun 19, 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
23 changes: 23 additions & 0 deletions src/components/shared/grpc-blockquote/grpc-blockquote.view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import Blockquote from 'components/shared/blockquote';
import React from 'react';

const GrpcBlockquote = () => (
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
const GrpcBlockquote = () => (
const GrpcExperimentalBlockquote = () => (

<Blockquote mod="info">
<h4>A module with streaming support exists</h4>
<p>
The new{' '}
<a href="https://k6.io/docs/javascript-api/k6-experimental/grpc/">
k6/experimental/grpc
</a>{' '}
module extends{' '}
<a href="https://k6.io/docs/javascript-api/k6-net-grpc/">k6/net/grpc</a>{' '}
to support{' '}
<a href="https://k6.io/docs/javascript-api/k6-experimental/grpc/stream/">
gRPC streaming
</a>
. We recommend using the new module.
</p>
</Blockquote>
);

export default GrpcBlockquote;
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
export default GrpcBlockquote;
export default GrpcExperimentalBlockquote;

3 changes: 3 additions & 0 deletions src/components/shared/grpc-blockquote/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import GrpcBlockquote from './grpc-blockquote.view';

export default GrpcBlockquote;
Comment on lines +1 to +3
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
import GrpcBlockquote from './grpc-blockquote.view';
export default GrpcBlockquote;
import GrpcExperimentalBlockquote from './grpc-blockquote.view';
export default GrpcExperimentalBlockquote;

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Collapsible from 'components/shared/collapsible';
import CryptoBlockquote from 'components/shared/crypto-blockquote';
import DescriptionList from 'components/shared/description-list';
import ExperimentalBlockquote from 'components/shared/experimental-blockquote';
import GrpcBlockquote from 'components/shared/grpc-blockquote';
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
import GrpcBlockquote from 'components/shared/grpc-blockquote';
import GrpcExperimentalBlockquote from 'components/shared/grpc-blockquote';

import { HeadingLandmark } from 'components/shared/heading';
import InstallationInstructions from 'components/shared/installation-instructions';
import LdScript from 'components/shared/ld-script';
Expand Down Expand Up @@ -45,6 +46,7 @@ const componentsForNativeReplacement = {
BlockingAwsBlockquote,
CryptoBlockquote,
WsBlockquote,
GrpcBlockquote,
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
GrpcBlockquote,
GrpcExperimentalBlockquote,

InstallationInstructions,
Tooltip,
BNIT,
Expand Down
10 changes: 2 additions & 8 deletions src/data/markdown/docs/02 javascript api/11 k6-net-grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,10 @@ title: "k6/net/grpc"
excerpt: "k6 gRPC API"
---

The `k6/net/grpc` module, added in k6 v0.29.0, provides a [gRPC](https://grpc.io/) client for Remote Procedure Calls (RPC) over HTTP/2.
<GrpcBlockquote />
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
<GrpcBlockquote />
<GrpcExperimentalBlockquote />


<Blockquote mod='info'>
The `k6/net/grpc` module provides a [gRPC](https://grpc.io/) client for Remote Procedure Calls (RPC) over HTTP/2.

#### An extension with much better API exists

[xk6-grpc](https://github.com/grafana/xk6-grpc) implements gRPC streaming APIs.

Currently, it's available as an experimental module [`k6/experimental/grpc`](/javascript-api/k6-experimental/grpc/). It is also likely that it will at some point become part of the core of k6.
</Blockquote>

| Class/Method | Description |
|--------------|-------------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ title: Client
excerpt: 'Client is a gRPC client that can interact with a gRPC server.'
---

`Client` is a gRPC client that can interact with a gRPC server.

> ⚠️ **Note**: Only unary RPCs are currently supported, i.e. there is no support for client, server or bidirectional streaming.
<GrpcBlockquote />
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
<GrpcBlockquote />
<GrpcExperimentalBlockquote />


`Client` is a gRPC client that can interact with a gRPC server. Only unary RPCs are currently supported in this module.


| Method | Description |
Expand Down