Giter Site home page Giter Site logo

appsforartists / ambidex Goto Github PK

View Code? Open in Web Editor NEW
581.0 581.0 31.0 168 KB

Effortlessly host your React app on both the client and the server. Some call it isomorphic JavaScript - we call it Ambidex.

License: MIT License

JavaScript 95.16% CSS 4.84%

ambidex's People

Contributors

amitport avatar apaatsio avatar appsforartists avatar gaearon avatar gitter-badger 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ambidex's Issues

Performance Tuning

Considering we are using webpack, maybe we should use it in order to remove this:

require("node-jsx").install(
  {
    "extension":  ".js",
    "harmony":    true
  }
);

at every init.js of projects that use ambidex.

Any thoughts?

Non hot-module mode causes expensive use of memory, more than 1G of mem

Actually appears to be UglifyJs fault:

if (options.hasOwnProperty("minimizeFileSize") && options.minimizeFileSize) {
    settings.plugins.push(
      new Webpack.optimize.UglifyJsPlugin(
        {
          "output":   {
                        "inline_scripts":   true
                      }
        }
      )
    );
  }

When I comment this lines, the bundle is building without problems.

This is a problem when you have a machine (or a Vagrant box) running with 1G as a limit.

Resolving React Routers redirects in the server

Building an app with auth polices, we had a need to redirect to the login page, but, in order to know if the user is logged in or not, I had to use my service's instance lib.
I'm using the @bobpace branch for adding some context data in the willTransition hooks.

But, the problem is that I can't redirect the response from the onAbort() function, example:
https://github.com/TallerWebSolutions/ambidex/blob/transition-to-context/src/Ambidex.server.js#L379-L398

I tried some things like:

connection.redirect(stack);

then....

connection.redirect(stack);
return connection.call(stack);

nope...

resolve(connection);

errors everywhere....

I'm a little lost here, some help?

Umm... how do I fire this up??

Obviously this isn't it... :)

$ node Ambidex.server.js
/Users/Dan/Code/ambidex/src/Ambidex.server.js:15
                            (path) => {
                                   ^^
SyntaxError: Unexpected token =>
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

Sourcemap functionality

"devtool" : "source-map"

This one is better than the other possibilities, so it keeps the large sourcemap files out of the original jsx.js source.

I tossed it into the end of of function getSettings in createWebpackSettings.js but yeah some ENABLE_SOURCE_MAPS flag would be better. :)

Inline css

Do you have any ideas of how you're going to go about implementing inline CSS? Just curious!

How do you handle server side global singletons ?

Hey Brenton,

I was also working on a similar idea :) I think you didn't really answer the question the first guy asked at the conf.

I believe he meant that app globals like stores need to be encapsulated while rendering on the server because the server needs to handle concurrent requests. How are you dealing with this issue ?

Thanks!
J

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.