0.36.0 SDK changes #2407

Merged
neb-b merged 2 commits from sdk-changes into master 2019-04-26 23:33:13 +02:00
neb-b commented 2019-04-03 18:02:29 +02:00 (Migrated from github.com)

Notes

  • The actual 0.36.0 changes weren't that bad, a ton of this is finally fixing flow errors in the files that had some.
  • The nsfw/tags still need a lot of work, currently if nsfw is checked on publish, it applies the mature tag.
  • The goal of this was to just get a stable build with 0.36.0
### Notes - The actual 0.36.0 changes weren't that bad, a ton of this is finally fixing flow errors in the files that had some. - The nsfw/tags still need a lot of work, currently if `nsfw` is checked on publish, it applies the `mature` tag. - The goal of this was to just get a stable build with 0.36.0
skhameneh (Migrated from github.com) reviewed 2019-04-03 18:02:29 +02:00
neb-b (Migrated from github.com) reviewed 2019-04-24 15:43:00 +02:00
@ -1,5 +1,3 @@
// @flow
import type { Claim } from 'types/claim';
import React from 'react';
neb-b (Migrated from github.com) commented 2019-04-24 15:43:00 +02:00

I removed flow from this file because there were ~30 type errors. If we have flow in a file, it should cover everything so we don't need to constantly use --no-verify

I removed flow from this file because there were ~30 type errors. If we have flow in a file, it should cover everything so we don't need to constantly use `--no-verify`
kauffj (Migrated from github.com) approved these changes 2019-04-26 23:21:43 +02:00
kauffj (Migrated from github.com) left a comment

Looks pretty good to me

Looks pretty good to me
@ -0,0 +1,52 @@
// @flow
declare type UpdatePublishFormData = {
kauffj (Migrated from github.com) commented 2019-04-26 23:21:25 +02:00

Naming is a little inconsistent between these two types.

Also, you may be able to use Intersection Types to avoid repeating the shared values across both (but I've never used this feature).

Naming is a little inconsistent between these two types. Also, you may be able to use Intersection Types to avoid repeating the shared values across both (but I've never used this feature).
kauffj (Migrated from github.com) commented 2019-04-26 23:06:51 +02:00

null, not undefined, I think

`null`, not `undefined`, I think
@ -34,3 +31,4 @@
costInfo: ?{cost: number},
fetchFileInfo: string => void,
fetchCostInfo: string => void,
setViewed: string => void,
kauffj (Migrated from github.com) commented 2019-04-26 23:11:41 +02:00

It looks like this component both receives the entire Claim and properties of the claim independently. Should it always be one or the other?

It looks like this component both receives the entire `Claim` and properties of the claim independently. Should it always be one or the other?
@ -398,4 +354,3 @@
export function savePosition(claimId: string, outpoint: string, position: number) {
return (dispatch: Dispatch) => {
dispatch({
kauffj (Migrated from github.com) commented 2019-04-26 23:13:04 +02:00

Nice :D

Nice :D
neb-b (Migrated from github.com) reviewed 2019-04-26 23:25:50 +02:00
@ -0,0 +1,52 @@
// @flow
declare type UpdatePublishFormData = {
neb-b (Migrated from github.com) commented 2019-04-26 23:25:50 +02:00

Yeah... the publish types were one of the first added. Now that I have a better idea of flow and have developed some patterns in other parts of the app this can be cleaned up a lot. Planning to clean it up when I add the tags to the publish page

Yeah... the publish types were one of the first added. Now that I have a better idea of flow and have developed some patterns in other parts of the app this can be cleaned up a lot. Planning to clean it up when I add the tags to the publish page
neb-b (Migrated from github.com) reviewed 2019-04-26 23:29:43 +02:00
@ -34,3 +31,4 @@
costInfo: ?{cost: number},
fetchFileInfo: string => void,
fetchCostInfo: string => void,
setViewed: string => void,
neb-b (Migrated from github.com) commented 2019-04-26 23:29:42 +02:00

I think we should start moving to bring in individual properties that components use: see makeSelectTitleForUri, instead of large objects if the component only uses a couple of values.

It's faster for react to update because then it isn't doing tons of un-needed checks to see if an object changed at all.

I think we should start moving to bring in individual properties that components use: see `makeSelectTitleForUri`, instead of large objects if the component only uses a couple of values. It's faster for react to update because then it isn't doing tons of un-needed checks to see if an object changed at all.
neb-b (Migrated from github.com) reviewed 2019-04-26 23:33:02 +02:00
neb-b (Migrated from github.com) commented 2019-04-26 23:33:02 +02:00

Inputs can't use null or react throws errors. Something to do with how javascript handles null
https://github.com/facebook/react/issues/11417

Inputs can't use `null` or react throws errors. Something to do with how javascript handles `null` https://github.com/facebook/react/issues/11417
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#2407
No description provided.