The enet package was being imported and executed regardless of whether DolphinConnection was being used or not. This broke compatibility with the browser, and also causes strange messages to be logged whenever errors were thrown.
e.g.
This PR makes it so that we only dynamically import the enet package when we actually attempt to connect to Dolphin. The connect interface has been changed to return a promise.
The
enet
package was being imported and executed regardless of whetherDolphinConnection
was being used or not. This broke compatibility with the browser, and also causes strange messages to be logged whenever errors were thrown.e.g.
This PR makes it so that we only dynamically import the
enet
package when we actually attempt to connect to Dolphin. The connect interface has been changed to return a promise.