-
Notifications
You must be signed in to change notification settings - Fork 76
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
Marty v0.9 #137
Marty v0.9 #137
Conversation
This looks like a very good step forward :). Need any help? |
Hey, yeah would love some help 😄 Would you be interested in picking up #132? I was playing around with it the other day but got distracted... Completely agree on Babel, I started re-writing everything to be ES6 classes the other day. It makes isomorphisim a whole load easier if everything's instantiatable. Things like |
I'd be happy to help test when you need it 👍 |
This looks awesome - we are really hoping to use marty for new project but lack of server rending is a dealbreaker. Can pitch in some support testing things. |
@jhollingworth quick one, have you considered migrating the testing suite to |
Jest is cool however it would require converting all tests from mocha to jasmine. Also, I don't think it integrates well with SauceLabs (thats based on a quick google so could be wrong). |
7d878c1
to
ccde31e
Compare
@jhollingworth on mocha/jest: jestjs/jest#139 |
Just had a quick look at this to have a play with the server rendering but having some issues with webpack: First I got this sort of thing:
which I'm guessing is the es6 stuff. I added
which makes the errors go away - but breaks the
|
@Dakuan does it tell you what line that error is thrown on? |
@Dakuan can you paste your full |
managed to fix with this webpack config: {
test: /\.(jsx|es6|js)$/,
loader: 'babel-loader',
include: /(?=src)|(?=node_modules\/marty)/
} and by disabling the marty chrome plugin |
@Dakuan awesome! I going to start on a webpack demo soon so this will be useful 😄 |
Good point about Marty Developer Tools, have added it to the list of things to look at. Thanks |
Yep! Some progress but not out of the woods yet. When trying to require (on the server) a file that is connected with the marty app eg some kind of entry point like A natural thing to do is to try and use the babel require polyfill from here https://babeljs.io/docs/usage/require/ . This still won't work yet as marty is ignored by babel due to it being in Anyway, that spins for a while and then we get:
Here is how I get babel running:
|
I should add that babel appears to be otherwise working, this test es6 class works as expected: class Thing {
log () {
console.log('mew');
}
}
module.exports = Thing; |
I was about to suggest |
Which package do you mean? Can't seem to find it here: https://www.npmjs.com/search?q=babel-node |
It's a binary that babel installs |
It might be easier if node consumes the built files rather than having to get people to add shims or use different JS environments. Although that has the downside of making it slightly more painful to debug |
Yeah I tried requiring require("babel/register")({
ignore: false
});
var app = require('./app'); gives:
and without babel: // require("babel/register")({
// ignore: false
// });
var app = require('./app'); gives:
|
I'm wondering if es6 is more trouble than its worth for a lib that wants to be able to run anywhere. 😿 |
I've thought the same a few times recently... Once Marty.Component is done I'm going to focus on simplifying getting it to work on node. Hopefully this will be much better next week! Thanks for all you're help trying this out, very much appreciated! |
@jhollingworth could we add another dist output that is precompiled into ES5? By default marty could be es5, but if you want to use ES6 you could do require("marty/es6") or something |
We're feature complete on this release so I've publish Marty v0.9.0-rc1. I've updated the chat example (including isomorphism) if anyone is interested in what it looks like |
Brilliant!! :) It's going to be an amazing release! I was wondering if it should actually be I'm working on a fully class-ified structure right now, will put that up as an example too. Will have a look at the chat example later on today and comment on it. |
Good point about v1.0. My only concern is React isn't stable yet so we might have to change the APIs (e.g. How we use contexts). Maybe it's worth waiting until React 1.0 comes out?
|
Good stuff :) In all fairness, |
Last major blocker (beyond pending tasks) is react-router v0.13 remix-run/react-router#638 |
On that: #186 :). The way I see it, an agnostic framework wouldn't make assumptions as to what routing you want to use. Therefore |
Oh completely. its just that marty-express currently only works with react-router (although plan is to allow any router to integrate). Isomorphisim is one of the major features for v0.9 so want everything working together before I release |
Class! Good to know it was already on your mind too :) I'm glad to help towards getting the next version on a modular approach if that's desirable |
I'll be running an upgrade over the next few weeks (probably next week) on
|
Thanks @dariocravero that'd be awesome 👍 |
v0.9 docs are available here http://martyjs.org/v/0.9.0-rc2/ |
@FoxxMD here's a rough guide (by example). Will try to write it up a bit better these days. |
thanks! |
Improvements
Store#dehydrate
andStore#hydrate
(ReplacingStore#serialize
andStore#getInitialState(stateFromServer)
)Work out if we can stop having to callDon't think its possible right now, React has the same problemsuper
this.state = ..
instead ofgetInitialState
.Marty.Component
dataType
option to http state source (Accept request header for json #161)FETCH_FAILED
action (storeId, fetchId, error)Store#clear
(clear fetchHistory in clear() #149)RoutingWill release this separatelyStore#getInitialState
in clear if presentBugs
Tasks