Comments (6)
It could be due to ES6 syntax. Switching the cwise transform to babel might fix it.
from cwise.
Can you clarify what you mean? Do you mean to babelify first, then apply the cwise transform?
$ browserify -g [ babelify --presets [ es2015 ] ] -g cwise index.js > bundle.js
from cwise.
That might work, but a better solution would be to fix the cwise transform falafel dependency to use es6 instead.
from cwise.
I updated cwise's static-module dep to see if I'd get lucky, but that didn't fix it. I verified that the newer version indeed sends {ecmaVersion: 6}
to falafel.
The cause seems to be that acorn is parsing the json requires as javascript. See: acornjs/acorn#415 So in that sense, it's correct to fail, but the question then is which step in the chain is failing such that it's trying to parse json as javascript.
The one simple fix that did work was to change regl's constants to .js
files that export their data, but it's unpleasant to have to propagate silly workarounds upstream (edit: cross-stream?).
from cwise.
For reference, a repo that reproduces this using cwise with an updated static-module dependency: https://github.com/rreusser/cwise-regl-interaction
To reproduce:
git clone https://github.com/rreusser/cwise-regl-interaction.git
cd cwise-regl-interaction
npm install
npm run bundle
Didn't otherwise manage to make headway though. 😞
from cwise.
Not sure if anyone's still working on a solution, but I hacked together a fix for the project I'm currently working on. Unfortunately I couldn't get the latest version of static-module
working, so I hacked together a fork of [email protected]
which uses the older version of static-eval
. Not a long-term solution, but it's working for now: https://github.com/jpweeks/cwise-es-transform.
Editing to clarify: my use case doesn't involve regl
, but is using cwise
in ES6 source code, which seems to be the root issue here.
from cwise.
Related Issues (20)
- matrix multiplication HOT 2
- Porting numpy array's Split and Merge functions to SciJs? HOT 2
- cwise docs out of data? HOT 2
- potential security vulnerability via an outdated version of [email protected] > [email protected] HOT 15
- Update static-module dependency HOT 1
- Cumulative sum with cwise? HOT 1
- Moderate vulnerability in static-module v.1 used HOT 3
- Error when using babel code inside cwise
- Could you bump the static-module dep up to 3.0.0? HOT 1
- Summation over single axis
- Implement a browserify transform to avoid cwise-parser dependency
- CVE in dependencies HOT 1
- Broadcast support
- bug with Safari ? HOT 3
- Document new features in cwise-compiler
- Can't access RGB triplet with blockIndices HOT 10
- Tests are run using tap rather than tape. HOT 1
- Pass arbitrary data to pre/body/post HOT 4
- Tensor contraction? HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cwise.