Code Monkey home page Code Monkey logo

create-wasm-app's People

Contributors

aaronabramov avatar alexcrichton avatar ashleygwilliams avatar dependabot-preview[bot] avatar dependabot-support avatar fitzgen avatar hskang9 avatar jimskapt avatar sendilkumarn 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  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  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  avatar

create-wasm-app's Issues

mkdirp

If the optional folder is more than one level deep, mkdirSync will fail. I know this is true for some node versions at least, but I have not checked the latest if the API changed (I doubt it).
One solution is use package mkdirp, another is manually splitting path string and creating a folder for each.

This module doesn't work anymore

I mean it dependencies have updated A lot and there are many breaking changes

webpack              ^4.29.3  →  ^5.74.0
webpack-cli           ^3.1.0  →  ^4.10.0
webpack-dev-server    ^3.1.5  →  ^4.11.1

I guess you shouldn't have used webpack then 😝
simply use --target web I suppose.

Electron bundle

I have a bundle like this that is not electron-ready apparently:

const path = require('path').join(__dirname, 'my_project_bg.wasm');
const bytes = require('fs').readFileSync(path);
let imports = {};
imports['./my_project'] = require('./my_project');

const wasmModule = new WebAssembly.Module(bytes);
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
module.exports = wasmInstance.exports;

Trying to run it in Electron I get this error:

WebAssembly.Compile is disallowed on the main thread, if the buffer size is larger than 4KB. Use WebAssembly.compile, or compile on a worker thread.

Do someone used an app created with create-wasm-app in electron?

Set up CI for this template

CI should

  • run the local version of the template (not 100% sure how to do this with npm init and local packages)
  • verify that it builds afterwards (npm install && ./node_modules/.bin/webpack)

am I missing anything else it should do?

Minimum Node version

Summary

Going through the rustwasm book's Hello world, I was unable to generate the www directory with the suggested command:

npm init wasm-app www

This command generates a package.json file but not the www directory, as in rustwasm/book#174 .

Upgrading to Node 12 seemed to solve the issue. My question is if this behavior is expected for the node version I was using (v8.10.0) and, if so, what is the minimum version that produces the desired directory as in the the rustwasm book?

Additional Details

OS: Ubuntu 18.04.4.

Validate whether if Git is installed in advance

Motivation

The utility assumes git is already installed and fails miserably if that is not the case (throws an error).

Proposed Solution

IMO, it is good to validate the respective case upfront and warn appropriately.

Alternatives

N/A

Additional Context

N/A

Which is better performant for rust-wasm?

I'm trying to build a custom language code ditor with linting, syntax check etc.,

My opinon is to use rustwasm/web_sys crate to build and manage dom from rust. But on the initial few run Native JS dom binding seems to be performing better than rustwasm.

Do you have any performance metics comparing web_sys and native js?

WebAssembly module is included in initial chunk

Describe the Bug

I have followed the example https://rustwasm.github.io/docs/book/game-of-life/implementing.htm and modified it to use the petgraph crate and try to build a module to use wasm to store tree structure for JS.

The module compiles and seems to work following the tutorial, however if I tried to include the package locally in another project e.g. https://github.com/bbofrk/trying-wasm, or even tried publishing the package on npm (https://www.npmjs.com/package/wasm-tree-structure) then installing in into another project. I am getting the same error

WebAssembly module is included in initial chunk. friendly-errors 09:45:56
This is not allowed, because WebAssembly download and compilation must happen asynchronous.

Steps to Reproduce

  1. clone https://github.com/bbofrk/trying-wasm
  2. run npm install
  3. run npm run dev
  4. See error

Expected Behavior

Should not see compile error

Actual Behavior

WebAssembly module is included in initial chunk. friendly-errors 09:45:56
This is not allowed, because WebAssembly download and compilation must happen asynchronous.

Additional Context

This might have something to do with my webpack.config.js or in this case nust.config.js but I could not tell what should be included. So apologis in advance if its my personal error

live reload/automatic recompile for wasm lib?

Summary

The tutorial at https://rustwasm.github.io/docs/book/game-of-life/implementing.html constantly mentions to just wasm-pack build and refresh the webpage, but does not say anything about restarting the npm run start command after each build. Just building doesn't seem to trigger a node recompile to get the updated library into the webpage. I have to restart the node server to get it to load the new version. How can I enable the server to monitor the wasm lib too, or even the .rs files, and automatically rebuild if it detects a change?

This module doesn't work with `yarn create`

Describe the Bug

The yarn equivalent for npm init wasm-app www is `yarn create wasm-app www', but it doesn't work with this module.

Steps to Reproduce

  1. mkdir blah
  2. cd blah
  3. yarn create wasm-app www
  4. See error

Expected Behavior

The www directory gets created like when I run npm init wasm-app www.

Actual Behavior

Here's my output:

wt@XXXXXXX:~/projects/blah$ yarn create wasm-app www
yarn create v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
      - create-wasm-app
/bin/sh: 1: /home/wt/.yarn/bin/create-wasm-app: not found
error Command failed.
Exit code: 127
Command: /home/wt/.yarn/bin/create-wasm-app
Arguments: www
Directory: /home/wt/projects/blah
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

Additional Context

I was following the project tutorial except that I wanted to use yarn.

Tutorial issue section 4.4

Rust newbie here,
Just following the tutorial and I've reached midway through section 4.4 where I've run into a weird issue. I try building the project and running npm run start, that's when I got the error message:
ERROR in ./index.js 1:20
Module parse failed: Unexpected token (1:20)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

import { Universe } as wasm from "wasm-game-of-life";
| const pre = document.getElementById("game-of-life-canvas");
| const universe = Universe.new();
@ ./bootstrap.js 4:0-20

How would I fix this issue?

express with wasm

I'm trying your example integrate into my application written with using express framework but get error in browser(Firefox v.60)
"Loading failed for module with source “http://localhost:3000/public/javascripts/bootstrap.js”
html:
"

<title>Hello wasm-pack!</title> <script type="module" src="../public/javascripts/bootstrap.js"></script> "

In Folder public/javascript next files unchanged as an example:
bootstrap.js
HelloWasm_bg.wasm
HelloWasm.d.ts
HelloWasm.js
index.js

WebAssembly is cool!!!Help me!

[cloning template failed] npm init wasm-app

I just tried to create an instance of create-wasm-app by executing npm init wasm-app.
I was expecting the project initialization to succeed.
Instead, I got this error log:

~/Development/accept  npm init wasm-app
npx: installed 1 in 2.048s
cloning the template failed!

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.