Skip to content

Use jsdelivr as a CDN to fix broken links #3459

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

Merged
merged 1 commit into from
Apr 18, 2025
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
4 changes: 2 additions & 2 deletions client/modules/IDE/hooks/useP5Version.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const p5Versions = [
'0.2.1'
];

export const currentP5Version = '1.11.3'; // Don't update to 2.x until 2026
export const currentP5Version = '1.11.5'; // Don't update to 2.x until 2026

export const p5SoundURLOld = `https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/addons/p5.sound.min.js`;
export const p5SoundURL =
Expand All @@ -147,7 +147,7 @@ export const p5ShapesAddonURL =
'https://cdn.jsdelivr.net/npm/[email protected]/src/shapes.js';
export const p5DataAddonURL =
'https://cdn.jsdelivr.net/npm/[email protected]/src/data.js';
export const p5URL = `https://cdnjs.cloudflare.com/ajax/libs/p5.js/${currentP5Version}/p5.js`;
export const p5URL = `https://cdn.jsdelivr.net/npm/p5@${currentP5Version}/lib/p5.js`;

const P5VersionContext = React.createContext({});

Expand Down
2 changes: 1 addition & 1 deletion server/domain-objects/createDefaultFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function draw() {
export const defaultHTML = `<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/p5.js"></script>
<script src="https://cdn.jsdelivr.net/npm/p5@1.11.5/lib/p5.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/addons/p5.sound.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<meta charset="utf-8" />
Expand Down