Skip to content

Commit

Permalink
Merge branch 'develop' into update-node-version
Browse files Browse the repository at this point in the history
  • Loading branch information
raclim committed Oct 31, 2024
2 parents 5ace0d4 + e2e62e6 commit 6b4f715
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 32 deletions.
4 changes: 2 additions & 2 deletions client/modules/IDE/components/About.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function About(props) {
</p>
<p className="about__content-column-list">
<a
href="https://p5js.org/learn/"
href="https://p5js.org/tutorials/"
target="_blank"
rel="noopener noreferrer"
>
Expand Down Expand Up @@ -164,7 +164,7 @@ function About(props) {
</p>
<p className="about__content-column-list">
<a
href="https://p5js.org/download/support.html"
href="https://p5js.org/donate/"
target="_blank"
rel="noopener noreferrer"
>
Expand Down
2 changes: 1 addition & 1 deletion client/modules/Preview/previewIndex.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const App = () => {
function addCacheBustingToAssets(files) {
const timestamp = new Date().getTime();
return files.map((file) => {
if (file.url) {
if (file.url && !file.url.endsWith('obj') && !file.url.endsWith('stl')) {
return {
...file,
url: `${file.url}?v=${timestamp}`
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "p5.js-web-editor",
"version": "2.14.7",
"version": "2.15.0",
"description": "The web editor for p5.js.",
"scripts": {
"clean": "rimraf dist",
Expand Down
4 changes: 2 additions & 2 deletions server/domain-objects/createDefaultFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ function draw() {
export const defaultHTML = `<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.10.0/p5.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.10.0/addons/p5.sound.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.0/p5.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.0/addons/p5.sound.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<meta charset="utf-8" />
Expand Down
5 changes: 1 addition & 4 deletions server/migrations/emailConsolidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ const mongoConnectionString = process.env.MONGO_URL;
const { ObjectId } = mongoose.Types;
// Connect to MongoDB
mongoose.Promise = global.Promise;
mongoose.connect(mongoConnectionString, {
useNewUrlParser: true,
useUnifiedTopology: true
});
mongoose.connect(mongoConnectionString);
mongoose.set('strictQuery', true);
mongoose.connection.on('error', () => {
console.error(
Expand Down
2 changes: 0 additions & 2 deletions server/previewServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ const connectToMongoDB = async () => {
mongoose.set('strictQuery', true);

await mongoose.connect(mongoConnectionString, {
useNewUrlParser: true,
useUnifiedTopology: true,
serverSelectionTimeoutMS: 30000, // 30 seconds timeout
socketTimeoutMS: 45000 // 45 seconds timeout
});
Expand Down
5 changes: 1 addition & 4 deletions server/scripts/examples-gg-latest.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ const headers = { 'User-Agent': 'p5js-web-editor/0.0.1' };

const mongoConnectionString = process.env.MONGO_URL;

mongoose.connect(mongoConnectionString, {
useNewUrlParser: true,
useUnifiedTopology: true
});
mongoose.connect(mongoConnectionString);
mongoose.set('strictQuery', true);
mongoose.connection.on('error', () => {
console.error(
Expand Down
5 changes: 1 addition & 4 deletions server/scripts/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ const headers = { 'User-Agent': 'p5js-web-editor/0.0.1' };

const mongoConnectionString = process.env.MONGO_URL;

mongoose.connect(mongoConnectionString, {
useNewUrlParser: true,
useUnifiedTopology: true
});
mongoose.connect(mongoConnectionString);
mongoose.set('strictQuery', true);
mongoose.connection.on('error', () => {
console.error(
Expand Down
24 changes: 14 additions & 10 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,19 @@ app.use(cookieParser());

mongoose.set('strictQuery', true);

const clientPromise = mongoose
.connect(mongoConnectionString, {
useNewUrlParser: true,
useUnifiedTopology: true,
serverSelectionTimeoutMS: 30000, // 30 seconds timeout
socketTimeoutMS: 45000 // 45 seconds timeout
})
.then((m) => m.connection.getClient());
async function connectToMongoDB() {
try {
const mongooseConnection = await mongoose.connect(mongoConnectionString, {
serverSelectionTimeoutMS: 30000, // 30 seconds timeout
socketTimeoutMS: 45000 // 45 seconds timeout
});
return mongooseConnection.connection.getClient();
} catch (err) {
throw new Error('MongoDB connection failed', err);
}
}

const clientInstancePromise = connectToMongoDB();

app.use(
session({
Expand All @@ -97,8 +102,7 @@ app.use(
secure: false
},
store: new MongoStore({
clientPromise,
autoReconnect: true
clientPromise: clientInstancePromise
})
})
);
Expand Down

0 comments on commit 6b4f715

Please sign in to comment.