Hey - again an issue with Material UI. I can’t make the material ui elements react to click events. I know I’m supposed to add react-tap-event-plugin package and add the following lines:
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();
But that doesn’t work and events are not fired. Is this related to that issue?
EDIT: I made this work by adding the meteor package coniel:react-tap-event-plugin, and adding the following line to the externals in the /entry/webpack.conf.js file:
Hi - I’m trying to load Dropbox zxcvbn library as an async module in a textfield component, as in:
componentDidMount() {
require(['zxcvbn'], function (obj) {
this.setState({zxcvbn: obj});
});
}
While this works perfectly in development environment, in production the server crashes with ReferenceError: window is not defined. I understand this is an issue with SSR, and I believe windowis used by zxcvbn but I’m not sure how to make this work…
I hope that this project will be maintained and even supported by MDG somehow. Webpack with Meteor is a way better dev experience in my opinion. I can create build paths without any barriers in the way I like and with tools I could find on Npm. (simple example: stylus, css modules, sourcemaps, postcss with autoprefixer and other plugins - no problem, one line config, all in one project. With oonly Meteor this is almost impossible)
Webpack is performance aware and I can configure it in many ways in the context of performance. When using Webpack with Meteor I am sure that I have very elastic codebase. And of course it is way better in code reloads (thanks to HotModuleReplacement)
I would like to read more about how this project evolving and I would like to read about apps based on it and dev opinions. Not only here. I hope that it will gain some more attention. (ps. let me know if there is any official website for this project).
I would like to see a Meteor branch with Webpack for devs who like some more control over the app and don’t afraid of Webpack. And also a standard Meteor branch with simple ES6 imports and Npm supports shipped as a simple to run box (as it will be from Meteor 1.3).
After updating my project to the most recent config for FlowRouter, I am no longer allowed to do code splitting in the router. Something like this no longer works for me:
Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components).
and
Uncaught Error: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
So, my routes work when I import the components using es6 import at the top of my file. If I don’t use import and use let Component = require(‘path/to/file’) instead to import my components, it does not work and spits out those same errors. So, I actually think it’s not necessarily the code splitting that is broken, but with importing a component with require.
What are the known drawbacks of using this approach instead of Meteor 1.3?
Are there any more benefits than hot-reload in development, working SSR and code splitting (compared to Meteor 1.3)?
Does the hot-code-push still work in Cordova?
How does code splitting works in Cordova? Does it store the lazy required modules like the Meteor normal html, css y js and they work even if the user opens the app without connection or those lazy required modules are always send over the net and require connection?
@benoitt I added webpack-font-awesome npm package and it works on development environment, but when I try to build for production I get the following error saying that window is not defined. I’ve also tried removing the font-awesome package, but I still get this issue. Is there some webpack cache somewhere that I need to clear? Any thoughts?
=> Exited with code: 8
W20160203-21:39:32.902(-5)? (STDERR)
W20160203-21:39:32.903(-5)? (STDERR) C:\Users\panw\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\fibers\future.js:245
W20160203-21:39:32.904(-5)? (STDERR) throw(ex);
W20160203-21:39:32.904(-5)? (STDERR) ^
W20160203-21:39:32.904(-5)? (STDERR) ReferenceError: window is not defined
@benoitt,
Does code splitting in webpack mean that my app is no more served as a single js file?
I’d like to be able to split my app in two “parts”:
core meteor files, that don’t change and are cached on user’s browser
app-specific files, that change when I push updates for my app into production
When user opens the app, he should only need to download the “second part”. Is that achievable with webpack?
Code splitting means your user don’t need to load your entire app as soon as he opens the first page. He can load just what he needs and request more only when he needs it.
If you want to split the code of the libraries you’re using vs your own, you can use a common chunk by using webpack.optimize.CommonsChunkPlugin.