You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,18 +18,18 @@ Your feedback is welcome [on this issue](https://github.com/processing/p5.js/iss
18
18
19
19
Most things are the same between p5.js 1.x and 2.0, but there are some big differences: p5.js 2.0 has new capabilities, and it also no longer supports some aspects of p5.js 1.x.
20
20
21
-
## Do I have to update my 1.x sketches? Maybe!
21
+
## Do I have to update my 1.x sketches?
22
22
23
23
First, you should try to update the version and see if the sketch still runs! In many cases, no actions are needed - just update the version and you’re all set.
24
24
25
25
However, if the sketch doesn’t run anymore using 2.0, then you can either update it to use 2.0, or keep it using 1.x. If any of this sounds applicable, then follow the guide below to update your sketches:
26
26
27
27
* If you want to use p5.js 2.0 features, like variable-weight fonts
28
-
* If you need your sketches to work after August, 2026. At that point, 1.x will no longer be supported, and 2.0 will become the default in the p5.js Editor. If you face any challenges in making updates, please consider joining the discussion and filing bugs to help make p5.js 2.0 a robust tool for the whole community.
28
+
* If you need your sketches to work after August, 2026. At that point, 1.x will no longer be supported, and 2.0 will become the default in the p5.js Editor. If you face any challenges in making updates, please consider [joining the discussion](https://github.com/processing/p5.js/issues/7488) and [filing bugs](https://github.com/processing/p5.js/issues) to help make p5.js 2.0 a robust tool for the whole community.
29
29
* If you want to use an addon or community library that uses p5.js 2.0 featurescal
30
30
* If you want to be able to better integrate with other tools and libraries in the JavaScript ecosystem
31
31
32
-
## How can I update my 1.x sketches? Three steps!
32
+
## How can I update my 1.x sketches?
33
33
34
34
Step 1: Switch to 2.0 by using one of the [beta releases](https://github.com/processing/p5.js/releases/) when you import the core library! An [option to switch to 2.0 will be available in the p.js Editor](https://github.com/processing/p5.js-web-editor/pull/3334) once the new release is live!
35
35
@@ -40,9 +40,9 @@ Step 3: If your 1.x sketch does not run with p5.js 2.0, you have two options:
40
40
* Update your code to match 2.0
41
41
* or (2) Include a compatibility addon (after release, [this will also be possible in the p.js Editor](https://github.com/processing/p5.js-web-editor/pull/3334) once the new release is live.
42
42
43
-
# Changes to make if you are…
43
+
# Changes to make if your sketch includes…
44
44
45
-
## …loading Images, Sound, Fonts, and other Assets
45
+
## …loading images, sound, fonts, and other assets
46
46
47
47
One of the biggest changes in 2.0 is involves how you can include other files, media, and assets. The p5.js 1.x style of using `preload()` does not reflect anymore how assets are loaded on the web, so p5.js 2.0 uses JavaScript’s async/await keywords to support asynchronicity.
48
48
@@ -92,11 +92,11 @@ async function setup() {
92
92
}
93
93
```
94
94
95
-
## …making Shapes
95
+
## …making shapes
96
96
97
97
Short guide coming soon! For now, you can [find out more here](https://github.com/processing/p5.js/issues/6766)
98
98
99
-
## …using non-JS Data Structures
99
+
## …using non-JavaScript data structures and functions
100
100
101
101
One bit change relates to data structures in JavaScript. The following funcitons have been removed in p5.js 2.0. These were originally in p5.js 1.x because, historically, they were also in Processing. However, p5.js is a JavaScript library, and JavaScript objects and key-value maps can be used instead of these functions:
0 commit comments