Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e899e1c
Add p5js mode PoC into Processing repo
stephanmax Aug 5, 2025
ff472ec
Organize JS scaffolding, add packages via UI
stephanmax Aug 31, 2025
e610a8f
Prepare demo for next cohort check-in
stephanmax Sep 2, 2025
1120122
First naïve try to build a *.pdex file
stephanmax Sep 19, 2025
68e45bd
Prepare *.pdex and make install work
stephanmax Sep 19, 2025
8861392
Create README.md for p5.js mode
stephanmax Sep 19, 2025
8253586
Add keywords for syntax highlighting
stephanmax Sep 24, 2025
42a055a
Add first round of error reporting
stephanmax Sep 24, 2025
5fc5fdb
Automatically install Node via pnpm self-install
stephanmax Sep 25, 2025
d14e5e1
Prepare for next pdex
stephanmax Sep 26, 2025
8bf4eae
Update README.md
stephanmax Sep 26, 2025
d8c6170
Prepare September Beta release
stephanmax Oct 1, 2025
d18852c
Update README.md
stephanmax Oct 1, 2025
a2437d1
Prepare pdex for Windows
stephanmax Oct 2, 2025
d6d506b
Remove Processing issue templates
stephanmax Oct 6, 2025
29e6eb7
Add export functionality
stephanmax Oct 10, 2025
067e8d4
WIP: No ConcurrentModificationExceptions anymore
stephanmax Oct 19, 2025
49bc381
WIP: fix bugs and add TypeScript example
stephanmax Oct 20, 2025
ca7b10e
Fix bugs towards a better editor experience
stephanmax Oct 22, 2025
824fd70
Fix #2: Use CSS over device pixels for window size
stephanmax Oct 22, 2025
c671703
Fix TypeScript example, examples run w/o saving
stephanmax Oct 22, 2025
201e197
Fix BrowserWindow size (use content size)
stephanmax Oct 22, 2025
00ab8c2
Add p5.js example download and update dependencies
Stefterv Dec 18, 2025
5e822b2
Updated p5 version
Stefterv Dec 18, 2025
420310e
fixed examples within More folders
Stefterv Dec 18, 2025
a8fbb00
Refine p5js example import path handling
Stefterv Dec 18, 2025
3513015
Release workflow
Stefterv Dec 18, 2025
5628f57
Release fixes
Stefterv Dec 18, 2025
cbd43c7
Version number input
Stefterv Dec 18, 2025
c9f4a4a
Update release-p5-mode.yml
Stefterv Dec 18, 2025
88f6ebd
Remove pull_request trigger from release workflow
Stefterv Dec 18, 2025
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
83 changes: 0 additions & 83 deletions .github/ISSUE_TEMPLATE/2_enhancement.yml

This file was deleted.

77 changes: 0 additions & 77 deletions .github/ISSUE_TEMPLATE/3_feature-request.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/release-p5-mode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release p5.js Mode
on:
workflow_dispatch:
inputs:
version_number:
description: "What is the revision number?"
required: true
version_pretty:
description: "What is the pretty version name?"
required: true

jobs:
release:
name: Release p5.js Mode
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17.0.8'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build with Gradle
run: ./gradlew createPdex createZip

- name: Set Version Number
run: |
VERSION_NUMBER=${{ github.event.inputs.version_number }}
VERSION_PRETTY=${{ github.event.inputs.version_pretty }}
sed -i "s/^version=.*$/version=$VERSION_NUMBER/" p5js/mode/mode.properties
sed -i "s/^prettyVersion=.*$/prettyVersion=$VERSION_PRETTY/" p5js/mode/mode.properties

- name: Upload to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: p5js/build/p5js.*
tag: p5js-v${{ github.event.inputs.version_number }}
file_glob: true
overwrite: true

- name: Upload Properties to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: p5js/build/mode/mode.properties
asset_name: p5js.txt
tag: p5js-v${{ github.event.inputs.version_number }}
overwrite: true

2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ tasks.register("includeProcessingResources"){
"includeJavaMode",
"includeSharedAssets",
"includeProcessingExamples",
"includeProcessingWebsiteExamples",
// "includeProcessingWebsiteExamples",
"includeJavaModeResources",
"renameWindres"
)
Expand Down
18 changes: 13 additions & 5 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public class Base {

/** Only one built-in Mode these days, removing the extra fluff. */
private Mode coreMode;
private Mode p5jsMode;

// TODO can these be Set objects, or are they expected to be in order?
private List<ModeContribution> contribModes;
Expand Down Expand Up @@ -729,6 +730,7 @@ public void tallyUpdatesAvailable() {
public List<Mode> getModeList() {
List<Mode> outgoing = new ArrayList<>();
outgoing.add(coreMode);
outgoing.add(p5jsMode);
if (contribModes != null) {
for (ModeContribution contrib : contribModes) {
outgoing.add(contrib.getMode());
Expand All @@ -739,19 +741,25 @@ public List<Mode> getModeList() {


void buildCoreModes() {
ModeContribution javaModeContrib =
ModeContribution.load(this, Platform.getContentFile("modes/java"),
getDefaultModeIdentifier());
ModeContribution javaModeContrib = ModeContribution.load(this, Platform.getContentFile("modes/java"), getDefaultModeIdentifier());
ModeContribution p5jsModeContrib = ModeContribution.load(this, Platform.getContentFile("modes/p5js"), "processing.p5js.p5js");
if (javaModeContrib == null) {
Messages.showError("Startup Error",
"Could not load Java Mode, please reinstall Processing.",
new Exception("ModeContribution.load() was null"));
"Could not load Java Mode, please reinstall Processing.",
new Exception("ModeContribution.load() was null"));

} else {
// PDE X calls getModeList() while it's loading, so coreModes must be set
//coreModes = new Mode[] { javaModeContrib.getMode() };
coreMode = javaModeContrib.getMode();
}
if (p5jsModeContrib == null) {
Messages.showError("Startup Error",
"Could not load p5.js Mode, please reinstall Processing.",
new Exception("ModeContribution.load() was null"));
} else {
p5jsMode = p5jsModeContrib.getMode();
}
}


Expand Down
40 changes: 40 additions & 0 deletions p5js/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# p5.js Mode

## Installation

(Tested with Processing 4.4.7 on MacOS Monterey 12.7.6)

Install the mode by double-clicking the released `.pdex` file. After Processing has started up, hit "Yes" on the opening dialog, and let the mode get installed into your Processing sketchbook folder. Currently, you need to restart Processing to have the new p5.js mode show up in the mode dropdown. (This will be looked into for the September release candiate that will be published until September 30 end of day.)

After restarting Processing, choose “p5.js” from the mode dropdown. If `pnpm` is not found on your system, Processing will automatically install it and the LTS Node version. The status bar in the PDE will tell you once it is ready for you to code on your sketch.

## Demo

https://github.com/user-attachments/assets/f934430d-a71c-4995-8e20-92471e400013

## Features

- Auto-install of `pnpm`, Node, and all dependencies for running p5.js code inside the PDE
- Error reporting
- [Syntax highlighting](https://github.com/stephanmax/processing4/wiki/Syntax-Highlighting)
- Installing `npm` dependencies

## Known Issues/ToDos

- Installation
- Prepare and test `.pdex` for Windows
- Editor UI/UX
- Better information in the status bar (`pnpm` version, remove status messages in due time)
- More stability around processes/coroutines (repeatedly pressing Run button should simplu restart the sketch)
- Better/responsive npm (de-)install UI
- Mode options
- Start sketch in correct dimensions
- Update `index.html` if sketch files are changed
- Button to open dev tools in Electron
- Hiding non-sketch files from tabs
- Ignore `node_modules` when saving/exporting
- Error handling
- Run linter for error messaging without having to run the sketch
- Remove error messaging when error is fixed
- Features
- Stand-alone app export
Loading