Comments (8)
Thanks for the input! I'm actually working on guides right now 😄 Currently the readme kind of assumes some prior webpack & ES6 knowledge. I'm hoping to fill the gaps with several guides covering various topics (how it works, migrating current apps, ).
I've started a screencast but it's more less a rough draft and doesn't mention using meteor packages (which are just installed like normal).
https://www.youtube.com/watch?v=QpixFzvf8U8
There's also some forum posts here that may provide context: https://forums.meteor.com/t/meteor-webpack-es6-modules-hot-code-patching-fixes-load-order-more/9110
Even just adding a paragraph saying "Make a copy of the entire directory structure, delete the contents of /app and put your own stuff in there" would help, if that is indeed correct.
One thing to note is that files are not executed until they're imported the first time. If they're never imported they won't be bundled (helping remove dead code). If you just drop your app into app/
nothing will happen until the file is imported.
I recently migrated an app and the gist for my method was to drop the old app into the root and rename to old_app and then overwrite the old .meteor
with the new one. Then start in main.client.js
and import/add the router. The router will essentially be the entry point for most apps. I commented out all but the root route and then fixed undefined errors but adding in the file and importing it. Eventually the route will work without undefined errors. Then keep going route by route until that's done. You'll have some files that are not erroring out (the ones left over) and those can be dropped in (and add exports of course).
from meteor-webpack-react.
Thanks! That alone explains a lot, and the forum and that video are really great. I particularly appreciate you pointing out the things that don't work 👍
I'm pretty much sold on this solution, but definitely the scariest part is that it's not "official" so it's a business risk. You mentioned in the forum that you can just drop sources into meteor_core
, which is important to know. In particular, we've got a pretty large dependency on Autoform so "legacy" Blaze examples are important too (for now at least). It sounds like you've got it covered, though.
Hopefully I'll get to play with this a bit next week and give some more actionable feedback. Watching that video felt a bit like seeing the early Meteor demos for the first time. Exciting stuff!
from meteor-webpack-react.
Yep it's a bit of a leap to migrate especially since it's not official but what comforts me is at the end of the day you're just dropping client.app.js into the meteor folder and then meteor takes care of the rest.
I also have some legacy blaze (data-tables) that gets inserted into a jsx shell.
I'll post back here once I get some of the guides filled out (prob tomoroow, my fingers are killing me lol).
from meteor-webpack-react.
@AdamBrodzinski I'm going to add you as a collaborator, since you're putting at least as much effort into this as I am these days :)
from meteor-webpack-react.
@orlade CoffeeScript can be used if you add coffee-loader
. Maybe you'd be better off keeping the existing code in meteor_core
and writing new stuff as webpack modules...it's just a matter of how much refactoring you want to do, because there's no automated way to turn the package globals into module exports and requires that I know of.
from meteor-webpack-react.
@jedwards1211 Thanks for the advice. I've been experimenting with ways of defining packages that are valid in both Meteor and npm, with lots of ugly syntax like module?.exports = ...
and if require? then SomeGlobal = require('node/module')
. It kind of almost works, but it's tiring to even think about, and the builds are slow anyway.
Using meteor_core
for everything sounds like a good place to start. We'll give it a shot.
from meteor-webpack-react.
@orlade the best thing I can think of to be able to require a package is to fake it by doing something like this. At least you have a path to variable and it gives some documentation to the file.
// packages.js
/* global Meteor, SimpleSchema, FlowRouter */
export const Meteor = Meteor;
export const SimpleSchema = SimpleSchema;
export const FlowRouter = FlowRouter;
// somewhere else
import FlowRouter from '../../packages/FlowRouter';
// or with an alias
import FlowRouter from 'packages/FlowRouter';
Also i'm in the same boat as Andy.... I really try to stay away from Meteor packages unless it's something to augment core. I've had too many issues with bugs and lack of maintainability. Using React makes this even easier because everything is on NPM. I tend to use Meteor as a package to handle DDP, Auth, and pub/sub for mongo.
Using meteor_core
for legacy is do-able. I'm doing this for a few files (especially styles).
@AdamBrodzinski I'm going to add you as a collaborator, since you're putting at least as much effort into this as I am these days :)
Thanks! 🍻
from meteor-webpack-react.
Closing this out, it would be great if someone wrote a guide in the wiki for migrating apps.
from meteor-webpack-react.
Related Issues (20)
- Stripe integration HOT 1
- Calling configure method of useraccounts package causes error HOT 2
- WebPack Syntax Error on Windows
- Why would dev.js build server only?? HOT 2
- CoffeeScript/ Usage with meteord HOT 2
- How to: Server side debugging? HOT 2
- npm WARN deprecated [email protected]: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0 npm WARN deprecated [email protected]: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0 HOT 3
- TypeError: Cannot read property 'loginButtons' of undefined HOT 4
- Screen stays at "Loading" HOT 2
- mailgun-js HOT 2
- Meteor 1.3 HOT 18
- Adding loaders to webpack.config.client.js HOT 2
- Code splitting doesn't work in production (because only main chunk gets copied to meteor folder) HOT 12
- Cannot import meteor modules HOT 1
- Problem using Elasticsearch HOT 4
- Weird debug issues -- out of the box HOT 1
- [ERROR] Cannot find Cannot find module 'temp' , core-js-no-number when running dev HOT 2
- GET http://localhost:9090/ 502 Bad Gateway HOT 6
- Trying to bundle a pure node.js application HOT 2
- Webpack issue loading static files HOT 1
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 meteor-webpack-react.