processing / p5.js

p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —
http://p5js.org/
GNU Lesser General Public License v2.1
21.66k stars 3.33k forks source link

P5.js 1.0.0 is different in different distributions. #5728

Open maxgmer opened 2 years ago

maxgmer commented 2 years ago

Most appropriate sub-area of p5.js?

p5.js version

1.0.0

Web browser and version

Doesn't matter

Operating System

Doesn't matter

Steps to reproduce this

Steps:

  1. Download p5.js file from 1.0.0 releases. (https://github.com/processing/p5.js/releases?page=2).
  2. Import it into a project.
  3. Try to create p5.Texture (won't be able to do it).
  4. Now import same p5.js 1.0.0 like this: .
  5. Try to create p5.Texture (will be able to do it).

First question: why are p5js of the same version different. Second question: which one is actually 1.0.0?

welcome[bot] commented 2 years ago

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

davepagurek commented 2 years ago

In the contents of the cdnjs file, this is at the top: p5.js v0.10.2 February 29, 2020

Looks like it was built on the same day but not using the same code build?

jakerockland commented 2 years ago

Hrm–looking at the contents of the files, it seems like they are actually entirely identical, with the sole difference being the top line of the file documenting the version.

Here is the diff that I'm looking at for reference: https://www.diffchecker.com/irxTUa2N

Which is comparing https://github.com/processing/p5.js/releases?page=2 and https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.0.0/p5.min.js both linked above

I may be missing something here, but I'm not sure that the issue described above with p5.Texture is due to this minor discrepancy in 1.0.0 copies?

limzykenneth commented 2 years ago

@jakerockland There were some release problems back when 1.0.0 was released #4336. As noticed, the only difference should be the headers only.

@maxgmer Before digging deeper, is there a specific reason why you would need to use 1.0.0?

maxgmer commented 2 years ago

@jakerockland sorry, my description wasn't detailed enough. From github I downloaded non-minified version, non-minified one is definitely different (but won't be able to see with diff checked as, obviously, minified and non-minified versions are different). That is why in steps to reproduce I said to try them instead of running through diff checker.

maxgmer commented 2 years ago

@limzykenneth artblocks.io restricts p5js to 1.0.0. I actually already asked them where they take their 1.0.0 p5js from and just made my script take it from the same place, so the question about where to take 1.0.0 from is resolved.

But the library difference might create confusion for sure.

jakerockland commented 2 years ago

I see I see, thank you for clarifying @maxgmer – Art Blocks does use the minified version of 1.0.0 as our current p5js version, for which the Github release and p5-foundation-recommended-CDN both match IIUC. 😅

limzykenneth commented 2 years ago

I seemed to remember the non-minified version might have some publishing issue that's causing this but I may be misremembering. In any case, if there really is a mismatch between the two and the CDN version is incorrect, there is no way for us to change it as CDN providers will not refresh the files once published because of the hash integrity attribute (we asked before).

As such the most we can do is unpublish 1.0.0 but there may very well be sources (such as artblocks as mentioned) that rely on these being available so I don't think this is a very good solution either. I would recommend to just leave it as is if it is not posing a major problem in your work and try to upgrade to the latest version if at all possible, there shouldn't be any breaking changes so your code should just work without modifications.

maxgmer commented 2 years ago

@limzykenneth I see. Yes, then we can just close this, but it'd be awesome if you update github release description for 1.0.0 mentioning this difference.

jakerockland commented 2 years ago

but it'd be awesome if you update github release description for 1.0.0 mentioning this difference. +++ 🙏

Also, for posterity/clarity, we do have plans to eventually update the canonical p5js version for Art Blocks up from 1.0.0, but are very particular about how we want to do versioning given the on-chain nature of the artwork for Art Blocks so this is something we don't have a concrete timeline committed to just quite yet–but can definitely confirm that we will eventually do a version bump on our end as well (for new projects going forward, existing projects are all pegged to 1.0.0).

cc (for additional team-visibility) @lyaunzbe @yoshiwarab @ryley-o @aaronpenne

Qianqianye commented 2 years ago

@limzykenneth I see. Yes, then we can just close this, but it'd be awesome if you update github release description for 1.0.0 mentioning this difference.

Yes, we can update the release description. Any suggestions on how to phrase the difference? Thanks!

maxgmer commented 2 years ago

@Qianqianye we can just leave a link to this issue here and add "The p5.min.js artifact below is incorrect. To get the valid p5.min.js 1.0.0, use https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.0.0/p5.min.js link"