Giter Site home page Giter Site logo

meteor-hmr's Introduction

meteor-hmr

This project is no longer maintained

Interested in taking it over? See Info for potential maintainers. I regret that I simply do not have the resources to continue this project at this point in time.

Past Info

Hot Module Replacement (HMR) for Meteor

NB: This README refers to the upcoming release. Although it's experimental, you're encouraged to try it out, since that's the direction we're going in. More details in #51. Otherwise, you can find the old README here.

gadicc:[email protected] is the last release for Meteor 1.3.2.4; later releases and the 2.0.0 final will target Meteor 1.3.3, using Meteor's new official babelrc support, and no longer includes our own babel-compiler-babelrc which we no longer support.

Since Meteor 1.3.3 we use Meteor's native babelrc support. You should npm rm --save-dev babel-preset-meteor and remove the meteor preset from your .babelrc.

  • Edit your react components and see changes instantly, while maintaining state.
  • Catch react render() errors and show on your screen rather than crashing your app.
  • Add your own .babelrc plugins and presets, like jsx-control-statements.

screencast

Copyright (c) 2016 by Gadi Cohen <[email protected]>, released under the MIT License. Note: this code includes / republishes additions to core Meteor packages that are Copyright MDG and released under the same license.

Discussion: https://forums.meteor.com/t/help-test-react-hotloading-in-native-meteor-i-e-no-webpack/17523/

How to Use

If upgrading from an earlier version, please see Upgrading.

What follows are step-by-step instructions to add meteor-hmr to an existing project. You can also see the Boilerplates & Examples section of the docs.

Hotloading is provided on a per-build-plugin basis. We provide a replacement ecmascript-hot loader to hotload your *.js and *.jsx files:

  1. meteor remove ecmascript
  2. meteor add gadicc:ecmascript-hot

If you're trying a non-stable release, you need to explicitly provide the @version (or @=version if it's not picked up correctly) in the second step.

Note, your code needs to be hot-module-replacement (HMR) aware. For instuctions on how to add hot loading for React, please see the React Hotloading docs. For general instructions, see the Handling Updates. If you're a build-plugin author, see the Build Plugin docs. Other build plugins HMR support are list below:

Other Notes:

  1. We use an extra port for communication with the client. By default this is Meteor's port + 2 (i.e., right after mongo), but you can override it with the HOT_PORT environment variable.

  2. For Mantra style apps, skim over the React Hotloading docs above and then read this diff for an example on how to add hotloading to the mantra-sample-blog-app (or just clone the repo). You may also find more info in #60.

List of HMR-aware Build Plugins

  • gadicc:ecmascript-hot - .js and .jsx files (core, part of this project)
  • gadicc:node-modules-hot - compilation & hot updates of local node-modules (core, see docs)

Build plugin authors, please submit a PR to add your HMR-aware build plugin to this list. For more info, see the Build Plugin docs.

Where this works and doesn't work

Hot Module Replacement (HMR) only works with "pure" modules that use import and export. Any reliance on Meteor's old method of api.use(), api.export() and globals will absolutely not work properly, ever.

Forced Refresh

Just do a browser refresh like normal (ctrl-R, etc).

If you experience the need to do this frequently, please report on GitHub.

Note, errors thrown in your app can break Meteor's HCP system, requiring a browser refresh regardless... we can't help with that.

Settings (in package.json)

Hotloading is disabled by default for packages that can be hot loaded, unless the package explicitly forces hotloading, like ecmascript-hot and node-modules-hot which should simply be removed to disable hotloading. You can enable hotloading for other packages as follows:

{
  // Besides for "-hot" packages which are always enabled,
  // enable hotloading for all other packages that support it.
  "enabled": true
  // Or, we can specify an array of names
  "enabled": [ "author:packageName", "etc" ]
}

Please note that the old ecmascript-hot section is no longer used and should be removed.

Packages

If you replace the api.use('ecmascript') in the package.js file with the gadicc:ecmascript-hot@<currentVersion>, you'll be able to use the hotloading while developing local packages, with one caveat:

This only works for "new style" 1.3 module packages. That means any reference inside of a file should refer to the local scope only, i.e. any dependencies should be imported via the import X from Y; syntax, and your code should not expect them to "just be available" because of Meteor's linker code.

Note, at time of writing (2016-05-07), Meteor doesn't allow for the hot.accept() check to flow from packages back down to the app, so you need to do this per package. BUT, we have a PR open for this in meteor#6391.

Troubleshooting

Please see the Troubleshooting docs. The first entry there is called Is this even working?. Otherwise, see if anyone else has experienced your problem by searching in issues and if not, please open a new one.

How this works

Brace yourself for reading this and recall the project goals.

  1. Build plugins that use gadicc:hot-build (like gadicc:ecmascript-hot) will be loaded a 2nd time in a forked process. They will watch all the same files, and on update, will recompile only changed files and send this update directly to the client.

  2. This above bundle resembles Meteor's linker output but also bypasses it, so this will only work with "pure" modules that use import/export and don't rely at all on Meteor's old method of api.use() and api.export().

  3. The accelerator also runs an http server (to serve bundles) and a websocket server (to notify the client of new bundles ids). The client requests said bundles by inserting a script tag into the HEAD (so it will be loaded in the correct context).

  4. We patch meteorInstall's root, delete previous exports, climb the tree, and reevaluate. This happens before the HCP, so if everything succeeded, we skip the next HCP.

  5. We skip HCPs by wrapping autoupdate's observe()'s changed callback, to not fire the original callback in cases we want to skip.

Changes from original core packages

The bases for babel-compiler and ecmascript began from 1.3-modules-beta.5 and are upgraded as necessary, in their own commits (look out for commit messages update package bases to 1.3-beta.11 (<SHA>) etc).

meteor-hmr's People

Contributors

clayne11 avatar gadicc avatar xcv58 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  avatar  avatar  avatar  avatar  avatar  avatar

meteor-hmr's Issues

Uncaught TypeError: Cannot read property 'm' of undefined (anonymous function)

First reported by @proxiper here:

hot-client.js:180 Uncaught TypeError: Cannot read property 'm' of undefined(anonymous function) @ hot-client.js:180walkFileTree @ hot-client.js:128walkFileTree @ hot-client.js:131meteorInstallHot @ hot-client.js:179(anonymous function) @ hot.js?hash=eedd690โ€ฆ:1

This occurs when the server is restarting due to changes in server methods. But after the restart everything continues to work.

Missing class properties transform

I tried to add stage-0. But I got the following error:

   While processing files with gadicc:ecmascript-hot (for target web.browser):
   client/test.js:5:2: /client/test.js: Missing class properties transform.

here's my .babelrc file:


  "presets": [
    "es2015",
    "stage-0",
    "react",
    "meteor"
  ],
  "env": {
    "development": {
      "plugins": [
        ["react-transform", {
          "transforms": [{
            "transform": "react-transform-hmr",
            "imports": ["react"],
            "locals": ["module"]
          }, {
            "transform": "react-transform-catch-errors",
            "imports": ["react", "redbox-react"]
          }]
        }]
      ]
    }
  }
}

If I add transform-class-properties to plugins, the error goes away. But I didn't need to do this for my other projects that are not using this package. Any guidance on how to properly fix would be appreciated!

possible EventEmitter memory leak detected

Client modified -- refreshing (x7)(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at StatWatcher.addListener (events.js:160:15)
    at Object.fs.watchFile (fs.js:1175:8)
    at Object.files.watchFile (C:\tools\fs\files.js:1486:10)
    at Object.watch (C:\tools\fs\safe-pathwatcher.js:85:9)
    at Watcher._watchFileOrDirectory (C:\tools\fs\watch.js:469:35)
    at C:\tools\fs\watch.js:547:18
    at Array.forEach (native)
    at Function._.each._.forEach (C:\Users\lyquo\AppData\Local\.meteor\packages\meteor-tool\1.3.2-rc.0\mt-os.windows.x86_32\dev_bundle\lib\node_modules\underscore\underscore.js:79:11)
    at onWatchEvent (C:\tools\fs\watch.js:536:11)
    at thenCallback (C:\tools\utils\func-utils.js:37:18)
    at C:\Users\lyquo\AppData\Local\.meteor\packages\cosmos_browserify\0.8.4\plugin.CosmosBrowserify.os\npm\node_modules\meteor\promise\promise\node_modules\meteor-promise\fiber_pool.js:33:40
=> Client modified -- refreshing (x16)

Help test gadicc:[email protected] (for Meteor 1.3.3)

First see https://github.com/gadicc/meteor-react-hotloader/blob/master/docs/Upgrading.md.

Please mention general issues here (or open a new issue), and anything specific to the new alpha release of meteor-react-hotloader in this issue.

Please report successes too! And mention your OS. I'm assuming Windows is still broken from the issue in the fast releases. Will mention something in the forums early next week after this super early release has had some use.

cc: @clayne11, @tomitrescak

Error: locals does not appear to be 'module' object ...

After attempting installation. Seems to be some config issue.

Fails to launch with:

W20160218-15:34:03.513(-8)? (STDERR) W20160218-15:34:03.514(-8)? (STDERR) /Users/dpnewman/.meteor/packages/meteor-tool/.1.1.13-modules.7.ip1bjg++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245 W20160218-15:34:03.515(-8)? (STDERR) throw(ex); W20160218-15:34:03.515(-8)? (STDERR) ^ W20160218-15:34:03.602(-8)? (STDERR) Error: locals[0] does not appear to be amoduleobject with Hot Module replacement API enabled. You should disable react-transform-hmr in production by usingenvsection in Babel configuration. See the example in README: https://github.com/gaearon/react-transform-hmr W20160218-15:34:03.602(-8)? (STDERR) at proxyReactComponents (/Users/dpnewman/Meteor/haven-app/.meteor/local/build/programs/server/packages/modules.js:21750:11) W20160218-15:34:03.602(-8)? (STDERR) at meteorInstall.both.lib.authorizeForRole.jsx (/Users/dpnewman/Meteor/haven-app/.meteor/local/build/programs/server/app/app.js:59:59) W20160218-15:34:03.603(-8)? (STDERR) at fileEvaluate (/Users/dpnewman/Meteor/haven-app/.meteor/local/build/programs/server/packages/modules-runtime.js:219:9) W20160218-15:34:03.603(-8)? (STDERR) at require (/Users/dpnewman/Meteor/haven-app/.meteor/local/build/programs/server/packages/modules-runtime.js:92:20) W20160218-15:34:03.603(-8)? (STDERR) at /Users/dpnewman/Meteor/haven-app/.meteor/local/build/programs/server/app/app.js:12405:1 W20160218-15:34:03.603(-8)? (STDERR) at /Users/dpnewman/Meteor/haven-app/.meteor/local/build/programs/server/boot.js:242:10 W20160218-15:34:03.603(-8)? (STDERR) at Array.forEach (native) W20160218-15:34:03.603(-8)? (STDERR) at Function._.each._.forEach (/Users/dpnewman/.meteor/packages/meteor-tool/.1.1.13-modules.7.ip1bjg++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11) W20160218-15:34:03.603(-8)? (STDERR) at /Users/dpnewman/Meteor/haven-app/.meteor/local/build/programs/server/boot.js:137:5 => Exited with code: 8

Can we speed up server / "both" imports?

Since #17 we can handle hot loading (on the client) from files that are shared on the client & server, but the latter is a lot slower, e.g. @sammkj in #17 (comment):

๐Ÿ˜ฑ I just tested the newest version. It's working perfectly! However it's not nearly as fast as reloading components in client folder.

This is (probably) because all these shared files need to be processed twice before we can send the update. I think the only way we can solve this is to speed up Meteor (preferred) or bypass Meteor and repeat a lot of the same logic. Will look into this when I have a chance.

Cannot load local meteor package

import {clientErrorLog} from 'meteor/gsabran:utils'; (where gsabran:utils is a local meteor package that I've under my ./packages folder, and that is listed in ./meteor/packages) throw an error on the client: Uncaught Error: Cannot find module 'meteor/gsabran:utils' and the app crashes. It works fine without meteor-react-hotloader

Issue when creating production build

When running the build in our CI server with the command:

sudo /usr/local/bin/meteor build ./build --directory

We get the following error:

[gadicc:hot] Failed to connect to your Mongo database on "mongodb://localhost:3001/meteor". Try MONGO_URL environment variable or "-p PORT" when running Meteor.

/home/travis/.meteor/packages/gadicc_ecmascript-hot/.0.0.13-rc.10.okat4h++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/mongodb/lib/server.js:236
        process.nextTick(function() { throw err; })
                                            ^
Error: MongoError: connect ECONNREFUSED
    at packages/gadicc_babel-compiler-hot.js:147:11
    at /home/travis/.meteor/packages/gadicc_ecmascript-hot/.0.0.13-rc.10.okat4h++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/mongodb/lib/mongo_client.js:276:20
    at /home/travis/.meteor/packages/gadicc_ecmascript-hot/.0.0.13-rc.10.okat4h++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/mongodb/lib/db.js:224:14
    at [object Object].<anonymous> (/home/travis/.meteor/packages/gadicc_ecmascript-hot/.0.0.13-rc.10.okat4h++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/mongodb/lib/server.js:234:9)
    at [object Object].g (events.js:180:16)
    at [object Object].emit (events.js:98:17)
    at [object Object].<anonymous> (/home/travis/.meteor/packages/gadicc_ecmascript-hot/.0.0.13-rc.10.okat4h++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:269:68)
    at [object Object].g (events.js:180:16)
    at [object Object].emit (events.js:98:17)
    at [object Object].<anonymous> (/home/travis/.meteor/packages/gadicc_ecmascript-hot/.0.0.13-rc.10.okat4h++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:81:12)
    at [object Object].g (events.js:180:16)
    at [object Object].emit (events.js:98:17)
    at Socket.<anonymous> (/home/travis/.meteor/packages/gadicc_ecmascript-hot/.0.0.13-rc.10.okat4h++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:124:49)
    at Socket.g (events.js:180:16)
    at Socket.emit (events.js:95:17)
    at net.js:441:14
    at process._tickCallback (node.js:458:13)
FAILED: sudo /usr/local/bin/meteor build ./build --directory

Provide an API for other build plugins to use

If you're a build plugin author and you'd like to use this, please mention your project below. Currently this isn't a priority since no one is asking for it yet, but I have had some thoughts about it:

  • Access to accelerator object from other build plugins (through a global or by abstracting (preferred))
  • API to register / inject code (to run in the separate process) to rebuild changes files, with ability to use npm peer deps (which will get included if you require it from your project too, even if you don't use it)
  • API to send a bundle to the client
  • Docs on where/how to modify an existing build plugin to get hot support

Best case scenario ecmascript-hot will be made to use the new API and can serve as an example.

Note: hot module replacement only works with modules, i.e. JS files with import/export. But, a lot of other assets are compiled into JS already, e.g. some CSS plugins, etc.

Non-stop Reload

This is probably not something important. If any changes happen in the public folder, the app will reload non-stop.

Readonly error

I am not sure why is this happening, but when I remove underscores from the method names in create_comment.jsx, I receive following error:

While processing files with gadicc:ecmascript-hot (for target web.browser):
   client/modules/comments/components/create_comment.jsx: /client/modules/comments/components/create_comment.jsx: "create" is read-only (This is an error on an internal node.
   Probably an internal error. Location has been estimated.)

If I put them back on, all works.

Following works:

_create() {
      const text = this.refs["text"]["value"];
      const { create, postId } = this.props;
      create(postId, text);
      this.refs["text"]["value"] = '';
}

Following does not

create() {
      const text = this.refs["text"]["value"];
      const { create, postId } = this.props;
      create(postId, text);
      this.refs["text"]["value"] = '';
}

React Hot Loader 3.0 beta demo

See gaearon/react-hot-boilerplate#61.

Requires gadicc:[email protected].

Remove the old setup

  1. npm rm --save-dev babel-plugin-react-transform react-transform-hmr react-transform-catch-errors

  2. Remove the entire react-transform section from your client/.babelrc env block

  3. Modify your package.json to have a section like:

    {
      "ecmascript-hot": {
        "transformStateless": {
          "pathMatch": "NOMATCH"
        }
      }
    }

Add the new setup

  1. npm install --save-dev react-hot-loader@^3.0.0-beta.1 (check latest release)

  2. In your project root .babelrc, make sure you have { "plugins": ["react-hot-loader/babel"] }

  3. Modify your main client entry point / wherever you mount your root to resemble:

    import { AppContainer } from 'react-hot-loader';  // <-- add this line
    import Root from './containers/Root';  // example; wherever you keep your main component
    
    // Wherever you do this, probably in Meteor.startup()
    ReactDOM.render(
    <AppContainer
      component={Root}
      props={{ store }}     {/* if e.g. you're using redux */}
    />,
    document.getElementById('root')
    );
    
    // This section is new, the references to "containers/Root" should match your import statement
    if (module.hot) {
    module.hot.accept('./containers/Root', () => {
      const AppRoot = require('./containers/Root').default;
      render(
        <AppContainer>
          <AppRoot />
        </AppCotnainer>,
        document.getElementById('root')
      );
    });
    }
  4. You need to import 'react-hot-loader/patch'; before importing React. If you have a single client entry-point and get everything else from imports, just add this as your first line. If you still use a "regular" client directory (with more than 1 file), try place just this line in a file called client/_patchReact.js (or possibly in client/lib if you use react from within that directory).

There's an (incredibly convoluted) example at https://github.com/gadicc/meteor-react-hotloader/tree/master/demo-rhl3.

There's also a mantra-sample-blog-app-hot example. Unfortunately default Mantra routing leads to a slightly weird pattern but it's not too bad.

Full hmr-runtime support (implement full webpack HMR API)

The goal of this project was react hotloading support, which I feel we've accomplished pretty well. However, HMR goes a lot further. It would be great to support the full webpack HMR API, and "just work" with any module that is HMR compatible. This can be a longer term goal of the project (time allowing) and could serve as the basis for official HMR support in Meteor.

Strategies

1. Wrap the Webpack HMR code as needed to work inside Meteor

This would be my preference if it proves feasible. Both Meteor, this project and Webpack share the MIT license.

Pros:

  1. Guaranteed compatibility with Webpack HMR API
  2. High degree of maintainability
  3. Probably less work than implementing the API ourself.

Cons:

  1. Some of the wrapping might get quite hacky, especially conversion between how we track modules to how webpack does.

2. Implement the Webpack HMR API ourself

Pros:

  1. We understand our loader better, no need to convert data to a webpack-expected format.
  2. Quicker to get a subset of the spec working initially.

Cons:

  1. More work to implement and test every part of the API.
  2. "Reinventing the wheel"
  3. Might be harder than expected to maintain 100% API compatibilty.

kills cordova

Installing this module killed running this on Cordova through ios simulator:

2016-04-10 13:28:44.928 FLOW[4829:3786022] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/markshust/Library/Developer/CoreSimulator/Devices/CF28561C-A12F-4100-A5C7-D258DDA9FCB1/data/Containers/Data/Application/8190C74D-6B05-4993-89A3-C06C3AD8E3FC/Library/Cookies/app.binarycookies
2016-04-10 13:28:45.007 FLOW[4829:3786022] Apache Cordova native platform version 4.1.0 is starting.
2016-04-10 13:28:45.007 FLOW[4829:3786022] Multi-tasking -> Device: YES, App: YES
2016-04-10 13:28:45.013 FLOW[4829:3786022] 

Started backup to iCloud! Please be careful.
Your application might be rejected by Apple if you store too much data.
For more information please read "iOS Data Storage Guidelines" at:
https://developer.apple.com/icloud/documentation/data-storage/
To disable web storage backup to iCloud, set the BackupWebStorage preference to "local" in the Cordova config.xml file

2016-04-10 13:28:45.074 FLOW[4829:3786022] Using WKWebView
2016-04-10 13:28:45.076 FLOW[4829:3786022] [CDVTimer][handleopenurl] 0.096977ms
2016-04-10 13:28:45.078 FLOW[4829:3786022] [CDVTimer][intentandnavigationfilter] 2.270043ms
2016-04-10 13:28:45.079 FLOW[4829:3786022] [CDVTimer][gesturehandler] 0.083029ms
2016-04-10 13:28:45.189 FLOW[4829:3786022] Serving asset bundle version: 6997f1e1a4033b7f7110ed97c81f6babe65522c0
[INFO] GCDWebServer started on port 12296 and reachable at http://localhost:12296/
2016-04-10 13:28:45.192 FLOW[4829:3786022] [CDVTimer][webapplocalserver] 113.132000ms
2016-04-10 13:28:45.209 FLOW[4829:3786022] [CDVTimer][statusbar] 16.631007ms
2016-04-10 13:28:45.222 FLOW[4829:3786022] [CDVTimer][splashscreen] 12.573957ms
2016-04-10 13:28:45.224 FLOW[4829:3786022] [CDVTimer][keyboard] 1.572013ms
2016-04-10 13:28:45.225 FLOW[4829:3786022] [CDVTimer][TotalPluginStartup] 148.772001ms
2016-04-10 13:28:46.024 FLOW[4829:3786022] Start downloading asset manifest from: manifest.json -- http://192.168.1.66:3000/__cordova/
2016-04-10 13:28:46.046 FLOW[4829:3786490] Downloaded asset manifest for version: 6997f1e1a4033b7f7110ed97c81f6babe65522c0
2016-04-10 13:29:05.293 FLOW[4829:3786485] App startup timed out, reverting to last known good version

The app just loads black in Cordova after the splash screen is show. If I back out this module and put ecmascript back in, everything works properly.

CSS not being loaded in when created

When a CSS file is added to the project while Meteor is running, normally that CSS file will be loaded in.

When this package is added, the CSS file is not initially loaded in when it is created, nor will it be loaded in when updated.

However, after refreshing the page, the CSS file is included and edits to that CSS file will be reflected in the browser as expected.

Changes from atomic / "safe" writes not detected (Webstorm, Intellij, vim, maybe c9)

Using new [email protected] (#51)
IDE: Webstorm 12

Faulty behavior
When changing something in a file, in meteor console this error appears:
[gadicc:hot] Accelerator (C6A): TODO, rename support. /path/to/updates/file.js

The browser reloads the page and does not show any console messages suggesting a successful hot patching.

Reason
Webstorm and other Intellij based IDEs default to a "safe write" behavior. When pressing "save" first a new temporary file is created somewhere, then the old file is deleted and replaced by the temporary file.
The "accelerator" package does detect this "safe write" as a rename and prevents the hot reload.

Workaround
Disable "safe write" in Webstorm preferences - Appearance & Behavior / System Settings and on this page uncheck Use "safe write"

Ideas
Since I'm using the new react-hot-reload 3.x based version, HMR feels a lot snappier to me. This might also be because I disabled "safe write" now. I assume that the rename support in the previous versions was slower then a usual save&reload would have been.

So I suggest adding this to README/Troubleshooting even if rename support is added.

Error when deploy with mupx (no modules-runtime-hot in production)

cube-without-webpack git:(master) โœ— mupx logs --tail=50

Meteor Up: Production Quality Meteor Deployments
------------------------------------------------
Configuration file : mup.json
Settings file      : settings.json

[139.162.2.61] npm WARN deprecated To upgrade to the latest stable version, run:
[139.162.2.61] npm WARN deprecated
[139.162.2.61] npm WARN deprecated   npm -g install npm@latest
[139.162.2.61] npm WARN deprecated
[139.162.2.61] npm WARN deprecated (Depending on how Node.js was installed on your system, you
npm WARN deprecated may need to prefix the preceding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
npm WARN deprecated will be bundled with a version of npm@2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
[139.162.2.61] npm WARN package.json [email protected] No README data
[139.162.2.61] => Starting meteor app on port:80
[139.162.2.61] npm WARN cannot run in wd [email protected] node npm-rebuild.js (wd=/bundle/bundle/programs/server)

/bundle/bundle/programs/server/node_modules/fibers/future.js:267
                        throw(ex);
                              ^
Error: Are you running inside a Meteor project dir?
    at hot.lastHash (packages/gadicc_babel-compiler-hot/babelrc.js:45:1)
    at packages/gadicc_babel-compiler-hot/babelrc.js:163:1
    at packages/gadicc_babel-compiler-hot/babel-compiler.js:137:1
[139.162.2.61]     at /bundle/bundle/programs/server/boot.js:283:10
[139.162.2.61]     at Array.forEach (native)
[139.162.2.61]     at Function._.each._.forEach (/bundle/bundle/programs/server/node_modules/underscore/underscore.js:79:11)
[139.162.2.61]     at /bundle/bundle/programs/server/boot.js:133:5
npm WARN deprecated This version of npm lacks support for important features,
npm WARN deprecated such as scoped packages, offered by the primary npm
npm WARN deprecated registry. Consider upgrading to at least npm@2, if not the
npm WARN deprecated latest stable version. To upgrade to npm@2, run:
npm WARN deprecated
npm WARN deprecated   npm -g install npm@latest-2
npm WARN deprecated
npm WARN deprecated To upgrade to the latest stable version, run:
npm WARN deprecated
npm WARN deprecated   npm -g install npm@latest
npm WARN deprecated
npm WARN deprecated (Depending on how Node.js was installed on your system, you
npm WARN deprecated may need to prefix the preceding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
npm WARN deprecated will be bundled with a version of npm@2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.

we droped webpack and move to native npm and using hot loader

meteor 1.3.2.2

Work on stateless components without .jsx extension

I use .js extension everywhere throughout my application. Is it possible to add hot-reloading to stateless functional components that just use the .js extension but follow the rest of the rules, ie imports React and returns JSX syntax?

Hot reload the server

I love this package and the ability to hot reload components (and eventually styles!) on the client. It's saving me lots of development time.

That being said, every time I make a change to a shared file (which is ALL of my components to support SSR) it causes a full server reload and I can't interact with the server until the reload finishes, which for my app is around 30 seconds.

This got me thinking - is it possible to short-circuit the reload on the server and simply hot patch the server side as well?

=> Exited with code: 1 on releases > `1.3.1-fast.3`

   While building for web.browser:
   packages/casalova:user-availability-view/user-availability-view.js:11:6: Unexpected token (11:6)
   packages/casalova:routes/components/open-paging-modal.js:8:30: Unexpected token (8:30)

No idea what's wrong. This builds fine under 1.3.1-fast.3 and there's nothing abnormal happening at the spots it's referencing.

[Windows] Error: watch ENOENT

And maybe others :) Would love some help from Windows users. Otherwise will setup a Windows VM and look into this when I have a chance.

Set BABEL_ENV="production" for tests (to disable HMR)

Allow fine-tuning via package.json:

{
  "ecmascript-hot": {
    "babelEnvForTesting": "production",     // default
    "babelEnvForTesting": "development",    // any other value you want
    "babelEnvForTesting": "default"         // will use existing BABEL_ENV if set
  }
}

.babelrc not found in test mode

When I run

meteor test --driver-package practicalmeteor:mocha --port 3010

Meteor complains that it doesn't find a .babelrc file:

I20160413-01:51:38.332(2)? Creating /private/var/folders/73/1m3gx4_56hlf6vtj8rbt19qw0000gn/T/meteor-test-rundcrtvh/client/.babelrc
W20160413-01:51:38.333(2)? (STDERR)           
W20160413-01:51:38.334(2)? (STDERR) /Users/dominik/.meteor/packages/meteor-tool/.1.3.1.oynoy3++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:267
W20160413-01:51:38.335(2)? (STDERR)                             throw(ex);
W20160413-01:51:38.335(2)? (STDERR)                                   ^
W20160413-01:51:38.344(2)? (STDERR) Error: ENOENT, no such file or directory '/private/var/folders/73/1m3gx4_56hlf6vtj8rbt19qw0000gn/T/meteor-test-rundcrtvh/client/.babelrc'
W20160413-01:51:38.344(2)? (STDERR)     at Object.fs.openSync (fs.js:439:18)
W20160413-01:51:38.345(2)? (STDERR)     at Object.fs.writeFileSync (fs.js:978:15)
W20160413-01:51:38.345(2)? (STDERR)     at hot.lastHash (packages/gadicc_babel-compiler-hot.js:88:8)
W20160413-01:51:38.345(2)? (STDERR)     at packages/gadicc_babel-compiler-hot.js:190:4
W20160413-01:51:38.345(2)? (STDERR)     at packages/gadicc_babel-compiler-hot.js:625:3
W20160413-01:51:38.345(2)? (STDERR)     at /private/var/folders/73/1m3gx4_56hlf6vtj8rbt19qw0000gn/T/meteor-test-rundcrtvh/.meteor/local/build/programs/server/boot.js:283:10
W20160413-01:51:38.346(2)? (STDERR)     at Array.forEach (native)
W20160413-01:51:38.346(2)? (STDERR)     at Function._.each._.forEach (/Users/dominik/.meteor/packages/meteor-tool/.1.3.1.oynoy3++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20160413-01:51:38.346(2)? (STDERR)     at /private/var/folders/73/1m3gx4_56hlf6vtj8rbt19qw0000gn/T/meteor-test-rundcrtvh/.meteor/local/build/programs/server/boot.js:133:5
=> Exited with code: 8             

I do have a .babelrc file in my project root and running the command created another one in my client folder.

Over at the Meteor Mocha project they referred to this package.

Everything works when I run meteor. The problems only appear in test mode.

Any ideas on how to fix this?

Couldn't resolve extends clause of ../.babelrc AND Couldn't find preset "meteor" relative to directory "/home/mordrax/code/cotwmtor"

Update:
I also tried the latest package:
gadicc:[email protected]_5
and I'm running meteor 1.3.1 but still getting the errors below.

Original:
I just tried toggling my packages today to this:

#ecmascript
gadicc:ecmascript-hot

And came across two issues (I think same root cause):

Running the meteor command in the root folder threw this:
Couldn't find preset "meteor" relative to directory "/home/mordrax/code/cotwmtor"

The full meteor error is something like this:

Changes to your project's package version selections:

gadicc:babel-compiler-hot   added, version 6.6.1_1
gadicc:ecmascript-hot       added, version 1.3.1_1
gadicc:hot                  added, version 0.0.15
gadicc:json5+               added, version 0.5.0-0
gadicc:modules-runtime-hot  added, version 0.6.2_2
meteorhacks:inject-initial  added, version 1.0.4


+ In order to resolve constraints, we had to use experimental versions of these
packages.
Creating /home/mordrax/code/cotwmtor/.babelrc\
Creating /home/mordrax/code/cotwmtor/client/.babelrc
=> Starting gadicc:ecmascript-hot server on port 3002.

=> Errors prevented startup:                  

   While processing files with gadicc:ecmascript-hot (for target web.browser):

   /home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:372:17:
   Couldn't find preset "meteor" relative to directory "/home/mordrax/code/cotwmtor"
   at
   /home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:372:17
   at Array.map (native)
   at OptionManager.resolvePresets
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:364:20)
   at OptionManager.mergePresets
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:348:10)
   at OptionManager.mergeOptions
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:307:14)
   at OptionManager.addConfig
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:207:10)
   at OptionManager.mergeOptions
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:284:14)
   at OptionManager.addConfig
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:207:10)
   at OptionManager.mergeOptions
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:284:14)
   at OptionManager.init
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:465:10)
   at File.initOptions
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/index.js:194:75)
   at new File
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/index.js:123:22)
   at Pipeline.transformFromAst
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/pipeline.js:67:16)
   at /home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/index.js:53:34
   at Cache.Cp.get
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/cache.js:94:19)
   at Object.compile
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/index.js:43:23)
   at Object.Babel.compile (packages/gadicc_babel-compiler-hot.js:447:24)
   at packages/gadicc_babel-compiler-hot.js:543:24
   at Function.time (/tools/tool-env/profile.js:305:10)
   at profile (packages/gadicc_babel-compiler-hot.js:604:20)
   at packages/gadicc_babel-compiler-hot.js:542:22
   at Array.forEach (native)
   at BabelCompiler.BCp.processFilesForTarget (packages/gadicc_babel-compiler-hot.js:491:14)


   While processing files with gadicc:ecmascript-hot (for target os.linux.x86_64):

   /home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:372:17:
   Couldn't find preset "meteor" relative to directory "/home/mordrax/code/cotwmtor"
   at
   /home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:372:17
   at Array.map (native)
   at OptionManager.resolvePresets
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:364:20)
   at OptionManager.mergePresets
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:348:10)
   at OptionManager.mergeOptions
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:307:14)
   at OptionManager.addConfig
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:207:10)
   at OptionManager.mergeOptions
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:284:14)
   at OptionManager.init
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:465:10)
   at File.initOptions
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/index.js:194:75)
   at new File
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/index.js:123:22)
   at Pipeline.transformFromAst
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/pipeline.js:67:16)
   at /home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/index.js:53:34
   at Cache.Cp.get
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/cache.js:94:19)
   at Object.compile
   (/home/mordrax/.meteor/packages/gadicc_ecmascript-hot/.1.3.1_1.7nrcqi++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/index.js:43:23)
   at Object.Babel.compile (packages/gadicc_babel-compiler-hot.js:447:24)
   at packages/gadicc_babel-compiler-hot.js:543:24
   at Function.time (/tools/tool-env/profile.js:305:10)
   at profile (packages/gadicc_babel-compiler-hot.js:604:20)
   at packages/gadicc_babel-compiler-hot.js:542:22
   at Array.forEach (native)
   at BabelCompiler.BCp.processFilesForTarget (packages/gadicc_babel-compiler-hot.js:491:14)

My tests (karma, webpack) in the tests folder threw this:
Couldn't resolve extends clause of ../.babelrc in /home/mordrax/code/cotwmtor/client/.babelrc

Full error (threw one of these for each file)

ERROR in ../client/reducers/areaReducer.js
Module build failed: Error: [BABEL] /home/mordrax/code/cotwmtor/client/reducers/areaReducer.js: Couldn't resolve extends clause of ../.babelrc in /home/mordrax/code/cotwmtor/client/.babelrc
    at Logger.error (/home/mordrax/code/cotwmtor/node_modules/babel-core/lib/transformation/file/logger.js:39:11)
    at OptionManager.mergeOptions (/home/mordrax/code/cotwmtor/node_modules/babel-core/lib/transformation/file/options/option-manager.js:286:32)
    at OptionManager.addConfig (/home/mordrax/code/cotwmtor/node_modules/babel-core/lib/transformation/file/options/option-manager.js:207:10)
    at OptionManager.findConfigs (/home/mordrax/code/cotwmtor/node_modules/babel-core/lib/transformation/file/options/option-manager.js:413:16)
    at OptionManager.init (/home/mordrax/code/cotwmtor/node_modules/babel-core/lib/transformation/file/options/option-manager.js:461:12)
    at File.initOptions (/home/mordrax/code/cotwmtor/node_modules/babel-core/lib/transformation/file/index.js:194:75)
    at new File (/home/mordrax/code/cotwmtor/node_modules/babel-core/lib/transformation/file/index.js:123:22)
    at Pipeline.transform (/home/mordrax/code/cotwmtor/node_modules/babel-core/lib/transformation/pipeline.js:45:16)
    at transpile (/home/mordrax/code/cotwmtor/node_modules/babel-loader/index.js:14:22)
    at Object.module.exports (/home/mordrax/code/cotwmtor/node_modules/babel-loader/index.js:88:12)
 @ ./reducers/areasTest.js 7:19-66

"X.js is not hot" on root and relative paths.

I'm running a downgraded (from beta.8) beta.7 and I can get my pure components to hot reload which is awesome! However, I'm hitting this issue when importing from a file which just exports some JSON data.

What am I doing wrong?

image

import React, {Component, PropTypes} from 'react';
import cotw from '/client/modules/enums/enums';
import {connect} from 'react-redux';
import actions from '/client/modules/actions/index';

class AttributesView extends Component {

  render() {
    let { attributes, onChangeAttribute, cotw } = this.props;
    return (
    ...
    <div className="label">{cotw.getAttributeDescription(attribute.name, attribute.value)}</div>
    ...
    )
  }

const Attributes = connect(
  (state) => {
    return {
      attributes: state.player.attributes,
      cotw
    }
  },
  (dispatch) => {
    return {
      onChangeAttribute: (attr, val) => {
        dispatch(actions.setAttribute(attr, val));
      }
    }
  }
)(AttributesView);

Unexpected token 0.0.7-beta12

I'm running the latest version:

But it gives me this error on build:

> Errors prevented startup:                  

   While processing files with gadicc:ecmascript-hot (for target web.browser):
   client/charCreation/attributes.jsx:58:14: Unexpected token (58:14)

=> Your application has errors. Waiting for file change.
//attributes.jsx
const getAttributeDescription = (name, value) => {
  return (_.find(AttributeDescriptions[name], function (desc) {
      return value <= desc.value;
  }) || {}).text || '';  //<--------- ln: 58
};

When I remove the function it works fine. Looks like there might be some regex issues with resolving what's a component?

I'm also open to writing better components if that helps.

loop on rebuild.

loop-hot-load

i dont know what happend, but this still going sometimes.
loop about 10000 times and refresh

Possible issue with Meteor Guide testing method

Hey, I've just tried to run my tests, I think for the first time since I installed a version of hotloader that has the babel stuff. I'm now getting this error:

I20160405-18:31:41.661(1)? Creating C:\Users\Tom\AppData\Local\Temp\meteor-test-run141zaoe\client\.babelrc
W20160405-18:31:41.666(1)? (STDERR) 
W20160405-18:31:41.666(1)? (STDERR) C:\Users\Tom\AppData\Local\.meteor\packages\meteor-tool\1.3.0_3\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\fibers\future.js:
245
W20160405-18:31:41.666(1)? (STDERR)                                             throw(ex);
W20160405-18:31:41.666(1)? (STDERR)                                                   ^
W20160405-18:31:41.666(1)? (STDERR) Error: ENOENT, no such file or directory 'C:\Users\Tom\AppData\Local\Temp\meteor-test-run141zaoe\client\.babelrc'
W20160405-18:31:41.666(1)? (STDERR)     at Object.fs.openSync (fs.js:439:18)
W20160405-18:31:41.667(1)? (STDERR)     at Object.fs.writeFileSync (fs.js:978:15)
W20160405-18:31:41.667(1)? (STDERR)     at hot.lastHash (packages\gadicc_babel-compiler-hot.js:88:8)
W20160405-18:31:41.667(1)? (STDERR)     at packages\gadicc_babel-compiler-hot.js:190:4
W20160405-18:31:41.667(1)? (STDERR)     at packages\gadicc_babel-compiler-hot.js:625:3
W20160405-18:31:41.668(1)? (STDERR)     at C:\Users\Tom\AppData\Local\Temp\meteor-test-run141zaoe\.meteor\local\build\programs\server\boot.js:283:10
W20160405-18:31:41.668(1)? (STDERR)     at Array.forEach (native)
W20160405-18:31:41.668(1)? (STDERR)     at Function._.each._.forEach (C:\Users\Tom\AppData\Local\.meteor\packages\meteor-tool\1.3.0_3\mt-os.windows.x86_32\dev_bundle\server-
lib\node_modules\underscore\underscore.js:79:11)
W20160405-18:31:41.668(1)? (STDERR)     at C:\Users\Tom\AppData\Local\Temp\meteor-test-run141zaoe\.meteor\local\build\programs\server\boot.js:133:5
=> Exited with code: 8

I'm using the testing approach detailed here http://guide.meteor.com/testing.html#running-unit-tests and running the testing with meteor test --driver-package practicalmeteor:mocha --port 3100

If I switch back to ecmascript instead of gadicc:ecmascript-hot in the packages file the testing works fine. It seems like the hot code doesn't like running in the test environment and maybe can't see the .babelrc file? I don't know enough about how the testing works to know if that's an issue with the test harness or with this module?

very weird "Unable to resolve some modules:" error

Hi @gadicc ,
Sorry had to open another issue, but I had this very strange issue, you can see below, not sure this is related to meteor-react-hotloader, but I do have these npm modules installed. Do you have any clues ?

Thanks : )

Unable to resolve some modules:

  "/Users/chrishu/Projects/IncV2/upweb/node_modules/redbox-react/lib/index.js" in
/Users/chrishu/Projects/IncV2/upweb/imports/containers/NotFoundPage.js (os.osx.x86_64)
  "/Users/chrishu/Projects/IncV2/upweb/node_modules/react-transform-catch-errors/lib/index.js" in
/Users/chrishu/Projects/IncV2/upweb/imports/containers/NotFoundPage.js (os.osx.x86_64)
  "/Users/chrishu/Projects/IncV2/upweb/node_modules/react-transform-hmr/lib/index.js" in
/Users/chrishu/Projects/IncV2/upweb/imports/containers/NotFoundPage.js (os.osx.x86_64)

Cannot find module 'mongodb'

@gadicc, Really excited for this.

Currently using Meteor 1.3-modules-beta.7, as suggested, and I follow the instructions, yet I get this error when I run meteor.

screen shot 2016-02-10 at 11 30 04 am

Any suggestions? Thanks!

Issues deploying with mupx

When I tried to deploy with mupx I got the following error:

    -----------------------------------STDERR-----------------------------------
    j.target/fibers.node: Finished
      COPY Release/fibers.node
    make: Leaving directory `/bundle/bundle/programs/server/node_modules/fibers/build'
    Installed in `/bundle/bundle/programs/server/node_modules/fibers/bin/linux-x64-v8-3.14/fibers.node`
    [email protected] node_modules/ansi-regex

    [email protected] node_modules/ansi-styles

    [email protected] node_modules/escape-string-regexp

    [email protected] node_modules/supports-color

    [email protected] node_modules/has-ansi

    [email protected] node_modules/strip-ansi

    [email protected] node_modules/type-of

    [email protected] node_modules/amdefine

    [email protected] node_modules/asap

    [email protected] node_modules/underscore

    [email protected] node_modules/meteor-promise

    [email protected] node_modules/promise

    [email protected] node_modules/source-map-support

    [email protected] node_modules/semver

    [email protected] node_modules/source-map

    [email protected] node_modules/fibers
    => Starting meteor app on port:80

    => Redeploying previous version of the app

    -----------------------------------STDOUT-----------------------------------

    To see more logs type 'mup logs --tail=50'

    ----------------------------------------------------------------------------

The logs don't show anything out of the ordinary.

------------------------------------------------
Configuration file : mup.json
Settings file      : settings.json

[159.203.26.230]
> [email protected] install /bundle/bundle/programs/server/node_modules/fibers
> node build.js || nodejs build.js

make: Entering directory `/bundle/bundle/programs/server/node_modules/fibers/build'
  CXX(target) Release/obj.target/fibers/src/fibers.o
[159.203.26.230] npm WARN deprecated This version of npm lacks support for important features,
npm WARN deprecated such as scoped packages, offered by the primary npm
npm WARN deprecated registry. Consider upgrading to at least npm@2, if not the
npm WARN deprecated latest stable version. To upgrade to npm@2, run:
npm WARN deprecated
npm WARN deprecated   npm -g install npm@latest-2
npm WARN deprecated
npm WARN deprecated To upgrade to the latest stable version, run:
npm WARN deprecated
npm WARN deprecated   npm -g install npm@latest
npm WARN deprecated
npm WARN deprecated (Depending on how Node.js was installed on your system, you
npm WARN deprecated may need to prefix the preceding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
npm WARN deprecated will be bundled with a version of npm@2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
[159.203.26.230]   CXX(target) Release/obj.target/fibers/src/coroutine.o
[159.203.26.230]   CC(target) Release/obj.target/fibers/src/libcoro/coro.o
[159.203.26.230]   SOLINK_MODULE(target) Release/obj.target/fibers.node
[159.203.26.230]   SOLINK_MODULE(target) Release/obj.target/fibers.node: Finished
[159.203.26.230]   COPY Release/fibers.node
[159.203.26.230] make: Leaving directory `/bundle/bundle/programs/server/node_modules/fibers/build'
[159.203.26.230] Installed in `/bundle/bundle/programs/server/node_modules/fibers/bin/linux-x64-v8-3.14/fibers.node`
[159.203.26.230] [email protected] node_modules/ansi-regex

[email protected] node_modules/ansi-styles

[email protected] node_modules/escape-string-regexp

[email protected] node_modules/has-ansi

[email protected] node_modules/strip-ansi

[email protected] node_modules/supports-color

[email protected] node_modules/type-of

[email protected] node_modules/amdefine

[email protected] node_modules/asap

[email protected] node_modules/underscore

[email protected] node_modules/meteor-promise

[email protected] node_modules/promise

[email protected] node_modules/source-map-support

[email protected] node_modules/semver

[email protected] node_modules/source-map

[email protected] node_modules/fibers
[159.203.26.230] => Starting meteor app on port:80

'react-redbox' is not in the npm registry

I double checked on several servers:

npm ERR! node v5.7.0
npm ERR! npm  v3.6.0
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/react-redbox
npm ERR! 404
npm ERR! 404  'react-redbox' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     /tmp/npm-debug.log

Can't get this to work in a package

I have a simple package with two files. No global variables are referenced within this package. I import one component into the other. This package is then imported into another package (which does have global imports).

Do there have to be no "global" imports at all in my code for this to work, or simply none within the package that I'm trying to update?

Updating a file that's not imported by anything breaks

Originally mentioned by @clayne11 here:

As for the bug I mentioned, it's very minor. It's happening while I'm developing a new component. Typically I will create a component, start implementing it, and then later on connect it up to the UI.

When the component exists but isn't being imported by anything (which for my workflow means I'm developing it), every time I save I'm getting the error that file is undefined, I think because the file has no parent (no imports).

strange "Couldn't find preset "es2015"" error

Hi @gadicc ,

Really awesome work there : )

But when using this package following the instructions, I had this very strange error as pasted below.

best wisesh : )

=> Starting gadicc:ecmascript-hot server on port 3002.

=> Errors prevented startup:

   While processing files with gadicc:ecmascript-hot (for target web.browser):

   /Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:372:17:
   Couldn't find preset "es2015" relative to directory "/Users/chrishu/Projects/IncV2/upweb"
   at
   /Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:372:17
   at Array.map (native)
   at OptionManager.resolvePresets
   (/Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:364:20)
   at OptionManager.mergePresets
   (/Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:348:10)
   at OptionManager.mergeOptions
   (/Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:307:14)
   at OptionManager.addConfig
   (/Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:207:10)
   at OptionManager.mergeOptions
   (/Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:284:14)
   at OptionManager.addConfig
   (/Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:207:10)
   at OptionManager.mergeOptions
   (/Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:284:14)
   at OptionManager.init
   (/Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:465:10)
   at File.initOptions
   (/Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/index.js:194:75)
   at new File
   (/Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/file/index.js:123:22)
   at Pipeline.transformFromAst
   (/Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/node_modules/babel-core/lib/transformation/pipeline.js:67:16)
   at
   /Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/index.js:53:34
   at Cache.Cp.get
   (/Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/cache.js:94:19)
   at Object.compile
   (/Users/chrishu/.meteor/packages/gadicc_ecmascript-hot/.1.3.0_5.j6cxjm++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor/gadicc_babel-compiler-hot/node_modules/meteor-babel/index.js:43:23)
   at Object.Babel.compile (packages/gadicc_babel-compiler-hot.js:447:24)
   at packages/gadicc_babel-compiler-hot.js:543:24
   at Function.time (/tools/tool-env/profile.js:305:10)
   at profile (packages/gadicc_babel-compiler-hot.js:604:20)
   at packages/gadicc_babel-compiler-hot.js:542:22
   at Array.forEach (native)
   at BabelCompiler.BCp.processFilesForTarget (packages/gadicc_babel-compiler-hot.js:491:14)

String escape sequences throwing errors

So our website uses a lot of textual data from news sources, and so it's unavoidable that there be some apostrophes in the text. What I find is that this breaks the hot loading. With static text, I can set it to a variable to be read - let titleMsg = "What's your name?" <p>{titleMsg}</p>

Is there a way to fix this within the package, or should this just be noted in the README?

screen shot 2016-02-12 at 4 25 21 pm

How to make this package work with Flow Router SSR?

I keep getting this error when I do meteor with FlowRouter SSR:

                    throw(ex);
W20160329-11:21:04.996(-5)? (STDERR)                              ^
W20160329-11:21:05.030(-5)? (STDERR) Error: locals[0] does not appear to be a `module` object with Hot Module replacement API enabled. You should disable react-transform-hmr in production by using `env` section in Babel configuration. See the example in README: https://github.com/gaearon/react-transform-hmr

I had to do meteor --production or explicitly set BABEL_ENV=production meteor to make the error go away. The problem is if I do this, I don't get instant react update. Any pointers to fix this would be greatly appreciated!

[Windows] undefined\dev_bundle\lib\node_modules\fibers in refactor branch

Originally described by @Vincent-P here:

Error: Cannot find module 'undefined\dev_bundle\lib\node_modules\fibers'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at meteorRequire (C:\Users\vince\AppData\Local.meteor\packages\gadicc_ecmascript-hot\1.3.2-refactor.6\plugin.compile-ecmascript-hot.os\npm\node_modules\meteor\gadicc_hot-build\node_modules\meteor-hotload-accelerator\lib\accelerator.js:38:10)
at Object. (C:\Users\vince\AppData\Local.meteor\packages\gadicc_ecmascript-hot\1.3.2-refactor.6\plugin.compile-ecmascript-hot.os\npm\node_modules\meteor\gadicc_hot-build\node_modules\meteor-hotload-accelerator\lib\accelerator.js:41:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

It seems like this is undefined :

// meteor-hmr/accelerator/src/accelerator.js:15
const meteorToolPath = process.argv[4];

Sorry, @Vincent-P, I feel like we're sending you around in hoops :( I didn't realize you were on Windows, and we still have bugs on Windows. As soon as the rest of the branch is stable I'll work on Windows support, unless there are some Windows developers who can help me first. I'm modifying the README to make this clearer. Appreciate your patience :)

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.