Skip to content

Commit

Permalink
Run prettier on the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
julienw committed Sep 1, 2023
1 parent 7d28aee commit 06fe83d
Show file tree
Hide file tree
Showing 121 changed files with 309 additions and 284 deletions.
10 changes: 5 additions & 5 deletions docs-developer/call-tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ One key point of the aggregation done in the call tree is that it's focused on w

Imagine this simplified example of 3 samples of mixed C++, JavaScript Code (js), and JIT optimized JavaScript (JIT). The functions are all labeled as to their implementation.

| Sample index | Sample's stack |
| ------------ | ------------------------------------------------------------------------------------------ |
| 0 | `JS::RunScript [c++] ➡ onLoad [js] ➡ a [js] ➡ b [js]` |
| Sample index | Sample's stack |
| ------------ | ---------------------------------------------------------------------------------------------- |
| 0 | `JS::RunScript [c++] ➡ onLoad [js] ➡ a [js] ➡ b [js]` |
| 1 | `JS::RunScript [c++] ➡ onLoad [js] ➡ js::jit::IonCannon [c++] ➡ a [JIT] ➡ b [JIT]` |
| 2 | `JS::RunScript [c++] ➡ onLoad [js] ➡ js::jit::IonCannon [c++] ➡ a [JIT] ➡ b [JIT]` |

Expand Down Expand Up @@ -113,8 +113,8 @@ Now, taking the stacks and building a call tree produces the following:

This is the correct tree of what you would want to see. But since we are mixing languages together into the same stack system, it might be nice to view only JS functions. In order to do that we hide any C++ stacks, and assign them to the nearest JS stack. Our tables would be updated to look like the following.

| Sample index | Sample's stack |
| ------------ | ------------------------------------- |
| Sample index | Sample's stack |
| ------------ | --------------------------------------- |
| 0 | `onLoad [js] ➡ a [js] ➡ b [js]` |
| 1 | `onLoad [js] ➡ a [JIT] ➡ b [JIT]` |
| 2 | `onLoad [js] ➡ a [JIT] ➡ b [JIT]` |
Expand Down
2 changes: 1 addition & 1 deletion examples/canvas-drawing.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion examples/dom-mutation.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion examples/merge-sort.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
Expand Down
8 changes: 6 additions & 2 deletions res/css/focus.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ input[type='image']:focus-visible,
input[type='range']:focus-visible,
select:focus-visible,
button:focus-visible {
box-shadow: 0 0 0 1px var(--blue-50) inset, 0 0 0 1px var(--blue-50),
box-shadow:
0 0 0 1px var(--blue-50) inset,
0 0 0 1px var(--blue-50),
0 0 0 4px var(--blue-50-a30);
outline: 0;
}

a:focus-visible {
box-shadow: 0 0 0 2px var(--blue-50), 0 0 0 6px var(--blue-50-a30);
box-shadow:
0 0 0 2px var(--blue-50),
0 0 0 6px var(--blue-50-a30);
outline: 0;
}
8 changes: 6 additions & 2 deletions res/css/photon/input.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@
.photon-input:focus-visible,
.photon-input:focus-visible:invalid {
border: 1px solid var(--blue-50);
box-shadow: 0 0 0 1px var(--blue-50), 0 0 0 4px var(--blue-50-a30);
box-shadow:
0 0 0 1px var(--blue-50),
0 0 0 4px var(--blue-50-a30);
outline: 0;
}

.photon-input:invalid:not(:placeholder-shown) {
border: 1px solid var(--red-60);
box-shadow: 0 0 0 1px var(--red-60), 0 0 0 4px var(--red-60-a30);
box-shadow:
0 0 0 1px var(--red-60),
0 0 0 4px var(--red-60-a30);
}
2 changes: 1 addition & 1 deletion res/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion res/photon/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
Expand Down
5 changes: 2 additions & 3 deletions src/actions/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,8 @@ export function attemptToPublish(): ThunkAction<Promise<boolean>> {
dispatch(uploadCompressionStarted(abortfunction));

const sanitizedInformation = getSanitizedProfile(prePublishedState);
const gzipData: Uint8Array = await getSanitizedProfileData(
prePublishedState
);
const gzipData: Uint8Array =
await getSanitizedProfileData(prePublishedState);

// The previous line was async, check to make sure that this request is still valid.
// The upload could have been aborted while we were compressing the data.
Expand Down
10 changes: 4 additions & 6 deletions src/actions/receive-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1022,9 +1022,8 @@ export function retrieveProfileFromBrowser(
);
},
});
const unpackedProfile = await _unpackGeckoProfileFromBrowser(
rawGeckoProfile
);
const unpackedProfile =
await _unpackGeckoProfileFromBrowser(rawGeckoProfile);
const profile = processGeckoProfile(unpackedProfile);
await dispatch(loadProfile(profile, { browserConnection }, initialLoad));
} catch (error) {
Expand Down Expand Up @@ -1337,9 +1336,8 @@ export function retrieveProfileOrZipFromUrl(
switch (response.responseType) {
case 'PROFILE': {
const serializedProfile = response.profile;
const profile = await unserializeProfileOfArbitraryFormat(
serializedProfile
);
const profile =
await unserializeProfileOfArbitraryFormat(serializedProfile);
if (profile === undefined) {
throw new Error('Unable to parse the profile.');
}
Expand Down
7 changes: 3 additions & 4 deletions src/app-logic/uploaded-profiles-db.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export async function persistUploadedProfileInformationToDb(
* This returns the list of all the stored data.
*/
export async function listAllUploadedProfileInformationFromDb(): Promise<
UploadedProfileInformation[]
UploadedProfileInformation[],
> {
const db = await open();
return db.getAllFromIndex(OBJECTSTORE_NAME, 'publishedDate');
Expand Down Expand Up @@ -195,9 +195,8 @@ export async function changeStoredProfileNameInDb(
profileToken: string,
profileName: string
): Promise<void> {
const storedProfile = await retrieveUploadedProfileInformationFromDb(
profileToken
);
const storedProfile =
await retrieveUploadedProfileInformationFromDb(profileToken);
if (storedProfile && storedProfile.name !== profileName) {
// We need to update the name, but also the urlPath. For this we'll convert
// the old one to a state, and convert it back to a url string, so that
Expand Down
6 changes: 3 additions & 3 deletions src/app-logic/url-handling.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@ type BaseQueryShape = $Shape<$ObjMap<BaseQuery, $MakeOptional>>;
// Full profile view and active tab profile view query shapes are for also
// typechecking during the query object initialization.
type FullProfileSpecificBaseQueryShape = $Shape<
$ObjMap<FullProfileSpecificBaseQuery, $MakeOptional>
$ObjMap<FullProfileSpecificBaseQuery, $MakeOptional>,
>;
type ActiveTabProfileSpecificBaseQueryShape = $Shape<
$ObjMap<ActiveTabProfileSpecificBaseQuery, $MakeOptional>
$ObjMap<ActiveTabProfileSpecificBaseQuery, $MakeOptional>,
>;
type OriginsProfileSpecificBaseQueryShape = $Shape<
$ObjMap<OriginsProfileSpecificBaseQuery, $MakeOptional>
$ObjMap<OriginsProfileSpecificBaseQuery, $MakeOptional>,
>;

// Query shapes for individual query paths. These are needed for QueryShape union type.
Expand Down
2 changes: 1 addition & 1 deletion src/app-logic/web-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export async function getSymbolTableViaWebChannel(
}

export async function getProfileViaWebChannel(): Promise<
ArrayBuffer | MixedObject
ArrayBuffer | MixedObject,
> {
return _sendMessageWithResponse({
type: 'GET_PROFILE',
Expand Down
4 changes: 2 additions & 2 deletions src/components/app/AppLocalizationProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ type ProviderDispatchProps = {|
type ProviderProps = ConnectedProps<
ProviderOwnProps,
ProviderStateProps,
ProviderDispatchProps
ProviderDispatchProps,
>;

/**
Expand Down Expand Up @@ -257,7 +257,7 @@ class AppLocalizationProviderImpl extends React.PureComponent<ProviderProps> {
export const AppLocalizationProvider = explicitConnect<
ProviderOwnProps,
ProviderStateProps,
ProviderDispatchProps
ProviderDispatchProps,
>({
mapStateToProps: (state) => ({
localization: getLocalization(state),
Expand Down
2 changes: 1 addition & 1 deletion src/components/app/AppViewRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class AppViewRouterImpl extends PureComponent<AppViewRouterProps> {
export const AppViewRouter = explicitConnect<
{||},
AppViewRouterStateProps,
{||}
{||},
>({
mapStateToProps: (state: State) => ({
view: getView(state),
Expand Down
2 changes: 1 addition & 1 deletion src/components/app/AssemblyCodeFetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class AssemblyCodeFetcherImpl extends React.PureComponent<Props> {
export const AssemblyCodeFetcher = explicitConnect<
{||},
StateProps,
DispatchProps
DispatchProps,
>({
mapStateToProps: (state) => ({
assemblyViewNativeSymbol: getAssemblyViewNativeSymbol(state),
Expand Down
2 changes: 1 addition & 1 deletion src/components/app/AssemblyViewToggleButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class AssemblyViewToggleButtonImpl extends React.PureComponent<Props> {
export const AssemblyViewToggleButton = explicitConnect<
{||},
StateProps,
DispatchProps
DispatchProps,
>({
mapStateToProps: (state) => ({
assemblyViewIsOpen: getAssemblyViewIsOpen(state),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class CurrentProfileUploadedInformationLoaderImpl extends PureComponent<Props> {
export const CurrentProfileUploadedInformationLoader = explicitConnect<
{||},
StateProps,
DispatchProps
DispatchProps,
>({
mapStateToProps: (state) => ({
hash: getHash(state),
Expand Down
2 changes: 1 addition & 1 deletion src/components/app/DetailsContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function DetailsContainerImpl({
export const DetailsContainer = explicitConnect<
{||},
StateProps,
DispatchProps
DispatchProps,
>({
mapStateToProps: (state) => ({
selectedTab: getSelectedTab(state),
Expand Down
4 changes: 2 additions & 2 deletions src/components/app/DragAndDrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ type OverlayDispatchProps = {|
type OverlayProps = ConnectedProps<
OverlayOwnProps,
OverlayStateProps,
OverlayDispatchProps
OverlayDispatchProps,
>;

/**
Expand Down Expand Up @@ -268,7 +268,7 @@ class DragAndDropOverlayImpl extends React.PureComponent<OverlayProps> {
export const DragAndDropOverlay = explicitConnect<
OverlayOwnProps,
OverlayStateProps,
OverlayDispatchProps
OverlayDispatchProps,
>({
mapStateToProps: (state) => ({
isDragging: getIsDragAndDropDragging(state),
Expand Down
7 changes: 5 additions & 2 deletions src/components/app/Home.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
line-height: 1.5;
text-align: center;
text-decoration: none;
transition: background-color 250ms var(--animation-curve),
transition:
background-color 250ms var(--animation-curve),
color 250ms var(--animation-curve);
}

Expand Down Expand Up @@ -179,7 +180,9 @@
.homeTransition-enter.homeTransition-enter-active {
opacity: 1;
transform: translateX(0);
transition: opacity 300ms ease-out, transform 300ms ease-out;
transition:
opacity 300ms ease-out,
transform 300ms ease-out;
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/components/app/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type LoadFromUrlState = {

class ActionButtons extends React.PureComponent<
ActionButtonsProps,
ActionButtonsState
ActionButtonsState,
> {
_fileInput: HTMLInputElement | null;

Expand Down Expand Up @@ -129,7 +129,7 @@ class ActionButtons extends React.PureComponent<

class LoadFromUrl extends React.PureComponent<
LoadFromUrlProps,
LoadFromUrlState
LoadFromUrlState,
> {
state = {
value: '',
Expand Down Expand Up @@ -211,7 +211,7 @@ type DispatchHomeProps = {|
type HomeProps = ConnectedProps<
OwnHomeProps,
StateHomeProps,
DispatchHomeProps
DispatchHomeProps,
>;

type HomeState = {
Expand Down Expand Up @@ -630,7 +630,7 @@ function _isFirefox(): boolean {
export const Home = explicitConnect<
OwnHomeProps,
StateHomeProps,
DispatchHomeProps
DispatchHomeProps,
>({
mapStateToProps: (state) => ({
browserConnection: getBrowserConnection(state),
Expand Down
2 changes: 1 addition & 1 deletion src/components/app/LanguageSwitcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class LanguageSwitcherImpl extends React.PureComponent<Props> {
export const LanguageSwitcher = explicitConnect<
OwnProps,
StateProps,
DispatchProps
DispatchProps,
>({
component: LanguageSwitcherImpl,
mapStateToProps: (state) => ({
Expand Down
2 changes: 1 addition & 1 deletion src/components/app/ListOfPublishedProfiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type PublishedProfileState = {|
*/
class PublishedProfile extends React.PureComponent<
PublishedProfileProps,
PublishedProfileState
PublishedProfileState,
> {
state = {
confirmDialogIsOpen: false,
Expand Down
5 changes: 4 additions & 1 deletion src/components/app/MenuButtons/Publish.css
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@
rgb(255 255 255 / 0.4) 80%,
transparent 80%
);
background-size: 21px 20px, 100% 100%, 100% 100%;
background-size:
21px 20px,
100% 100%,
100% 100%;
}

@keyframes animate-stripes {
Expand Down
6 changes: 3 additions & 3 deletions src/components/app/MenuButtons/Publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ type PublishState = {|

class MenuButtonsPublishImpl extends React.PureComponent<
PublishProps,
PublishState
PublishState,
> {
state = { compressError: null, prevCompressedPromise: null };
_toggles: { [$Keys<CheckedSharingOptions>]: () => mixed } = {
Expand Down Expand Up @@ -390,7 +390,7 @@ class MenuButtonsPublishImpl extends React.PureComponent<
export const MenuButtonsPublish = explicitConnect<
OwnProps,
StateProps,
DispatchProps
DispatchProps,
>({
mapStateToProps: (state) => ({
profile: getProfile(state),
Expand Down Expand Up @@ -434,7 +434,7 @@ type DownloadButtonState = {|
*/
class DownloadButton extends React.PureComponent<
DownloadButtonProps,
DownloadButtonState
DownloadButtonState,
> {
_isMounted: boolean = false;
state = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/app/ProfileFilterNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class ProfileFilterNavigatorBarImpl extends React.PureComponent<Props> {
export const ProfileFilterNavigator = explicitConnect<
{||},
StateProps,
DispatchProps
DispatchProps,
>({
mapStateToProps: (state) => {
const items = getCommittedRangeLabels(state);
Expand Down
Loading

0 comments on commit 06fe83d

Please sign in to comment.