Skip to content

p5.js version #144

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

Open
shiffman opened this issue Oct 12, 2016 · 16 comments
Open

p5.js version #144

shiffman opened this issue Oct 12, 2016 · 16 comments

Comments

@shiffman
Copy link
Member

@catarak @lmccart and I discussed this on a call yesterday. At some point in the future we'd like to have a library management system (#4), but for now we need a simple way to keep the p5.js version referenced in index.html up-to-date. We would not change index.html in existing projects (or "duplicated" projects) but would simply use the current p5.js version (0.5.4 at the time of filing this issue) whenever a "new" project is created.

@lmccart can you remind us what the url is to check the current p5 version? It could be checked something like once a day or each time "new" is clicked.

Did I get this right?

@lmccart
Copy link
Member

lmccart commented Oct 12, 2016

it is here right now: https://github.com/processing/p5.js-website/blob/master/src/data/download.json
I don't think this is the right spot...I'm in the middle of some website restructuring.
but you could use this link for now and I can submit a PR with the updated one if it moves.

@catarak
Copy link
Member

catarak commented Dec 14, 2016

I noticed that the version file is now at https://github.com/processing/p5.js-website/blob/master/dist/download/version.json, though it's not up to date. Are you just updating that file manually? Would it make more sense to do something like what the website does (https://github.com/processing/p5.js-website/blob/79996764cbff284ae9e8a589065c8cae35949d0b/dist/download/release.php#L30)?

@lmccart
Copy link
Member

lmccart commented Dec 14, 2016

here's the up to date file to link to:
http://p5js.org/download/version.json

it is updated automatically, I think something just got messed up with the git management where an old version of it got cached in the github repo. thanks for catching it!

@catarak
Copy link
Member

catarak commented Dec 14, 2016

Maybe it is just me but I am getting a 404 error for that link.

@lmccart
Copy link
Member

lmccart commented Dec 14, 2016

ugh I tried to fix the github and deleted the file! should be back now. sorry 😁

@catarak
Copy link
Member

catarak commented Dec 14, 2016

no worries!

@dhruvdutt
Copy link
Contributor

When new project button clicked, we check "version" from here and update p5.js version referenced in index.html

@catarak Does this plan sound good?

@catarak
Copy link
Member

catarak commented Feb 23, 2018

makes sense to me! because of CORS this might need to be added to the API and then the API makes the request. i think this also needs to happen when a user navigates to / (which is the same as creating a new sketch, right?)

@dhruvdutt
Copy link
Contributor

p5.js version referenced in index.html

@catarak Sorry, I'm a bit confused. Which index.html are you guys referring here? Is it the root index.html? I don't see any p5.js version already referenced as per the original post in the issue.

@catarak
Copy link
Member

catarak commented Feb 27, 2018

the one included in each sketch—if you open the sidebar you can view it!

@dhruvdutt
Copy link
Contributor

Oh damn! I always miss this mysteriously hidden menu. 😅

@catarak
Copy link
Member

catarak commented Feb 27, 2018

the ui isn't super clear right now—see #4 for a bit of discussion about this, and #389.

@catarak
Copy link
Member

catarak commented Dec 11, 2018

i think i actually have figured out a solution for this issue! the p5.js version could be an environment variable (storied in the Kubernetes secret) which gets set via a cron job which checks the version url, once a day probably. that sounds like i said a lot of buzzwords but it is a real solution.

@jywarren
Copy link

jywarren commented Apr 16, 2019

😄 👍 Looking for latest p5.sound.min.js for an upcoming workshop, to get the latest fix in processing/p5.js-sound#322 (current is /*! p5.sound.min.js v0.3.7 2018-01-19 */)

(Update: i realize this is probably just the version from when I originally generated the sketch!)

So, linking to one of these from index.html for now: https://cdnjs.com/libraries/p5.js

But also would this be something we could just auto-generate or substitute into one of these sections?

https://github.com/processing/p5.js-web-editor/search?q=cdnjs.cloudflare.com&unscoped_q=cdnjs.cloudflare.com

const defaultHTML =
`<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.3/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.3/addons/p5.dom.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.3/addons/p5.sound.min.js"></script>

maybe this section. One thing I'm thinking though, is that once this file is generated (say in an old sketch), you basically have to update the index.html manually.

I didn't see an option in the CDN link, but is there any way to point at a js file with https://semver.org-style versioning? Like, ideally:

https://cdnjs.cloudflare.com/ajax/libs/p5.js/^0.8.0/addons/p5.sound.js

OK, this is just pie in the sky, but thanks everyone!

@catarak
Copy link
Member

catarak commented Apr 16, 2019

@jywarren semver version would be so cool! i think we are on the same page—i would like to write a script that updates an env variable, which would insert the latest p5 version into the snippet of code you put above. i don't think it should update existing sketches, to prevent breaking changes. maybe, with future library management system, there could be a GUI for users to update their p5 version for a sketch.

@jywarren
Copy link

jywarren commented Apr 16, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants