Git Product home page Git Product logo

processing-p5js-mode's People

Contributors

benfry avatar fjenett avatar villares avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

processing-p5js-mode's Issues

p5.js mode fails to install in Processing PDE, install always incomplete

moving post from @jeremydouglass processing/p5.js#1600:

I'm using Processing PDE 3.2.1 on OS X 10.10.5.

  1. When I go to "Modes" to add p5.js, it says that p5.js 1.0.2 is available.
  2. When I install p5.js, however, it now says 1.0 is installed, an update to 1.0.2 is available.
  3. When I update to 1.0.2:
    a. ...using the Modes tab, it downloads, installs, and then again says 1.0 is installed and 1.0.2 is available.
    b. ...using the Updates tab / "Update All", it spins and times out.

https://forum.processing.org/two/discussion/18248/p5-js-mode-fails-to-update-install-always-incomplete

Manually renamed folders result in 404 when sketch first run

I tried manually moving an example to a different folder by:

  1. renaming the folder from weather_2p0 to weather_2p0_sketch1
  2. renaming the js file from weather_2p0.js to weather_2p0_sketch1.js
  3. updating the index.html script tag to reflect the new js filename

I then opened the project in Processing, clicked "Run", and got this:
image

When I tried running it a second time it eventually worked.

Will this be available within the IDE?

Or only as manual download and install? I'm in a similar position as you. I need something to teach P5.js with but the official P5.app is not reliable.

p5.js sketch breaks when I save it

If I start up a new sketch in p5.js mode and paste in this code, it works fine. I click run and it shows the output in my browser window with no errors (correctly showing a square spinning on the Y axis)

let angle = 0;

function setup() {
createCanvas(400, 300, WEBGL);
}

function draw() {
background(175);
rectMode(CENTER);
//noStroke();
//fill(0, 0, 255);
//rotateZ(angle);
rotateY(angle);
rect(0, 0, 150, 150);
angle += 0.03;

}

However, if I then save this file, it no longer works when I try to run it. I get an error message:
SyntaxError: Expected ; but found angle
And this generally highlights the first line in the code.

I am using Processing IDE 3.3.6. Windows 10. Firefox for output.

Processing environment.
image

p5.js mode:
image

error message:
image

index.html:
image

Installing p5js mode fails

Installing p5.js mode on Procesing 3.5.4 fails with error, This item needs to be recompiled for Java 8

Save required before running

In the initial release, the code from the current tab was not properly stored if there were modifications. Fixed for the 1.0.1 release.

Add support for editing .json files in the Editor

I am failing to create a .json-tab in Processing 3.3 with "p5.js"-mode and get the error '".json" is not a valid extension', but I do not have a problem with loading a .json-file created elsewhere.

Could not download in mode in Processing

Steps to reproduce:
Open Processing
Start Tool/Mode/Library/Example Manager
Press Modes
Press p5js Mode
Press Install

Could not download https://github.com/fathominfo/processing-p5js-mode/releases/download/latest/p5jsMode.zip to /tmp/download3432778025560692869p5jsMode.zip : Error during download and install of p5.js Mode.

This is the error, if I try and download the above link with wget, I get a 404 Error.

Processing 3.5.4-1 install with pacman (Arch Linux)

UnsatisfiedLinkError: Unable to load library 'CoreServices': Native library (darwin/libCoreServices.dylib) not found in resource path

Seen in class this morning; seems to be a problem with Big Sur and old JNA releases.

Updating to JNA 5.7.0 in the hope that fixes it.

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: Unable to load library 'CoreServices': Native library (darwin/libCoreServices.dylib) not found in resource path ([file:/Applications/Processing.app/Contents/Java/, file:/Applications/Processing.app/Contents/Java/ant.jar, file:/Applications/Processing.app/Contents/Java/ant-launcher.jar, file:/Applications/Processing.app/Contents/Java/core.jar, file:/Applications/Processing.app/Contents/Java/jna.jar, file:/Applications/Processing.app/Contents/Java/pde.jar, file:/Applications/Processing.app/Contents/Java/jna-platform.jar])
	at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:277)
	at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:403)
	at com.sun.jna.Library$Handler.<init>(Library.java:147)
	at com.sun.jna.Native.loadLibrary(Native.java:502)
	at com.sun.jna.Native.loadLibrary(Native.java:481)
	at com.sun.jna.platform.mac.MacFileUtils$FileManager.<clinit>(MacFileUtils.java:35)
	at sun.misc.Unsafe.ensureClassInitialized(Native Method)
	at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
	at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:156)
	at java.lang.reflect.Field.acquireFieldAccessor(Field.java:1088)
	at java.lang.reflect.Field.getFieldAccessor(Field.java:1069)
	at java.lang.reflect.Field.get(Field.java:393)
	at com.sun.jna.Native.loadLibraryInstance(Native.java:527)
	at com.sun.jna.Native.getLibraryOptions(Native.java:588)
	at com.sun.jna.Native.getStructureAlignment(Native.java:676)
	at com.sun.jna.Structure.setAlignType(Structure.java:259)
	at com.sun.jna.Structure.<init>(Structure.java:176)
	at com.sun.jna.Structure.<init>(Structure.java:172)
	at com.sun.jna.Structure.<init>(Structure.java:159)
	at com.sun.jna.Structure.<init>(Structure.java:151)
	at com.sun.jna.platform.mac.MacFileUtils$FileManager$FSRef.<init>(MacFileUtils.java:46)
	at com.sun.jna.platform.mac.MacFileUtils.moveToTrash(MacFileUtils.java:69)
	at processing.app.Platform.deleteFile(Platform.java:378)
	at processing.mode.p5js.p5jsBuild.cleanTempFiles(p5jsBuild.java:246)
	at processing.mode.p5js.p5jsEditor.handleStop(p5jsEditor.java:372)
	at processing.mode.p5js.p5jsEditor.internalCloseRunner(p5jsEditor.java:306)
	at processing.app.ui.Editor.prepareRun(Editor.java:2809)
	at processing.mode.p5js.p5jsEditor.handleRun(p5jsEditor.java:337)
	at processing.mode.p5js.p5jsToolbar.handleRun(p5jsToolbar.java:32)
	at processing.app.ui.EditorToolbar$1.actionPerformed(EditorToolbar.java:157)
	at processing.app.ui.EditorButton.mousePressed(EditorButton.java:190)
	at java.awt.Component.processMouseEvent(Component.java:6536)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6304)
	at java.awt.Container.processEvent(Container.java:2239)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Container.dispatchEventImpl(Container.java:2297)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4532)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
	at java.awt.Container.dispatchEventImpl(Container.java:2283)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
	at java.awt.EventQueue$4.run(EventQueue.java:733)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Failed to mail or browse http://127.0.0.1:8473/. Error code: -600

Seen in class this morning. First thought it was a broken OS install or needed a reboot. Now thinking it might be an i18n/l10n issue.

java.io.IOException: Failed to mail or browse http://127.0.0.1:8473/. Error code: -600
    at sun.lwawt.macosx.CDesktopPeer.lsOpen(CDesktopPeer.java:72)
    at sun.lwawt.macosx.CDesktopPeer.browse(CDesktopPeer.java:65)
    at java.awt.Desktop.browse(Desktop.java:386)
    at processing.app.platform.DefaultPlatform.openURL(DefaultPlatform.java:114)
    at processing.app.Platform.openURL(Platform.java:149)
    at processing.app.ui.EditorStatus$1.mousePressed(EditorStatus.java:109)
    at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:279)

SocketTimeoutException: Read timed out

Probably just need to suppress these, but would like to verify their circumstances.

java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
    at java.net.SocketInputStream.read(SocketInputStream.java:170)
    at java.net.SocketInputStream.read(SocketInputStream.java:141)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at java.io.BufferedReader.fill(BufferedReader.java:161)
    at java.io.BufferedReader.readLine(BufferedReader.java:324)
    at java.io.BufferedReader.readLine(BufferedReader.java:389)
    at processing.mode.p5js.server.HttpWorker.handleClient(HttpWorker.java:70)
    at processing.mode.p5js.server.HttpWorker.run(HttpWorker.java:40)
    at java.lang.Thread.run(Thread.java:745)

Import sketch.js files/projects created outside p5jsMode

The current release of p5jsMode doesn't properly handled sketches created with other editors (i.e. most p5.js sketches, which use sketch.js as their main file).

This will be fixed as soon as possible, but for the time being, code has been added to prevent opening those sketches to avoid any chance of sketches getting destroyed.

Sorry!

Too many missing semicolons

Statements that do not end in a semicolon are considered to be errors. This is not apparent until there are too many (somewhere around 100) such statements.
too many errors

Run appears to fail if Java Desktop API is not supported.

I'm running arch linux and a lightweight non-desktop window manager.

When attempting to run a sketch from Processing 3 (0263) in p5.js mode I get the following error:

java.lang.UnsupportedOperationException: 
The BROWSE action is not supported on the current platform!

The error suppresses the "Server running at [port]" status message. It appears everything has failed when in fact the server is running and serving your sketch, you're just missing the convenience of a browser automatically opening the sketch at the url it's served at.

I was in the Information Design workshop (which was great) at the recent Processing Community Day and was distracted while trying to figure out what was wrong.

I suspect that wrapping the call to Desktop.getDesktop.browse() in a test for Desktop API support

        if(Desktop.isDesktopSupported()){
            Desktop.getDesktop().browse(new URI(server.getAddress()));
        } else {
           ... tell user to navigate browser to server's address ...
        }

would be enough, as no error would be triggered and you'd see the status message telling you which port to navigate your browser to.

I'm not familiar enough with the build process here to test this myself, though if pointed in the right direction I'd be happy to.

p5js mode seems to be making unsolicited changes to my index.html file

p5js mode seems to be making unsolicited changes to my index.html file. Please see this commit as an example of this behaviour - I'd only intended to change a src attribute, but rather a lot else seems to have been changed on my behalf.

Antony74/hyperbolic@fcc3196

I think part of the problem is that JSoup's "prettyPrint" mode is on by default. It's much like PDE's very nice Edit->Auto Format, menu-item, but mandatory, and every time you save.

However, all that extra vertical whitespace in the <style> tag is possibly because I'm running Windows, which uses carriage-return-line-feed (\r\n) instead of the otherwise universal line-feed (\n)? :-(

In which case, and very tentatively, a fix might look something like this? d303a5a but without in-depth knowledge of the code, all I can say is it works for me.

“Warning: Nashorn engine is planned to be removed from a future JDK release”

The “Nashorn” engine that's built into JDK 8 and 11 will soon no longer be available.

The recommendation is to use GraalVM/GraalJS:

…though it's not clear how to do this w/o platform-specific binaries or with minimal impact. This solution is pretty excessive just for parsing/linting the JS code.

Methods for getting rid of the deprecation warning:

p5.js mode PDE editor bugs when editing a .css file

Hi everyone. I know that p5.js mode for PDE is not a developping tools. But even with this in mind, I think that solving what seems to be a minor bug could provide additionnal motivation to students or people discovering interactive visual programming with web programming using Javascript, HMTL and CSS, To be short, there is apparently a bug in p5.js PDE editor when editing a simpe .css file. See issue reported to

Ben Fry suggested to report this issue here and closed the #5628 issue.

If a fix could be found without too much work, it would be great!

Thanks a lot for great development work. Processing is really a great tool for programming learning!

Laurent

Allow use of let and const in p5js-mode

As I was investigating using p5js-mode, I noticed that I could not use let or const without obtaining an error after saving the code. For example, this works fine:

function setup() {
  createCanvas(1000, 700);
}

function draw() {
  var someColor = random(255);
  fill(someColor, random(255), random(255), random(255));
  rect(random(width), random(height), 30, 30);
}

But if the var is replaced by let, like this:

function setup() {
  createCanvas(1000, 700);
}

function draw() {
  var someColor = random(255);
  fill(someColor, random(255), random(255), random(255));
  rect(random(width), random(height), 30, 30);
}

then an error of SyntaxError: Expected ; but found someColor is thrown.

This seems to be the same problem that occurred in #18. As I stated there, I poked around the source of p5js-mode, and I'm wondering if the issue lies in the public HtmlTokenMarker(boolean js) function in the HTMLTokenMarker.java file. I can see var in there, but the more recent let and const ES6 style variable declarations are not. Perhaps it is as simple as adding those?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.