Skip to content

Commit d596ed6

Browse files
authored
Merge branch 'develop' into pr05_finals_migrateCommonIcons
2 parents 69018f0 + 5ed9b97 commit d596ed6

File tree

31 files changed

+951
-174
lines changed

31 files changed

+951
-174
lines changed

README.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,36 @@ We are a community of, and in solidarity with, people from every gender identity
1010

1111
Learn more about [our community](https://p5js.org/community/) and read our [Community Statement and Code of Conduct](./.github/CODE_OF_CONDUCT.md). You can directly support our work with p5.js by [donating to the Processing Foundation](https://processingfoundation.org/support).
1212

13-
Stay in touch with Processing Foundation across other platforms:
13+
Stay in touch with Processing Foundation across other platforms:
14+
1415
- [Instagram](https://www.instagram.com/p5xjs)
1516
- [Youtube](https://www.youtube.com/@ProcessingFoundation)
1617
- [X](https://x.com/p5xjs)
1718
- [Discord](https://discord.com/invite/esmGA6H6wm)
1819
- [Forum](https://discourse.processing.org)
1920

20-
2121
## Using the p5.js Editor 🤔
2222

23-
Make your first sketch in the [p5.js Editor](https://editor.p5js.org/)! Learn more about sketching with p5.js on the [Get Started](https://p5js.org/tutorials/get-started/) and find everything you can do in the [Reference](https://p5js.org/reference/). You can also look at [examples](https://editor.p5js.org/p5/sketches) and remix them in the p5.js Editor.
23+
Make your first sketch in the [p5.js Editor](https://editor.p5js.org/)! Learn more about sketching with p5.js on the [Get Started](https://p5js.org/tutorials/get-started/) and find everything you can do in the [Reference](https://p5js.org/reference/). You can also look at [examples](https://editor.p5js.org/p5/sketches) and remix them in the p5.js Editor.
2424

25-
For more information on usage guidelines for the p5.js Editor, check out the [p5.js Editor Terms of Use](https://editor.p5js.org/terms-of-use). To gain better insight into how we handle user data and data privacy, refer to the [p5.js Editor Privacy Policy](https://editor.p5js.org/privacy-policy).
25+
For more information on usage guidelines for the p5.js Editor, check out the [p5.js Editor Terms of Use](https://editor.p5js.org/terms-of-use). To gain better insight into how we handle user data and data privacy, refer to the [p5.js Editor Privacy Policy](https://editor.p5js.org/privacy-policy).
2626

2727
## Contributing 📖 🐛 🎨
2828

29-
The p5.js Editor is a collaborative project created by many individuals, mostly volunteers, and you are invited to help. All types of involvement are welcome. To get started with contributing to the p5.js Editor, we recommend exploring the following resources in order:
29+
The p5.js Editor is a collaborative project created by many individuals, mostly volunteers, and you are invited to help. All types of involvement are welcome. To get started with contributing to the p5.js Editor, we recommend exploring the following resources in order:
3030

3131
1. [p5.js Community Statement and Code of Conduct](https://editor.p5js.org/code-of-conduct) - Read our Community Statement and Code of Conduct to understand the values that guide our community and how to participate respectfully and constructively.
3232

3333
2. [Contributor Docs](https://github.com/processing/p5.js-web-editor/blob/develop/contributor_docs/README.md) - For a deeper look at how to get involved with the p5.js Editor, check out our Contributor Docs for more in-depth details about contributing to different areas of the project, including code, bug fixes, documentation, discussion, and more.
3434

3535
3. [All Contributors list on the p5.js repository](https://github.com/processing/p5.js?tab=readme-ov-file#contributors) - Explore the All Contributors list to see the wide range of contributions by our amazing community!
3636

37-
> **TypeScript Migration:**
38-
> As of July 2025, we are working on migrating the repo to TypeScript as part of the **[p5.js Web Editor pr05 Grant](https://github.com/processing/pr05-grant/wiki/2025-pr05-Program-Page)**.
39-
> This migration will occur in two phases:
40-
> 1. **Grant Work (July – October 31, 2025)** – Setting up TypeScript configuration, tooling, and starting partial migration. Contributions will be **closed** during this period.
41-
> 2. **Open Contribution (After October 31, 2025)** – TypeScript migration tasks will **open** to all contributors, with guidelines and tutorials available.
37+
> **TypeScript Migration:** We have initiated migrating the repo to Typescript as part of the **[p5.js Web Editor pr05 Grant](https://github.com/processing/pr05-grant/wiki/2025-pr05-Program-Page)**, and the repo is now open to migration contributions.
4238
>
43-
> For full details, see [TypeScript Migration Plan](./contributor_docs/typescript-migration.md).
39+
> Please see [Typescript Migration](contributor_docs/typescript_migration.md) for migration guidelines. Please see [2025 pr05 Typescript Migration Project](contributor_docs/pr05_2025_typescript_migration/index.md) for details and technical decisions for the migration project.
4440
4541
## Acknowledgements 🙏
4642

47-
Support for this project has come from [Processing Foundation](https://processingfoundation.org/), [NYU ITP](https://tisch.nyu.edu/itp), [CS4All, NYC DOE](http://cs4all.nyc/), [COSA at DU](https://liberalarts.du.edu/emergent-digital-practices/open-source-arts), [STUDIO for Creative Inquiry](https://studioforcreativeinquiry.org/), [Grant for the Web](https://www.grantfortheweb.org/), [New Media Rights](https://www.newmediarights.org/), and many others.
43+
Support for this project has come from [Processing Foundation](https://processingfoundation.org/), [NYU ITP](https://tisch.nyu.edu/itp), [CS4All, NYC DOE](http://cs4all.nyc/), [COSA at DU](https://liberalarts.du.edu/emergent-digital-practices/open-source-arts), [STUDIO for Creative Inquiry](https://studioforcreativeinquiry.org/), [Grant for the Web](https://www.grantfortheweb.org/), [New Media Rights](https://www.newmediarights.org/), and many others.
4844

49-
Hosting and technical support has come from:
50-
<br />
51-
<br />
52-
<a href="https://releasehub.com/" target="_blank"><img width="100" src="https://assets.website-files.com/603dd147c5b0a480611bd348/603dd147c5b0a469bc1bd451_logo--dark.svg" /></a>
53-
<br />
54-
<a href="https://www.browserstack.com/" target="_blank"><img width="100" src="https://user-images.githubusercontent.com/6063380/46976166-ab280a80-d096-11e8-983b-18dd38c8cc9b.png" /></a>
45+
Hosting and technical support has come from: <br /> <br /> <a href="https://releasehub.com/" target="_blank"><img width="100" src="https://assets.website-files.com/603dd147c5b0a480611bd348/603dd147c5b0a469bc1bd451_logo--dark.svg" /></a> <br /> <a href="https://www.browserstack.com/" target="_blank"><img width="100" src="https://user-images.githubusercontent.com/6063380/46976166-ab280a80-d096-11e8-983b-18dd38c8cc9b.png" /></a>

client/index.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ const store = setupStore(initialState);
2323

2424
const DONATE_LOGO_IMAGE_URL = 'https://donorbox.org/images/white_logo.svg';
2525

26+
const showDonateCampaign = false;
27+
2628
if (
29+
showDonateCampaign &&
2730
window.location.href.indexOf('full') === -1 &&
2831
window.location.href.indexOf('embed') === -1
2932
) {
File renamed without changes.

client/modules/About/pages/About.jsx renamed to client/modules/About/pages/About.tsx

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from 'react';
2-
import PropTypes from 'prop-types';
32
import { useSelector } from 'react-redux';
43
import { Helmet } from 'react-helmet';
54
import { useTranslation } from 'react-i18next';
65
import { Link } from 'react-router-dom';
76

7+
import type { TFunction } from 'react-i18next';
88
import {
99
AboutPageContent,
1010
Intro,
@@ -27,8 +27,34 @@ import packageData from '../../../../package.json';
2727
import HeartIcon from '../../../images/heart.svg';
2828
import AsteriskIcon from '../../../images/p5-asterisk.svg';
2929
import LogoIcon from '../../../images/p5js-square-logo.svg';
30+
import { RootState } from '../../../reducers';
3031

31-
const AboutSection = ({ section, t }) => (
32+
export interface AboutSectionInfoItem {
33+
url: string;
34+
title: string;
35+
description: string;
36+
}
37+
export interface AboutSectionInfoSection {
38+
header: string;
39+
items: AboutSectionInfoItem[];
40+
}
41+
export interface ContactSectionLink {
42+
label: string;
43+
href: string;
44+
}
45+
46+
export interface AboutSectionProps {
47+
section: AboutSectionInfoSection;
48+
t: TFunction<'translation'>;
49+
}
50+
51+
const AboutSection = ({
52+
section,
53+
t
54+
}: {
55+
section: AboutSectionInfoSection;
56+
t: TFunction<'translation'>;
57+
}) => (
3258
<Section>
3359
<h2>{t(section.header)}</h2>
3460
<SectionContainer>
@@ -47,11 +73,15 @@ const AboutSection = ({ section, t }) => (
4773
</Section>
4874
);
4975

50-
const About = () => {
76+
export const About = () => {
5177
const { t } = useTranslation();
5278

53-
const p5version = useSelector((state) => {
54-
const index = state.files.find((file) => file.name === 'index.html');
79+
const p5version = useSelector((state: RootState) => {
80+
const index = state.files.find(
81+
(file: {
82+
name: string /** TODO: update once files types are defined in server */;
83+
}) => file.name === 'index.html'
84+
);
5585
return index?.content.match(/\/p5@([\d.]+)\//)?.[1];
5686
});
5787

@@ -91,7 +121,11 @@ const About = () => {
91121
</Intro>
92122

93123
{AboutSectionInfo.map((section) => (
94-
<AboutSection key={t(section.header)} section={section} t={t} />
124+
<AboutSection
125+
key={t(section.header) as string}
126+
section={section}
127+
t={t}
128+
/>
95129
))}
96130

97131
<Contact>
@@ -152,19 +186,3 @@ const About = () => {
152186
</RootPage>
153187
);
154188
};
155-
156-
AboutSection.propTypes = {
157-
section: PropTypes.shape({
158-
header: PropTypes.string.isRequired,
159-
items: PropTypes.arrayOf(
160-
PropTypes.shape({
161-
url: PropTypes.string.isRequired,
162-
title: PropTypes.string.isRequired,
163-
description: PropTypes.string.isRequired
164-
})
165-
).isRequired
166-
}).isRequired,
167-
t: PropTypes.func.isRequired
168-
};
169-
170-
export default About;

client/modules/About/statics/aboutData.js renamed to client/modules/About/statics/aboutData.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
export const ContactSectionLinks = [
1+
import type {
2+
ContactSectionLink,
3+
AboutSectionInfoSection
4+
} from '../pages/About';
5+
6+
export const ContactSectionLinks: ContactSectionLink[] = [
27
{
38
label: 'About.Github',
49
href: 'https://github.com/processing/p5.js-web-editor'
@@ -22,7 +27,7 @@ export const ContactSectionLinks = [
2227
}
2328
];
2429

25-
export const AboutSectionInfo = [
30+
export const AboutSectionInfo: AboutSectionInfoSection[] = [
2631
{
2732
header: 'About.NewP5',
2833
items: [

client/modules/IDE/components/Preferences/index.jsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,8 @@ import {
2121
setLinewrap,
2222
setPreferencesTab
2323
} from '../../actions/preferences';
24-
import {
25-
majorVersion,
26-
p5SoundURL,
27-
p5URL,
28-
useP5Version
29-
} from '../../hooks/useP5Version';
24+
import { majorVersion, p5URL, useP5Version } from '../../hooks/useP5Version';
25+
import p5SoundURL from '../../../../../common/p5URLs';
3026
import VersionPicker from '../VersionPicker';
3127
import { updateFileContent } from '../../actions/files';
3228
import { CmControllerContext } from '../../pages/IDEView';

client/modules/IDE/hooks/useP5Version.jsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,22 @@ import React, { useContext, useMemo } from 'react';
33
import { useSelector } from 'react-redux';
44
import PropTypes from 'prop-types';
55
import { currentP5Version, p5Versions } from '../../../../common/p5Versions';
6+
import {
7+
p5SoundURLOldTemplate,
8+
p5SoundURL,
9+
p5PreloadAddonURL,
10+
p5ShapesAddonURL,
11+
p5DataAddonURL,
12+
p5URLTemplate
13+
} from '../../../../common/p5URLs';
614

715
export const majorVersion = (version) => version.split('.')[0];
816

9-
export const p5SoundURLOldTemplate =
10-
'https://cdnjs.cloudflare.com/ajax/libs/p5.js/$VERSION/addons/p5.sound.min.js';
1117
export const p5SoundURLOld = p5SoundURLOldTemplate.replace(
1218
'$VERSION',
1319
currentP5Version
1420
);
15-
export const p5SoundURL =
16-
'https://cdn.jsdelivr.net/npm/[email protected]/dist/p5.sound.min.js';
17-
export const p5PreloadAddonURL =
18-
'https://cdn.jsdelivr.net/npm/[email protected]/src/preload.js';
19-
export const p5ShapesAddonURL =
20-
'https://cdn.jsdelivr.net/npm/[email protected]/src/shapes.js';
21-
export const p5DataAddonURL =
22-
'https://cdn.jsdelivr.net/npm/[email protected]/src/data.js';
23-
export const p5URL = `https://cdn.jsdelivr.net/npm/p5@${currentP5Version}/lib/p5.js`;
21+
export const p5URL = p5URLTemplate.replace('$VERSION', currentP5Version);
2422

2523
const P5VersionContext = React.createContext({});
2624

client/modules/IDE/reducers/files.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ import {
55
defaultCSS,
66
defaultHTML
77
} from '../../../../server/domain-objects/createDefaultFiles';
8+
import { parseUrlParams } from '../../../utils/parseURLParams';
89

910
export const initialState = () => {
1011
const a = objectID().toHexString();
1112
const b = objectID().toHexString();
1213
const c = objectID().toHexString();
1314
const r = objectID().toHexString();
15+
const params = parseUrlParams(window.location.href);
1416
return [
1517
{
1618
name: 'root',
@@ -32,7 +34,7 @@ export const initialState = () => {
3234
},
3335
{
3436
name: 'index.html',
35-
content: defaultHTML,
37+
content: defaultHTML(params),
3638
id: b,
3739
_id: b,
3840
fileType: 'file',

client/modules/Legal/components/PolicyContainer.jsx renamed to client/modules/Legal/components/PolicyContainer.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import styled from 'styled-components';
33
import ReactMarkdown from 'react-markdown';
44
import remarkSlug from 'remark-slug';
5-
import PropTypes from 'prop-types';
65
import { remSize, prop } from '../../../theme';
76

87
const PolicyContainerMain = styled.main`
@@ -48,16 +47,13 @@ const PolicyContainerMain = styled.main`
4847
}
4948
`;
5049

51-
function PolicyContainer({ policy }) {
50+
export interface PolicyContainerProps {
51+
policy: string;
52+
}
53+
export function PolicyContainer({ policy }: PolicyContainerProps) {
5254
return (
5355
<PolicyContainerMain>
5456
<ReactMarkdown remarkPlugins={[remarkSlug]}>{policy}</ReactMarkdown>
5557
</PolicyContainerMain>
5658
);
5759
}
58-
59-
PolicyContainer.propTypes = {
60-
policy: PropTypes.string.isRequired
61-
};
62-
63-
export default PolicyContainer;
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import React from 'react';
22
import { useTranslation } from 'react-i18next';
3-
import Legal from './Legal';
3+
import { Legal } from './Legal';
44

5-
function CodeOfConduct() {
5+
export function CodeOfConduct() {
66
const { t } = useTranslation();
77

88
return (
99
<Legal policyFile="code-of-conduct.md" title={t('Legal.CodeOfConduct')} />
1010
);
1111
}
12-
13-
export default CodeOfConduct;

0 commit comments

Comments
 (0)