Skip to content

Feat/plugin builder for rte#150

Closed
Amitkanswal wants to merge 33 commits intodevelopfrom
feat/plugin-builder-for-rte
Closed

Feat/plugin builder for rte#150
Amitkanswal wants to merge 33 commits intodevelopfrom
feat/plugin-builder-for-rte

Conversation

@Amitkanswal
Copy link
Copy Markdown
Contributor

Changes- support for new JSON RTE plugin

@Amitkanswal Amitkanswal requested a review from a team June 25, 2025 07:02
@Amitkanswal Amitkanswal requested a review from a team as a code owner June 25, 2025 07:02
Comment thread src/index.ts Outdated
Comment thread src/index.ts Outdated
@Amitkanswal Amitkanswal requested a review from rijil-tr June 26, 2025 19:15
@Amitkanswal Amitkanswal marked this pull request as draft July 7, 2025 09:02
Comment thread src/index.ts
return {
__isPluginBuilder__: true,
version,
plugins: (context: InitializationData, rte: IRteParam) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why do we need to use the broader type here when we know we are getting RTE specific initialization data?

Comment thread src/rtePlugin.ts
this._config.elementType = elementType;
return this;
}
render(renderFn: (element: React.ReactElement, attrs: { [key: string]: any }, path: number[], rte: IRteParam) => React.ReactElement): PluginBuilder {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Below is the signature of existing render function

 render?: (...params: any) => ReactElement

Why are we introducing additional arguments now? Why these issues not occurring with existing plugins?

Comment thread src/rtePlugin.ts
const plugins = async (context: InitializationData, rte: IRteParam) => {
try {
const sdk = new UiLocation(context);
console.log("sdk", sdk);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove console logs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes

Comment thread src/types.ts
| "GCP_NA"
| string;

export type Extension = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why are we adding this now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I will resolve this

Comment thread src/uiLocation.ts
this.modal = new Modal();

this.region = formatAppRegion(initializationData.region);
this.region = formatAppRegion(initializationData.region as Region);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why are we using Region here? region is of type RegionType right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is the older version PR changes for region is present in develop branch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I will create a new pr and close this one

Comment thread src/utils/utils.ts
}

export function formatAppRegion(region: string): RegionType {
return region ?? Region.UNKNOWN;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why this change is needed?

@Amitkanswal Amitkanswal deleted the branch develop October 29, 2025 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants