Skip to content
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

Fix broken link for p5js references in FES Messages in console #7244

Closed
1 of 17 tasks
computationalmama opened this issue Sep 6, 2024 · 6 comments · Fixed by #7253
Closed
1 of 17 tasks

Fix broken link for p5js references in FES Messages in console #7244

computationalmama opened this issue Sep 6, 2024 · 6 comments · Fixed by #7253
Labels

Comments

@computationalmama
Copy link

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

1.10.0

Web browser and version

128.0.6613.119 (Official Build) (arm64)

Operating system

MacOSX Sonoma 14.5

Steps to reproduce this

Steps:

  1. Test simple shape function like circle(100,100, ) - intentionally not added diameter parameter
  2. Run sketch - open console
  3. FES message shows wrong reference link (still links to archive p5js website not the new one)

NOTE: This error shows up in locally run sketch and in the p5.js web editor

Old links for reference was http://p5js.org/reference/#/p5/circle and now with the revamped website it should be https://p5js.org/reference/p5/circle/

FESlink2

FESlink1

Solution

Requires a small edit in the FES core file src/core/friendly_errors/fes_core.js and possibly src/core/friendly_errors/sketch_reader.js

Reference links here

msgWithReference = `${message} (http://p5js.org/reference/#/${referenceSection}.${funcName})` :

let url = `https://p5js.org/reference/#/p5/${variableArray[i]}`;

Snippet:

I believe this is the change needed - but I would need some guidance to share the PR for this.

// line 147 
//Whenever func having p5.[Class] is encountered, we need to have the error link as mentioned below else different link
funcName.startsWith('p5.')  ?
   msgWithReference = `${message} (https://p5js.org/reference/${referenceSection}.${funcName})` :
   msgWithReference = `${message} (https://p5js.org/reference/${referenceSection}/${funcName})`;
    
Copy link

welcome bot commented Sep 6, 2024

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!

@yashsaraswat2004
Copy link

Please assign this issue to me

@Qianqianye
Copy link
Contributor

Thanks @computationalmama. Tagging the active FES contributors @sproutleaf @limzykenneth @davepagurek to take a look at this issue as well

@nickmcintyre
Copy link
Member

@Qianqianye @limzykenneth @davepagurek maybe a separate issue, but what do you think about updating the website's DNS settings so that FES messages in p5.js versions <=1.10 map/redirect to the new reference URLs? It looks like y'all use Cloudflare, so Page Rules might be helpful.

@davepagurek
Copy link
Contributor

We have this issue on the website repo that might handle this: processing/p5.js-website#487

So far I think discussion has just been about doing it via Astro, but DNS options are interesting too, and worth bringing up! I'm less familiar with the website's setup outside of astro (I think we host with github pages, is that in conjunction with cloudflare? do we have other dns configuration ability?) but getting a redirect somehow would be helpful.

@limzykenneth
Copy link
Member

I think if Astro can handle it, it would be my preference. I use Cloudflare a lot in my other stuff and while I like it, it has some limits on the number of page rules and it is a bit opaque.

The setup of the website is that the site server is essentially GitHub Pages serve statically, then Cloudflare is the DNS provider pointing an A record to GitHub Pages that does the relevant reverse proxying. The traffic is routed through Cloudflare's servers for caching, security, and if we want to some customizability such as Page Rules.

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

Successfully merging a pull request may close this issue.

6 participants