You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This patch makes the README Node example to work properly by changing the esbuild options so they work with Node.js require and package name. It also changes the file extension in the condition entry "main" which isn't working maybe due to fauswasm package.json being of "type": "module". Some options may be redundant since defining --platform=node should take care of --external:fs --external:url.
Note: esm imports aren't working either in Node, the problem can be solved just by changing the extension the same ways as for cjs. I just don't want to mess too much around because there might be a different underlying issue with the configuration that's causing these problems.
Thank you for the PR and the comments,
At the beginning of development, we needed to consider different use cases for this project, such as importing and running directly in the browser, importing and bundling using bundler/compiler with Node, and generating audio offline in a Node environment. I also needed to consider compatibility with the libfaust-wasm.js file generated by Emscripten, allowing it to be dynamically imported. Ultimately, we chose these outputs.
At the time, I thought the IIFE output would be suitable for developing static HTML pages that could run DSP directly upon opening the page. Some WebAudioModules might also use this output. This is why I copied the d.ts file so that developers could use it directly.
It's been a while I don't remember many of the details, so I might need some time to retest these methods using the changes suggested in this PR. Or perhaps rename them to make their purpose clearer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch makes the README Node example to work properly by changing the esbuild options so they work with Node.js require and package name. It also changes the file extension in the condition entry
"main"which isn't working maybe due to fauswasm package.json being of"type": "module". Some options may be redundant since defining--platform=nodeshould take care of--external:fs --external:url.