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

Reference FES Contributor Docs inside FES Directory along with a diagram to understand usages of FES functions #6335

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added contributor_docs/images/FES.jpg
Copy link
Contributor

Choose a reason for hiding this comment

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

@Ayush23Dash i hope i'm not getting too nit-picky, but the text appears v small && hard to read on my end, i wonder if there's a way to zoom in a bit or maybe bring the boxes closer together (there seems to be a lot of negative space at the moment). i realize contributors could always click on the image to open it in a new tab && then zoom in, but as a quick reference it would be best to make this legible within the README on first glance. what do u think @almchung maybe it's just my screen, how does it look on urs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review @nbriz!! I think it definitely makes sense to make it readable at the first glance! I will try to look out for a way to make it zoomed in and more readable!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @nbriz , I have updated the flowchart with the following changes :

  • Reduced spacing between boxes
  • The long column of files in the first box(validate_params.js) is reduced to two columns for easier readability!

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
This folder contains the core functionality of Friendly Error Systems. [Here is a diagram](
https://sketchboard.me/NDYnl9RGJdU) that outlines how the FES Functions are being used in various files throughout p5.js repository and also specifies the files in which the code for these FES functions sits in.

![class diagram, interactive version viewable in above link](../../../contributor_docs/images/FES.jpg)


# FES Reference and Notes from Developers
This document contains reference and development notes for the p5.js Friendly Error System (FES). The FES houses several functions responsible for generating friendly error messages for different types of errors. These functions gather errors from various locations, including error events triggered by the browser, mistakes found while scanning the user code, parameter checking within the library, etc.
The following information contains reference and development notes for the p5.js Friendly Error System (FES). The FES houses several functions responsible for generating friendly error messages for different types of errors. These functions gather errors from various locations, including error events triggered by the browser, mistakes found while scanning the user code, parameter checking within the library, etc.

Main functions for generating the friendly error messages are:
* `_validateParameters()`
Expand All @@ -8,7 +14,7 @@ Main functions for generating the friendly error messages are:
* `helpForMisusedAtTopLevelCode()`
* `_fesErrorMontitor()`

These functions are located throughout the `core/friendly_errors/` folder.
These functions are located throughout this folder.
* `fes_core.js` contains the core as well as miscellaneous functionality of the FES.
* `_validateParameters()` is located in `validate_params.js` along with other code used for parameter validation.
* `_friendlyFileLoadError()` is located in `file_errors.js` along with other code used for dealing with file load errors.
Expand Down Expand Up @@ -137,7 +143,7 @@ FES will generate the following message in the console:


##### Location
core/friendly_errors/file_errors.js
/friendly_errors/file_errors.js

### `validateParameters()`
##### Description
Expand Down Expand Up @@ -345,7 +351,7 @@ FES will generate the following message in the console:


##### Location
core/friendly_errors/sketch_reader.js
/friendly_errors/sketch_reader.js

### `checkForUserDefinedFunctions()`
##### Description
Expand All @@ -372,7 +378,7 @@ FES will generate the following message in the console:
> 🌸 p5.js says: It seems that you may have accidentally written preLoad instead of preload. Please correct it if it's not intentional. (http://p5js.org/reference/#/p5/preload)

##### Location
core/friendly_errors/fes_core.js
/friendly_errors/fes_core.js

### `_friendlyAutoplayError()`
##### Description
Expand All @@ -394,7 +400,7 @@ Generates and prints a friendly error message using key: `fes.misusedTopLevel`.
@param {Boolean} log false
```
##### Location
core/friendly_errors/fes_core.js
/friendly_errors/fes_core.js

## Development Notes: Notes from Developers
#### Misc. FES Functions that Generates Friendly Errors
Expand Down Expand Up @@ -483,4 +489,4 @@ const original_functions = {
```
* Generate the FES reference from the inline doc. This generated reference can be a separate system from our main [p5.js reference], to keep functions for sketch and console separate to reduce possible confusion.

[p5.js reference]: https://p5js.org/reference/
[p5.js reference]: https://p5js.org/reference/
Loading