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

added props and events aligned with latest electron version 1.4.8 #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

psulek
Copy link

@psulek psulek commented Jan 23, 2017

  • added/updated props
  • added/updated events

to align against latest typescript definitions of electron version to v1.4.8 (from @types/electron)

@psulek
Copy link
Author

psulek commented Jan 23, 2017

Hi @keokilee can you look at my PR and possible merge it ?

Copy link
Owner

@keokilee keokilee left a comment

Choose a reason for hiding this comment

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

First, many thanks for the PR! Just the two small comments. For autosize, I think it should just be a boolean but let me know if that doesn't work.

@@ -28,21 +32,32 @@ export interface WebViewProps extends React.HTMLAttributes<Electron.WebViewEleme
onDidGetResponseDetails?: EventListener
onDidGetRedirectRequest?: EventListener
onDomReady?: EventListener
onPageTitleSet?: EventListener
onPageTitleUpdated?: EventListener
Copy link
Owner

Choose a reason for hiding this comment

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

Do you know when this was changed? I'm thinking we leave them both in for compatibility, but with a comment to remove it later.

Copy link
Author

Choose a reason for hiding this comment

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

They changed this in latest electron api.

Copy link
Owner

Choose a reason for hiding this comment

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

Okay, then we should leave them both in for compatibility. I don't think it's worth bumping up our Electron peer dependency just for this.


autosize?: boolean

autosize?: string;
Copy link
Owner

Choose a reason for hiding this comment

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

Does this need to be a string? Seems like it is in the Electron docs but I'm pretty sure just the presence of this attribute will trigger it.

Copy link
Author

Choose a reason for hiding this comment

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

On official docs, it says: setting 'on' to enable.

Copy link
Owner

Choose a reason for hiding this comment

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

Yeah, but it says that for all of the boolean attributes like nodeintegration and plugins, so I'm fairly certain it behaves like a boolean where the actual value doesn't matter. It just matters if the attribute is there or not.

Copy link
Author

Choose a reason for hiding this comment

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

Seems legit

@@ -12,18 +12,29 @@ const EVENTS = [
'did-get-response-details',
'did-get-redirect-request',
'dom-ready',
'page-title-set',
'page-title-updated',
Copy link
Owner

Choose a reason for hiding this comment

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

Same as above. I'm leaning towards keeping both.

@@ -76,7 +87,7 @@ export default class WebView extends React.Component {
}

const tagPropTypes = {
autosize: React.PropTypes.bool,
autosize: React.PropTypes.string,
Copy link
Owner

Choose a reason for hiding this comment

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

Same as above. Should probably test that this can be a boolean and not be a string. Although if it's too confusing, I'm okay with it being a union type.

@psulek
Copy link
Author

psulek commented Jan 24, 2017

@keokilee: I found now that reactjs rejecting those props as not supported :-( Dont know how to tell reactjs to accept those props.

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.

None yet

2 participants