Skip to content

refactor: simplify prop passing to ClientClass by using asyncapi object #1571

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

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8afd069
Describe your changes here
Aditya08Vashisht May 21, 2025
3365d83
Merge branch 'master' into fix-prop-passing
Aditya08Vashisht May 25, 2025
6660f56
Update ClientClass.js
Aditya08Vashisht May 25, 2025
b860ddd
Update client.py.js
Aditya08Vashisht May 25, 2025
4ae08af
Merge branch 'master' into fix-prop-passing
Aditya08Vashisht Jun 4, 2025
b40d7da
Resolve merge conflict in client.py.js
Aditya08Vashisht Jun 4, 2025
b6eba47
Update client.py.js
Aditya08Vashisht Jun 4, 2025
7b587f6
refactor: update ClientClass to match asyncapi prop refactor
Aditya08Vashisht Jun 4, 2025
400f099
refactor: update ClientClass to match asyncapi prop refactor
Aditya08Vashisht Jun 4, 2025
21c8ac9
refactor: update ClientClass to match asyncapi prop refactor
Aditya08Vashisht Jun 4, 2025
e7e5dec
refactor: update ClientClass to match asyncapi prop refactor
Aditya08Vashisht Jun 4, 2025
a36e685
refactor: update ClientClass to match asyncapi prop refactor
Aditya08Vashisht Jun 4, 2025
e00cba7
Update client.py.js
Aditya08Vashisht Jun 4, 2025
4de91fc
Update ClientClass.js
Aditya08Vashisht Jun 4, 2025
d836304
Update client.py.js
Aditya08Vashisht Jun 4, 2025
dc2ee8f
Update ClientClass.js
Aditya08Vashisht Jun 4, 2025
30f1640
Update client.py.js
Aditya08Vashisht Jun 4, 2025
ed8af2f
Update client.py.js
Aditya08Vashisht Jun 4, 2025
276d2dd
fix: restore removed components and helpers, cleaned incorrect additions
Aditya08Vashisht Jun 6, 2025
04b1115
Merge branch 'master' into fix-prop-passing
Aditya08Vashisht Jun 6, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { CloseConnection } from './CloseConnection';
import { RegisterOutgoingProcessor } from './RegisterOutgoingProcessor';
import { HandleError } from './HandleError';

export function ClientClass({ clientName, serverUrl, title, queryParams, operations }) {
const sendOperations = operations.filterBySend();
export function ClientClass({ clientName, serverUrl, title, queryParams, }) {
return (
<Text>
<Text newLines={2}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
import { File } from '@asyncapi/generator-react-sdk';
import { getClientName, getServerUrl, getServer, getQueryParams, getInfo, getTitle } from '@asyncapi/generator-helpers';
import { getClientName, getServerUrl, getServer, getQueryParams } from '@asyncapi/generator-helpers';
import { FileHeaderInfo } from '../components/FileHeaderInfo';
import { Requires } from '../components/Requires';
import { getInfo } from './getInfo';
import { getTitle } from './getTitle';
import { ClientClass } from '../components/ClientClass';

export default function ({ asyncapi, params }) {
const server = getServer(asyncapi.servers(), params.server);
const info = getInfo(asyncapi);
const title = getTitle(asyncapi);
const queryParams = getQueryParams(asyncapi.channels());
const clientName = getClientName(asyncapi, params.appendClientSuffix, params.customClientName);
const clientName = getClientName(info, params.appendClientSuffix, params.customClientName);
const serverUrl = getServerUrl(server);
const operations = asyncapi.operations();

return (
// The clientFileName default values can be found and modified under the package.json
<File name={params.clientFileName}>
<FileHeaderInfo
info={info}
server={server}
/>
<Requires query={queryParams} />
<ClientClass clientName={clientName} serverUrl={serverUrl} title={title} queryParams={queryParams} operations={operations} />
<ClientClass clientName={clientName} serverUrl={serverUrl} title={title} queryParams={queryParams} />
</File>
);
}
Loading