Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into validate-syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
bomsy authored Sep 26, 2017
2 parents 72a9691 + 2688fff commit 153be7e
Show file tree
Hide file tree
Showing 26 changed files with 555 additions and 251 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Ofcourse, feel free to ask questions in [slack][slack] or share talk slides or v

Our primary goal is to help developers understand they have the skills
to improve their environment. Writing about DevTools is the best way
to dispell the myth that what we do is magic.
to dispel the myth that what we do is magic.

Writing is a great way to share what you learn and articulate your passion.
Blog posts can either be technical "how x works" or narrative "how we built x".
Expand Down
22 changes: 22 additions & 0 deletions assets/dictionary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
sexualized
dispel
lifecycle
Yulia
intermittents
discoverable.
blackboxed
fixup
scrollbars
li
errored
Yura
extns
travis
mc
mochii
asm
q4
featureFlag
displayNames
componentDidMount
.png
2 changes: 1 addition & 1 deletion docs/debugger-html-react-redux-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ currently selected in the Debugger.html UI.
* The loadedObjects object
stores the currently selected and expanded variable in the scopes pane.
\*\*The expessions object stores all of the current watch expressions,
\*\*The expressions object stores all of the current watch expressions,
which is not implemented in the UI yet.
The pause reducer handles the following action types:
Expand Down
2 changes: 1 addition & 1 deletion docs/issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ a triaged issue is:
* in line with the goals of the debugger
* a single bigger issue that is still manageable
*or* a set of smaller issues around a shippable goal (for example, transition the code base to JSX from `dom.div` syntax)
* labelled (see [Labels](#labels) for more info)
* labeled (see [Labels](#labels) for more info)
* ready to be worked on,
*or* has a request for more information
*or* has a clear next step
Expand Down
97 changes: 41 additions & 56 deletions docs/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ The `ExpressionState` documents the reducers fields. We use it in three places:

We try to wrap our state in Immutable records when we can for two reasons.
First it means that the state can only be modified in the reducers.
Second, it helps our connected components avoid unecessary renders.
Second, it helps our connected components avoid unnecessary renders.

Connect will trigger a re-render when it sees new state, even if it has not changed.
Immutable, will creates new objects if and only if the data changes,
Expand Down Expand Up @@ -429,7 +429,7 @@ yarn run test-all
* [matchers][jest-matchers]
* [mock functions][jest-mock]

Running all the tests tends to be really slow. Most of the time it is realy useful to run a single test. You can do this by invoking jest directly like this:
Running all the tests tends to be really slow. Most of the time it is really useful to run a single test. You can do this by invoking jest directly like this:

```bash
node_modules/jest/bin/jest.js -o
Expand Down Expand Up @@ -575,7 +575,7 @@ You can check the background / text color contrast ratio with this [tool][contra
### Configs
The Debugger uses configs for settings like `theme`, `hotReloading`, and feature flags.
The Debugger uses configs for settings like `theme`, `hotReloading`
The default development configs are in [development-json]. It's easy to change a setting in the Launchpad's settings tab or by updating your `configs/local.json` file.
Expand Down Expand Up @@ -634,70 +634,55 @@ When you're starting a new feature, it's always good to ask yourself if the feat

It's easy to add a new feature flag to the project.
1. add the flag to `development.json` and `firefox-panel.json`
1. add the flag to `assets/panel/prefs.js` and `utils/prefs.js`
2. add `isEnabled` calls in the code
Here's an example of adding a new feature "awesome sauce" to the Debugger:

```diff
diff --git a/configs/development.json b/configs/development.json
index c82b299..d9de5f3 100755
--- a/configs/development.json
+++ b/configs/development.json
@@ -14,7 +14,8 @@
"eventListeners": {
"label": "Event Listeners",
"enabled": false
},
"codeCoverage": {
"label": "Code Coverage",
"enabled": false
- }
+ },
+ "awesomeSauce": {
+ "label": "Awesome Sauce",
+ "enabled": false
+ }
},
"chrome": {
"debug": true,
diff --git a/configs/firefox-panel.json b/configs/firefox-panel.json
index c91b562..bf485bb 100644
--- a/configs/firefox-panel.json
+++ b/configs/firefox-panel.json
@@ -10,6 +10,7 @@
"eventListeners": {
"label": "Event Listeners",
"enabled": false
},
"codeCoverage": {
"label": "Code Coverage",
"enabled": false
- }
+ },
+ "awesomeSauce": {
+ "label": "Awesome Sauce",
+ "enabled": false
+ }
}
}
diff --git a/assets/panel/prefs.js b/assets/panel/prefs.js
index 1cfe2da..7e3068f 100644
--- a/assets/panel/prefs.js
+++ b/assets/panel/prefs.js
@@ -44,3 +44,4 @@ pref("devtools.debugger.file-search-regex-match", false);
pref("devtools.debugger.features.async-stepping", true);
pref("devtools.debugger.features.project-text-search", true);
pref("devtools.debugger.features.wasm", true);
+pref("devtools.debugger.features.awesome", false);
diff --git a/src/components/Editor/index.js b/src/components/Editor/index.js
index 038fd01..ea7a545 100644
index 47714d3..540c98d 100644
--- a/src/components/Editor/index.js
+++ b/src/components/Editor/index.js
@@ -114,6 +114,10 @@ const Editor = React.createClass({
return;
}
+ if (isEnabled("awesomeSauce")) {
+ // sauce goops out of the breakpoint...
+ }
@@ -152,7 +152,7 @@ class Editor extends PureComponent {
codeMirror.on("gutterContextMenu", (cm, line, eventName, event) =>
this.onGutterContextMenu(event)
);
-
+
```
codeMirror.on("contextmenu", (cm, event) => this.openMenu(event, cm));
} else {
codeMirrorWrapper.addEventListener("contextmenu", event =>
diff --git a/src/utils/prefs.js b/src/utils/prefs.js
index 429d56c..dadb36c 100644
--- a/src/utils/prefs.js
+++ b/src/utils/prefs.js
@@ -28,6 +28,7 @@ if (isDevelopment()) {
pref("devtools.debugger.features.async-stepping", true);
pref("devtools.debugger.features.wasm", true);
pref("devtools.debugger.features.shortcuts", true);
+ pref("devtools.debugger.features.awesome", true);
}
export const prefs = new PrefsHelper("devtools", {
@@ -54,6 +55,7 @@ export const features = new PrefsHelper("devtools.debugger.features", {
projectTextSearch: ["Bool", "project-text-search", true],
wasm: ["Bool", "wasm", true],
shortcuts: ["Bool", "shortcuts", false]
+ awesome: ["Bool", "shortcuts", false]
});
* Restart your development server by typing <kbd>ctrl</kbd>+<kbd>c</kbd> in the Terminal and run `yarn start` again
if (prefs.debuggerPrefsSchemaVersion !== prefsSchemaVersion) {
```
### Hot Reloading :fire:
Expand Down
2 changes: 1 addition & 1 deletion docs/mochitests.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ There are several easy traps that result in intermittents:

* **browser inconsistencies** sometimes the server is not as consistent as you would like. For instance, reloading can sometimes cause sources to load out of order. Also stepping too quickly can cause the debugger to enter a bad state. A memorable example of this type of inconsistency came when debugging stepping behavior. It turns out that 1% of the time the browser toolbox will step into an [unexpected location][server-oops]. The solution is too loosen our expections :)
* **missed actions** sometimes action "B" can fire before action "A" is done. This is a race condition that can be hard to track down. When you suspect this might happen, it is a good practice to start listening for "B" before you fire action "A". Here's an example where this happened with [reloading][waiting].
* **state changes** One common way tests start failing occurs when the redux actions introduces a new asynchronous operation. A good way to safe guard your tests is to wait on state to have certain values. An example, of a test that we recently fixed was [pretty printing][pretty-printing]. The test initially waited for the "select source" action to fire, which was occassionaly racey. Switching the test to wait for the formatted source to exist simplified the test tremendously.
* **state changes** One common way tests start failing occurs when the redux actions introduces a new asynchronous operation. A good way to safe guard your tests is to wait on state to have certain values. An example, of a test that we recently fixed was [pretty printing][pretty-printing]. The test initially waited for the "select source" action to fire, which was occasionally racey. Switching the test to wait for the formatted source to exist simplified the test tremendously.

### Appendix

Expand Down
2 changes: 1 addition & 1 deletion docs/updates/5-1-2017-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if user input like a "click" will fire the appropriate handler.

Jest's default react shallow renderer with enzyme works well for us because it
limits the scope of the test and lets us focus on the component under testing and
not necessarily the childen. We also test wrapped components to avoid the connected function and passing in the full application state.
not necessarily the children. We also test wrapped components to avoid the connected function and passing in the full application state.

With that said, a typical component test will still exercise several the utilities
and other imported dependencies. We just started writing component tests and our 6 tests
Expand Down
2 changes: 1 addition & 1 deletion docs/updates/call-stack-4-10-2017.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ We're going to experiment with collapsing library frames by default. This will s
One of the benefits of collapsing the library frames is that it gives an opportunity to
describe what the library is doing. For example, instead of showing two frames for jQuery \[`elemData.handle`, `event.dispatch`], we can simply show `event`.

Describing the libary functions will help make it clear when a framework is rendering, routing, or doing any other task.
Describing the library functions will help make it clear when a framework is rendering, routing, or doing any other task.

![naming]

Expand Down
2 changes: 1 addition & 1 deletion docs/updates/updates-2-28-2017.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ We fixed UI bugs ranging from themes, to accessibility, to RTL. It was an unbeli

#### Bug Fixes

Thanks [@juliandescottes], [@bomsy], [@irfanhudda] for coming in and fixing some pretty embarressing bugs!
Thanks [@juliandescottes], [@bomsy], [@irfanhudda] for coming in and fixing some pretty embarrassing bugs!

* [Fix source navigation, when switching from vertical to horizontal layouunlink][pr-32] - [@juliandescottes]
* [Fix watch expression editing][pr-28] - [@bomsy]
Expand Down
2 changes: 1 addition & 1 deletion docs/updates/updates-3-14-2017.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ to function search. We also did a lot of UI and UX polish!

#### Preview

Preview is the other major feature that received a lot of love. We made progres on previewing member expressions, which in practice is every object property like `obj.foo.bar.bazz`. We also, landed support for preview `this`, which is a special property.
Preview is the other major feature that received a lot of love. We made progression previewing member expressions, which in practice is every object property like `obj.foo.bar.bazz`. We also, landed support for preview `this`, which is a special property.

* [Begin member expressions][pr-9] - [@bomsy]
* [show `this` when it’s in scope][pr-18] - [@jcreighton]
Expand Down
2 changes: 1 addition & 1 deletion docs/updates/updates-3-21-2017.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Thanks everyone for a great week!

* [Persist expressions][pr-18] - [@bomsy]
* [Show message when there are no sources for a page (no files to debug)][pr-3] - [@ktamir]
* [remove flash of 'not avaliable'][pr-4] - [@bomsy]
* [remove flash of 'not available'][pr-4] - [@bomsy]
* [Show hostname first (#1374)][pr-5] - [@Dalimil]
* [Move search state to redux][pr-6] - [@wldcordeiro]
* [Overlap breakpoints list scrollbar (#1997) #goodnessSquad][pr-8] - [@noamshemesh]
Expand Down
2 changes: 1 addition & 1 deletion docs/updates/updates-3-7-2017.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Function search took a big jump this week. It now supports searching for ES6 sho

#### Bugs

We're continuing to fix the embarressing bugs. This pause on exception bug was a long standing bug where the pause button would stay highlighted when the debugger opened even if the debugger was not going to pause on exceptions.
We're continuing to fix the embarrassing bugs. This pause on exception bug was a long standing bug where the pause button would stay highlighted when the debugger opened even if the debugger was not going to pause on exceptions.

* [Persist Pause On Exceptions][pr-0] - [@jasonLaster]

Expand Down
2 changes: 1 addition & 1 deletion docs/updates/updates-4-18-2017.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
### April 18th

* We shared our [plans][post] for an improved call stack and landed key features like collapsing framework frames, highlighting libraries, and describing framework names. [1][pr-24], [2][pr-12] Big thanks to [@jbhoosreddy]!
* [@samjwalker] fixed an embarressing Editor layout issue which caused the debugger to have gaps in the UI!
* [@samjwalker] fixed an embarrassing Editor layout issue which caused the debugger to have gaps in the UI!
* Have you ever hunted through the window object to find a global variable? [@bomsy] made previewing Window objects a joy, by highlighting application globals and hiding native properties! [1][pr-1]
* We emphasized testing last week and dramatically improved our integration tests and added our first Jest component tests. Thanks [@AnshulMalik] for adding our first component unit test!

Expand Down
2 changes: 1 addition & 1 deletion docs/updates/updates-5-9-2017.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ our inline JS. Ryan wrote a great library for extracting the JS from our html fi

#### Framework frames

![fframes](https://camo.githubusercontent.com/00eeea03c674a65e9e55b11f9e6a15a8fbf1bef2/687474703a2f2f672e7265636f726469742e636f2f767662786457515130422e676966)
![frames](https://camo.githubusercontent.com/00eeea03c674a65e9e55b11f9e6a15a8fbf1bef2/687474703a2f2f672e7265636f726469742e636f2f767662786457515130422e676966)

#### Tab UI polish

Expand Down
4 changes: 2 additions & 2 deletions docs/updates/updates-6-13-2017.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ to have an Atom style modal for symbol searches.
Some polishing on the editor and function preview

* [fix object property styling on window property names (#2946)][pr-4] - [@jbhoosreddy]
* [Fix 3146 - editor occassionaly doesn't jump to a line][pr-28] - [@jasonLaster]
* [Fix 3146 - editor occasionally doesn't jump to a line][pr-28] - [@jasonLaster]
* [fix null][pr-1] - [@jasonLaster]

#### Releases
Expand All @@ -49,7 +49,7 @@ We released a new version of the debugger this week to nightly
#### Breakpoints

There were a few open issues with breakpoints from last week, including sliding breakpoints on the
refresh of the debuggy, and problems with the column breakpoint. Those have been resolved
refresh of the debuggee, and problems with the column breakpoint. Those have been resolved

* [Polish conditional breakpoint][pr-0] - [@zaggy]
* [Revert breakpoint clearing][pr-14] - [@jasonLaster]
Expand Down
2 changes: 1 addition & 1 deletion docs/updates/updates-7-25-2017.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

* [Align 'this page has no sources' message][pr-10] - [@belen-albeza]
* [Show a horizontal scrollbar in the right panel][pr-11] - [@jasonLaster]
* [Improve soure tree line height][pr-8], [2][pr-21], [3][pr-34] - [@bomsy]
* [Improve source tree line height][pr-8], [2][pr-21], [3][pr-34] - [@bomsy]
* [Vuejs callstack][pr-28] - [@clarkbw]

#### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion docs/updates/updates-8-15-2017.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Call Stack collapsing is coming together really nicely.
* [Master next][pr-2] - [@jasonLaster]
* [updates 8-1][pr-3] - [@jasonLaster]
* [readme clarification][pr-4] - [@Anzumana]
* [Removed two unsused strings from debugger.properties][pr-5] - [@Ronsho]
* [Removed two unused strings from debugger.properties][pr-5] - [@Ronsho]
* [Bump Yarn][pr-16] - [@jasonLaster]
* [add 8-1 updates to the readme][pr-21] - [@jasonLaster]
* [handle promise rejection][pr-38] - [@zaggy]
Expand Down
6 changes: 3 additions & 3 deletions docs/updates/updates-9-26-2017.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ We're partnering with 5 college students this semester. The program kicked off t
#### UX/UI

* [Show full editor context menu for blackboxed tab][pr-1] - [@darkwing]
* [Fix preview for falsy values][pr-17] - [@nyrosmith]
* [Fix preview for falsey values][pr-17] - [@nyrosmith]
* [Show parameter signature within outline][pr-5] - [@darkwing]
* [Display info when there are no functions to show in Outline][pr-26] - [@nyrosmith]
* [change cursor][pr-30] - [@oferpa]
Expand Down Expand Up @@ -201,10 +201,10 @@ We're spending some time ironing out the rough edges of saved breakpoints. There

#### Code Health

* [remove unecessary css][pr-23] - [@jasonLaster]
* [remove unnecessary css][pr-23] - [@jasonLaster]
* [Remove unused CSS rules in Expressions.css][pr-13] - [@gabrielluong]
* [Replaced use of defer with new Promise, see https://bugzilla.mozilla.…][pr-15] - [@Marcool04]
* [[WIP] convert from featureFlag to prefs system][pr-20] - [@nyrosmith]
* [[WIP] convert from feature flag to prefs system][pr-20] - [@nyrosmith]
* [Refactor match rendering][pr-6] - [@bomsy]
* [Add missing semicolon in prefs.js][pr-25] - [@darkwing]
* [prettier fixes][pr-34] - [@jasonLaster]
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
"lint": "run-p lint-css lint-js lint-md",
"lint-css": "stylelint \"src/components/**/*.css\"",
"lint-js": "eslint *.js \"src/**/*.js\" --fix",
"lint-md": "remark -qf *.md src configs docs",
"lint-md": "remark -u devtools-linters/markdown/preset -qf *.md src configs docs",
"lint-fix": "yarn lint-js -- --fix",
"mochi":
"mochii --mc ./firefox --default-test-path devtools/client/debugger/new",
"mochid": "yarn mochi -- --jsdebugger",
"mochir": "yarn mochi -- --repeat 10",
"mochih": "yarn mochi -- --setenv MOZ_HEADLESS=1",
"mochid": "yarn mochi -- --jsdebugger --",
"mochir": "yarn mochi -- --repeat 10 --",
"mochih": "yarn mochi -- --setenv MOZ_HEADLESS=1 --",
"test": "jest",
"test:watch": "jest --watch",
"test-coverage": "yarn test -- --coverage",
Expand Down Expand Up @@ -70,6 +70,7 @@
"codemirror": "^5.28.0",
"devtools-components": "^0.0.2",
"devtools-launchpad": "^0.0.98",
"devtools-linters": "^0.0.3",
"devtools-reps": "^0.12.3",
"devtools-source-editor": "0.0.6",
"devtools-source-map": "^0.13.0",
Expand Down Expand Up @@ -123,7 +124,7 @@
"jest-serializer-babel-ast": "^0.0.5",
"lint-staged": "^4.0.1",
"mocha": "^3.1.2",
"mochii": "^0.0.5",
"mochii": "^0.0.7",
"mock-require": "^2.0.2",
"node-emoji": "^1.8.1",
"npm-run-all": "^4.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ export function toggleBlackBox(source: Source) {
}

/**
Load the text for all the avaliable sources
Load the text for all the available sources
* @memberof actions/sources
* @static
*/
Expand Down
Loading

0 comments on commit 153be7e

Please sign in to comment.