Skip to content

feat(core): add WindowBuilder type#3598

Merged
lucasfernog merged 4 commits intotauri-apps:devfrom
lucasfernog:feat/window-builder
Mar 5, 2022
Merged

feat(core): add WindowBuilder type#3598
lucasfernog merged 4 commits intotauri-apps:devfrom
lucasfernog:feat/window-builder

Conversation

@lucasfernog
Copy link
Member

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

This is the first step to allow customizing the CSP #3533

@lucasfernog lucasfernog requested review from a team March 3, 2022 00:19
@lucasfernog lucasfernog requested a review from a team as a code owner March 3, 2022 00:19
/// Initializes a webview window builder with the given window label and URL to load on the webview.
///
/// Data URLs are only supported with the `window-data-url` feature flag.
pub fn window_builder<L: Into<String>>(&self, label: L, url: WindowUrl) -> WindowBuilder<R> {
Copy link
Member

Choose a reason for hiding this comment

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

I know we use this exact pattern in other place too, but can we "invert" this interface?
I.e. instead of a method on AppHandle we pass AppHandle to the WindowBuilder::new constructor?
This "inline constructor" feels a bit off to me 🤔

Copy link
Member

Choose a reason for hiding this comment

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

I agree, this is how it is in tao too.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah I like that idea, i'll change that

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can review rest of Tauri and make everything consistent?
Sure that would be a breaking change but a good one maybe 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Well that depends on the size of the refactor/breakingchange and the impact on post v1 work.

@lucasfernog lucasfernog merged commit 141133a into tauri-apps:dev Mar 5, 2022
@lucasfernog lucasfernog deleted the feat/window-builder branch March 5, 2022 00:18
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.

3 participants