processing / p5.js-web-editor

The p5.js Editor is a website for creating p5.js sketches, with a focus on making coding accessible and inclusive for artists, designers, educators, beginners, and anyone else! You can create, share, or remix p5.js sketches without needing to download or configure anything.
https://editor.p5js.org
GNU Lesser General Public License v2.1
1.4k stars 1.35k forks source link

p5.js version #144

Open shiffman opened 8 years ago

shiffman commented 8 years ago

@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 commented 8 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

lmccart commented 7 years ago

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

catarak commented 7 years ago

no worries!

dhruvdutt commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

dhruvdutt commented 6 years ago

Oh damn! I always miss this mysteriously hidden menu. :sweat_smile:

catarak commented 6 years ago

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

catarak commented 5 years ago

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 commented 5 years ago

😄 👍 Looking for latest p5.sound.min.js for an upcoming workshop, to get the latest fix in https://github.com/processing/p5.js-sound/pull/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

https://github.com/processing/p5.js-web-editor/blob/5fdcd08adda6cea3408c6331b6ec7f06fd58aa66/client/modules/IDE/reducers/files.js#L12-L18

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 commented 5 years ago

@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 commented 5 years ago

Cool! Yes. This seems like a good way forward. I could imagine a system too where we could use a replace-able $VARIABLE in the saved index.html, but it'd be fragile and also not at all how the web works (perhaps slightly sadly... HTML variables anyone?). Or... a way to pattern match and replace the full CDN paths.. but again, fragile and once it breaks it's very hard for people to untangle. Better avoid magic solutions, i guess.

Thanks!

On Tue, Apr 16, 2019 at 6:00 PM Cassie Tarakajian notifications@github.com wrote:

@jywarren https://github.com/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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/processing/p5.js-web-editor/issues/144#issuecomment-483859954, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJw0zD_q9WJIsQFYSNL4RbuO6XKyyks5vhkfSgaJpZM4KVMup .