Skip to content

Commit 5a3eca0

Browse files
Merge branch 'develop' into fix-404-page-style
2 parents 5bed519 + b332a99 commit 5a3eca0

File tree

115 files changed

+10822
-5346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+10822
-5346
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
"import/no-extraneous-dependencies": "off",
136136
"no-unused-vars": "off",
137137
"import/no-default-export": "warn",
138-
"no-underscore-dangle": "warn",
138+
"no-underscore-dangle": "off",
139139
"react/require-default-props": "off",
140140
"no-shadow": "off",
141141
"@typescript-eslint/no-shadow": "error"

.github/workflows/test.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ jobs:
77
name: Test and lint code base
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
11-
- name: Use Node.js
12-
uses: actions/setup-node@v1
13-
with:
14-
node-version: '18.20.x'
15-
- run: npm install
16-
- run: npm run test
17-
- run: npm run lint
18-
19-
10+
- uses: actions/checkout@v2
11+
- name: Use Node.js
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: '18.20.x'
15+
- run: npm install
16+
- run: npm run test
17+
- run: npm run typecheck
18+
- run: npm run lint

.storybook/preview.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import React from 'react';
22
import { Provider } from 'react-redux';
33
import { MemoryRouter } from 'react-router';
44

5-
import configureStore from '../client/store';
5+
import { setupStore } from '../client/store';
66
import '../client/i18n-test';
7-
import '../client/styles/storybook.css'
7+
import '../client/styles/storybook.css';
88
import { withThemeProvider, themeToolbarItem } from './decorator-theme';
99

1010
const initialState = window.__INITIAL_STATE__;
1111

12-
const store = configureStore(initialState);
12+
const store = setupStore(initialState);
1313

1414
export const decorators = [
1515
(Story) => (

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/custom.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,18 @@ declare module '*.svg' {
44
const ReactComponent: React.FunctionComponent<
55
React.SVGProps<SVGSVGElement> & { title?: string }
66
>;
7+
// eslint-disable-next-line import/no-default-export
78
export default ReactComponent;
89
}
10+
11+
// Extend window for Redux DevTools
12+
interface Window {
13+
__REDUX_DEVTOOLS_EXTENSION__?: () => any;
14+
}
15+
16+
// Extend NodeModule for hot reloading
17+
interface NodeModule {
18+
hot?: {
19+
accept(path?: string, callback?: () => void): void;
20+
};
21+
}

client/i18n.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function languageKeyToLabel(lang) {
7070
it: 'Italiano',
7171
ja: '日本語',
7272
ko: '한국어',
73-
'pt-BR': 'Português',
73+
'pt-BR': 'Português do Brasil',
7474
sv: 'Svenska',
7575
'uk-UA': 'Українська',
7676
'zh-CN': '简体中文',

client/index.integration.test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import React from 'react';
44
import Routing from './routes';
55

66
import { reduxRender, act, waitFor, screen, within } from './test-utils';
7-
import configureStore from './store';
7+
import { setupStore } from './store';
88
import * as Actions from './modules/User/actions';
99
import { userResponse } from './testData/testServerResponses';
1010

1111
// setup for the app
1212
const initialState = window.__INITIAL_STATE__;
13-
const store = configureStore(initialState);
13+
const store = setupStore(initialState);
1414

1515
// need to mock this file or it'll throw ERRCONNECTED
1616
jest.mock('./i18n');

client/index.jsx

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React, { Suspense } from 'react';
1+
import React, { Suspense, useEffect } from 'react';
22
import { render } from 'react-dom';
3-
import { Provider } from 'react-redux';
3+
import { Provider, useSelector } from 'react-redux';
44
import { Router } from 'react-router-dom';
55

66
import { useTranslation } from 'react-i18next';
77
import browserHistory from './browserHistory';
8-
import configureStore from './store';
8+
import { setupStore } from './store';
99
import Routing from './routes';
1010
import ThemeProvider from './modules/App/components/ThemeProvider';
1111
import Loader from './modules/App/components/loader';
@@ -19,9 +19,14 @@ require('./images/p5js-square-logo.png');
1919

2020
const initialState = window.__INITIAL_STATE__;
2121

22-
const store = configureStore(initialState);
22+
const store = setupStore(initialState);
23+
24+
const DONATE_LOGO_IMAGE_URL = 'https://donorbox.org/images/white_logo.svg';
25+
26+
const showDonateCampaign = false;
2327

2428
if (
29+
showDonateCampaign &&
2530
window.location.href.indexOf('full') === -1 &&
2631
window.location.href.indexOf('embed') === -1
2732
) {
@@ -56,30 +61,30 @@ if (
5661
'background: #f1678e; color: #fff; text-decoration: none; font-family: Verdana, sans-serif; display: flex; gap: 8px; width: fit-content; font-size: 16px; border-radius: 0 0 5px 5px; line-height: 24px; position: fixed; top: 50%; transform-origin: center; z-index: 9999; overflow: hidden; padding: 8px 22px 8px 18px; right: 20px; left: auto; transform: translate(50%, -50%) rotate(90deg)'
5762
);
5863
buttonScript.setAttribute('data-button-cta', 'Donate');
59-
buttonScript.setAttribute(
60-
'data-img-src',
61-
'https://donorbox.org/images/white_logo.svg'
62-
);
64+
buttonScript.setAttribute('data-img-src', DONATE_LOGO_IMAGE_URL);
6365

6466
document.body.appendChild(buttonScript);
6567
}
6668

6769
const App = () => {
6870
const { t } = useTranslation();
71+
const language = useSelector((state) => state.preferences.language);
6972

70-
setTimeout(() => {
71-
const donateButton = document.getElementsByClassName(
72-
'dbox-donation-button'
73-
)[0];
73+
useEffect(() => {
74+
setTimeout(() => {
75+
const donateButton = document.getElementsByClassName(
76+
'dbox-donation-button'
77+
)[0];
7478

75-
if (donateButton) {
76-
const donateLogoImage = document.createElement('img');
77-
donateLogoImage.src = 'https://donorbox.org/images/white_logo.svg';
79+
if (donateButton) {
80+
const donateLogoImage = document.createElement('img');
81+
donateLogoImage.src = DONATE_LOGO_IMAGE_URL;
7882

79-
donateButton.text = t('About.Donate');
80-
donateButton.prepend(donateLogoImage);
81-
}
82-
}, 0);
83+
donateButton.text = t('About.Donate');
84+
donateButton.prepend(donateLogoImage);
85+
}
86+
}, 500);
87+
}, [language]);
8388

8489
return (
8590
<div>
@@ -91,13 +96,19 @@ const App = () => {
9196
);
9297
};
9398

94-
render(
95-
<Provider store={store}>
96-
<ThemeProvider>
97-
<Suspense fallback={<Loader />}>
98-
<App />
99-
</Suspense>
100-
</ThemeProvider>
101-
</Provider>,
102-
document.getElementById('root')
103-
);
99+
// This prevents crashes in test environments (like Jest) where document.getElementById('root') may return null.
100+
const rootEl = document.getElementById('root');
101+
if (rootEl) {
102+
render(
103+
<Provider store={store}>
104+
<ThemeProvider>
105+
<Suspense fallback={<Loader />}>
106+
<App />
107+
</Suspense>
108+
</ThemeProvider>
109+
</Provider>,
110+
rootEl
111+
);
112+
}
113+
114+
export default store;

client/modules/About/pages/About.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const About = () => {
9595
))}
9696

9797
<Contact>
98-
<h2>{t('Contact')}</h2>
98+
<h2>{t('About.Contact')}</h2>
9999
<div>
100100
<ContactTitle>{t('About.Email')}</ContactTitle>
101101
<ContactHandles>

0 commit comments

Comments
 (0)