Skip to content

Conversation

@artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Mar 6, 2025

Create API class the same way both in embedded ui and when overriding externally (when UI is used as a package)

CI Results

Test Status: ✅ PASSED

📊 Full Report

Total Passed Failed Flaky Skipped
264 263 0 0 1
Test Changes Summary ⏭️1

⏭️ Skipped Tests (1)

  1. Streaming query shows some results and banner when stop button is clicked (tenant/queryEditor/queryEditor.test.ts)

Bundle Size: ✅

Current: 80.81 MB | Main: 80.81 MB
Diff: 0.32 KB (-0.00%)

✅ Bundle size unchanged.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@artemmufazalov artemmufazalov marked this pull request as ready for review March 6, 2025 12:40
@artemmufazalov artemmufazalov requested a review from sareyu March 6, 2025 12:40
@astandrik
Copy link
Collaborator

astandrik commented Mar 7, 2025

That only for good-looking purposes? Couldnt' really find reasonable matter

Just asking =D
Maybe missing something

@artemmufazalov
Copy link
Member Author

That only for good-looking purposes? Couldnt' really find reasonable matter

Just asking =D Maybe missing something

When I create Api in embedded ui, I use function createApi with some default values. But if I want to extend it, there won't be defaults, and the params will be a little different

createApi

// defaults
const api = createApi()
// with my values
const api = createApi({webVersion: false, withCredentials: false})

Current version with customization:

class MyApi extends YdbEmbeddedAPI {
    customApi: MyCustomApi;

    constructor() {
        super({config: {withCredentials: true}, webVersion: true});

        this.customApi = new MyCustomApi();
    }
}

const api =  new MyApi()

So my goals:

  • only one way to create Api without some proxy function with no clear purpose
  • make params the same, so there will be similar approach both in embedded and in package
  • make defaults the same

@astandrik
Copy link
Collaborator

Thanks for explanation!

@artemmufazalov artemmufazalov added this pull request to the merge queue Mar 7, 2025
Merged via the queue into main with commit b139eb5 Mar 7, 2025
8 checks passed
@artemmufazalov artemmufazalov deleted the update-api branch March 7, 2025 09:03
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.

4 participants