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

Improve low priority warning #9754

Merged
merged 3 commits into from
May 24, 2017

Conversation

flarnie
Copy link
Contributor

@flarnie flarnie commented May 23, 2017

Thanks to @spicyj for suggesting this in code review of #9650

what is the change?:
This change makes 'lowPriorityWarning' an exact copy of 'warning.js' from
https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
where before we had skipped some checks from that module.

  • Adds an error which we catch, in order to let people find the error and resulting stack trace when using devtools with 'pause on caught errors' checked.
  • Adds check that 'format' argument is passed

why make this change?:

  • To maintain a closer fork to 'warning.js'
  • To allow easier debugging using 'pause on caught errors'
  • To validate inputs to 'lowPriorityWarning'

test plan:
yarn test

issue:
#9398

**what is the change?:**
This change makes 'lowPriorityWarning' an exact copy of 'warning.js' from
https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
where before we had skipped some checks from that module.

- Adds an error which we catch, in order to let people find the error and resulting stack trace when using devtools with 'pause on caught errors' checked.
- Adds check that 'format' argument is passed

**why make this change?:**
- To maintain a closer fork to 'warning.js'
- To allow easier debugging using 'pause on caught errors'
- To validate inputs to 'lowPriorityWarning'

**test plan:**
`yarn test`

**issue:**
@flarnie
Copy link
Contributor Author

flarnie commented May 23, 2017

Note to self - this will also need to be cherry-picked onto 15.6-dev.

@flarnie flarnie mentioned this pull request May 23, 2017
49 tasks
flarnie added a commit to flarnie/react that referenced this pull request May 23, 2017
**what is the change?:**
We print the logs from 'lowPriorityWarning' as well as 'warning' from the 'print-warnings' script.

NOTE: This PR is branching off of facebook#9754

**why make this change?:**
We want to use the same process of white/blacklisting warnings with 'lowPriorityWarning' that we do with 'warning'.

**test plan:**
This is not super easy to test unless we are doing a sync with FB afaik. I plan on running a sync in the next few days, or next week at latest, for the sake of not landing big things on a Friday. That will be the actual test of this.

**issue:**
facebook#9398
@flarnie flarnie requested a review from gaearon May 23, 2017 20:45
@flarnie
Copy link
Contributor Author

flarnie commented May 23, 2017

PS to self - rebase #9756 after landing this.

@flarnie flarnie requested review from bvaughn and acdlite May 24, 2017 14:32
@flarnie
Copy link
Contributor Author

flarnie commented May 24, 2017

friendlyping

Copy link
Contributor

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

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

I realize it's probably too late to change this, given all the code that uses fb warning but...this makes me wonder, again, why warning doesn't just use console.warn in the first place.

"size": 496986,
"gzip": 118763
"size": 497667,
"gzip": 118999
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be manually updating bundle sizes like this? I feel like I'm still never sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think every time. This came up in code review before, on #9420 and @trueadm said:

For now, whenever you update something that will be merged into master (it's always good to merge master into your branch and run this after). It gives us all some indications on possible mistakes in terms of bundle size regressions. We'll improve how this works in the coming weeks too.

screen shot 2017-05-24 at 7 52 18 am

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could probably update the 'contributing' docs to mention this if they don't already. I don't think most people are.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or automate it - even better. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like this idea. I think it is asking for troubles when it comes to merge conflicts.

Copy link
Contributor

@trueadm trueadm May 24, 2017

Choose a reason for hiding this comment

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

IMO we should be updating this file for when a PR is ready, as it updates master so it has the latest sizes – which is great for indicating when we've maybe let DEV code slip in unexpectedly.

I'm not sure how we handle the issues with merge conflicts though :/

Copy link
Contributor

@bvaughn bvaughn May 24, 2017

Choose a reason for hiding this comment

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

I just feel like that will cause a lot of problems. We're basically guaranteeing that every merged PR will conflict every other PR, requiring master-merges or rebases, etc. It seems like, in the extreme, we'll have total gridlock. And unless we always rebase and rebuild before merging, we can't trust the file sizes in the results file.

@flarnie flarnie merged commit 6ac91d2 into facebook:master May 24, 2017
flarnie added a commit to flarnie/react that referenced this pull request May 24, 2017
**what is the change?:**
We print the logs from 'lowPriorityWarning' as well as 'warning' from the 'print-warnings' script.

NOTE: This PR is branching off of facebook#9754

**why make this change?:**
We want to use the same process of white/blacklisting warnings with 'lowPriorityWarning' that we do with 'warning'.

**test plan:**
This is not super easy to test unless we are doing a sync with FB afaik. I plan on running a sync in the next few days, or next week at latest, for the sake of not landing big things on a Friday. That will be the actual test of this.

**issue:**
facebook#9398
flarnie added a commit that referenced this pull request May 24, 2017
* Add back caught error and other checks to 'lowPriorityWarning'

**what is the change?:**
This change makes 'lowPriorityWarning' an exact copy of 'warning.js' from
https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
where before we had skipped some checks from that module.

- Adds an error which we catch, in order to let people find the error and resulting stack trace when using devtools with 'pause on caught errors' checked.
- Adds check that 'format' argument is passed

**why make this change?:**
- To maintain a closer fork to 'warning.js'
- To allow easier debugging using 'pause on caught errors'
- To validate inputs to 'lowPriorityWarning'

**test plan:**
`yarn test`
flarnie added a commit that referenced this pull request May 26, 2017
* Add back caught error and other checks to 'lowPriorityWarning'

**what is the change?:**
This change makes 'lowPriorityWarning' an exact copy of 'warning.js' from
https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
where before we had skipped some checks from that module.

- Adds an error which we catch, in order to let people find the error and resulting stack trace when using devtools with 'pause on caught errors' checked.
- Adds check that 'format' argument is passed

**why make this change?:**
- To maintain a closer fork to 'warning.js'
- To allow easier debugging using 'pause on caught errors'
- To validate inputs to 'lowPriorityWarning'

**test plan:**
`yarn test`

**issue:**

* Update 'print-warnings' script to include 'lowPriorityWarning' output

**what is the change?:**
We print the logs from 'lowPriorityWarning' as well as 'warning' from the 'print-warnings' script.

NOTE: This PR is branching off of #9754

**why make this change?:**
We want to use the same process of white/blacklisting warnings with 'lowPriorityWarning' that we do with 'warning'.

**test plan:**
This is not super easy to test unless we are doing a sync with FB afaik. I plan on running a sync in the next few days, or next week at latest, for the sake of not landing big things on a Friday. That will be the actual test of this.

**issue:**
#9398
flarnie added a commit to flarnie/react that referenced this pull request Jun 7, 2017
* Add back caught error and other checks to 'lowPriorityWarning'

**what is the change?:**
This change makes 'lowPriorityWarning' an exact copy of 'warning.js' from
https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
where before we had skipped some checks from that module.

- Adds an error which we catch, in order to let people find the error and resulting stack trace when using devtools with 'pause on caught errors' checked.
- Adds check that 'format' argument is passed

**why make this change?:**
- To maintain a closer fork to 'warning.js'
- To allow easier debugging using 'pause on caught errors'
- To validate inputs to 'lowPriorityWarning'

**test plan:**
`yarn test`
@flarnie flarnie deleted the improveLowPriorityWarning branch May 25, 2018 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants