Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The webpack configuration doesn't work anymore, needs to be updated #3

Open
marcofugaro opened this issue Dec 22, 2016 · 20 comments
Open

Comments

@marcofugaro
Copy link

marcofugaro commented Dec 22, 2016

Basically the webpack config is for the version one, and the webpack version in the package.json is the 2, and there are some breaking changes with the latest beta (28).
Also there are no npm scripts so it runs with the webpack you installed on your machine.

With beta28 being the release candidate you can pretty much safely migrate to v2.

I can help you with that, are you interested in keeping this repo updated?

@sasha240100
Copy link
Member

@marcofugaro yes, we need your help. Currently whitestormjs 2 beta is developed in beta branch (it will have better webpack config/support.

@marcofugaro
Copy link
Author

Cool will do a PR with webpack2 stuff.

Also can I install the whitestormjs 2 beta with npm install whs@beta?

@sasha240100
Copy link
Member

@marcofugaro it's better to clone beta branch and do npm link

@marcofugaro
Copy link
Author

Alright you can check my progress here: https://github.com/marcofugaro/test-whitestorm-webpack

Updated following the webpack 2 documentation, still takes up a lot of time to compile, also couldn't get physics to work, it throws an error in console, maybe you can give it a look

@sasha240100
Copy link
Member

@marcofugaro Thanks! will check later today

@marcofugaro
Copy link
Author

@sasha240100 any updates?

@sasha240100
Copy link
Member

@marcofugaro Currently all work is going on v2 beta which (as we now see) has a lot of difference from whitestorm v1. I think we'll configure webpack after all API is formed.

If you want - i can add a link to your repository in README.md to point other people who have troubles with whitestorm v1 and webpack

@marcofugaro
Copy link
Author

There is an error with physics in the compiled bundle in my repo, so it's better not to.

Nice, keep it up with the development of the beta, please do a pre-release when all the APIs have formed.

Also here's I thing I would like to see in whitestorm, importing like three.js does:

import { World, Spere } from 'whs';

or just rely on tree-shaking of webpack 2:

import * as WHS from 'whs';

Here is the famous PR from three.js

@sasha240100
Copy link
Member

@marcofugaro Will be. We were the first who started using es6 (even before three.js became on es6 modules) and we will support them.

I hope pre-release will be this week (probably on holidays) or the beginning of next week.

@quasipedia
Copy link

One question that is not clear to me is: how can I use ES6 (one of the features that attracted me to whs over using three directly) if the webpack configuration is broken? Is there a workaround of sorts, like for example using babel directly, or... ?

@marcofugaro
Copy link
Author

@quasipedia just my fork is broken.

This repo works just fine if you run it with [email protected], as listed in the package.json

@quasipedia
Copy link

Ok, thank you @marcofugaro I will try that then! :)

@quasipedia
Copy link

What is the error that you are getting @marcofugaro ?
Even by using beta21, I get errors in the bundle, namely: Uncaught TypeError: i.n is not a function...

@sasha240100
Copy link
Member

sasha240100 commented Jan 4, 2017

@quasipedia what version of whs are you using?

@sasha240100
Copy link
Member

@marcofugaro @quasipedia https://whsjs.readme.io/blog/news-from-beta-new-api

To be in touch about such news - join our discord chat. (Link in whitestorm.js readme)

@marcofugaro
Copy link
Author

@quasipedia Yup, that's the error I'm getting in my fork

Uncaught TypeError: i.n is not a function

@quasipedia
Copy link

I think the problem is that this repo mistakenly versioned the built artifact app.bundle.js, but if you remove it and try to generate it - even with beta21 - it will be a different one with that error. It would be interesting to hear from @sasha240100 how he generated the one in git (what commandline parameters did he use).

@marcofugaro
Copy link
Author

marcofugaro commented Jan 5, 2017

Yup, for this exact reason I added npm scripts

@quasipedia
Copy link

We have probably done the same modifications to this branch then, @marcofugaro

Also: it's unclear to me why babel needs to transpile the distributed lib folder of whitestorm. It feels like the library should come with pre-transpiled modules. Is that because of the workers plugin for node? If that's the case, I still think it should be on the library to offer different imports for the two scenarios... Starting the webpack-dev-server - for example - takes half a minute now. It should take 1-2 seconds max!

@marcofugaro
Copy link
Author

Yup, it takes over a minute for me to compile also.

Those are the changes I made: https://github.com/marcofugaro/test-whitestorm-webpack/commits/master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants