-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Refactor using Webpack and JSX #84
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, Herve! A few comments to address and I'll want @dev-id to look at it :)
config/config.server.js.default
Outdated
let versionInfo = execSync('git describe --always --long') | ||
.toString() | ||
.trim() | ||
let versionInfo = "noVersion" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this always say "noVersion" or will it get the git hash?
public/src/game/Chat.jsx
Outdated
messages: [] | ||
} | ||
}, | ||
} | ||
// getInitialState() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason this is commented out?
public/src/game/Chat.jsx
Outdated
componentDidMount() { | ||
this.refs.entry.getDOMNode().focus() | ||
App.on('hear', this.hear) | ||
// this.refs.entry.getDOMNode().focus() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason this is commented out?
src/pool.js
Outdated
@@ -92,7 +92,6 @@ function toPack(code) { | |||
case 'MMA': | |||
case 'MM2': | |||
case 'MM3': | |||
case 'IMA': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Iconic masters not a specialty set?
Hey Tom, The dockerfile is already inside yes. the other PR could be closed if this one is validated. I don't know exactly what you mean by fixes on lands, box ... but this branch is deployed on https://beta-dr4ft.herokuapp.com/ is you want to get and check if there are any bugs The Makefile is gone yes, now everything should be able to run through npm, if not we can modify the package-json "scripts" module. In fact, looking at the package-json and you should also see an info for the "contributors". I added mine but didn't know if you wanted and how to write your pseudo. The app, as you can see, is up for heroku review apps |
Sounds great.
When you worked on the refactor initially, we had a lot of chats where I pointed bugs out etc. Since we have no PR description and overview what changed in addition to the refactor itself everything is a bit unclear. I'm pretty sure several issues can be closed once this is merged. While I can double check and take care of that, it would be helpful for reviewing and documenting changes in general, to have a rough list of bullet points that you addressed on top of the general code changes needed to use BabelJS for example. Like:
Because everything is in one commit it's really difficult to follow, reconstruct and review! Everybody looking at this PR (now, or in month because a bug got introduced for example) just sees 10k changed lines and has no clue what went on or what to watch out for. :) Can you please try to summarize things a bit in the description? I hope @dev-id can review it sooner than later as well - he is the only one with deeper knowledge of the code/project at all. |
Thanks @tooomm for your post, that's clear that I have to make a summary of the changes, as they are quite unreadable from this enormous blob. I'll try to explain the whole idea behing the "refactoring".
The first goal was to use JSX and ES6 features for the frontend. It's mostly used as syntaxic sugar to ease the readibility of the code. JSX forced me to use Babel to transpile into to JS. The transpiler is embedded in Webpack. I think we could get more from Webpack but I couldn't figure out how to tell him to move some dependencies to public/lib, so it's now done by the "scripts/postinstall.js" which executes at the end of the command "npm install". This also helped to get rid of the makefile. The main problem of the current application is that it needs to run "make run". This is not Heroku compliant (which requires the application to be rdy only doing "npm start" - "make" and "git" commands are not available at runtime). So I needed to make the app run only via JS. I did then a bit of refactoring on the frontend : I dispatched the components into separate files when I thought it would make better sense. The components are as dumb as I could make them so it makes them more reusable. I also did a bit of refactoring on the root directory, the default config are now in config/, scripts/ has the app, run and postinstall JS. I think that's mostly it for the main picture. About the issues, i'm gonna quick check the ones that should be closed with this PR: Thank you for your time! |
I'm good with rolling this in and establishing a new baseline |
Hey, I just pushed some fixes for a new bug Tom encountered: the flipped card were broken because the number we were checking (number) is now wrong. We have to check the "mciNumber" to know if the card is the flip instance or the normal instance. I also corrected the "error" field, which wasn't correct and deleted the useless TODO from frontend |
Hey @HerveH44 Do you think we should merge this into master at this point? It's been long enough and there are a lot of changes here that would benefit the community |
Hi @ZeldaZach , I would prefer to have some beta testing first. @tooomm made some great reviews couple weeks ago. I was thinking if it would be possible for Cockatrice players to accept to beta-test on the heroku app (https://beta-dr4ft.herokuapp.com/) for a week or 2? What do you think? We could also merge it and answer the possible bugs as they go. I start to have a bit more time this month so I could be reactive if issues arrive. |
There is no real point in merging as long as @dev-id isn't around to update the code on the server anyway? Dave has a beta page himself which should be faster than heroku and can take some more load. If we could put it there and let people know we might get some tests and feedback! |
Ok, So we need to reach @dev-id first. @tooomm could you check the new fixes ?
I updated the cmc of cards with layout aftermath. I checked cards from the original issue and it worked. But I don't know if I covered all possible layouts. Do you know where are the rules about it? The webpage wich was in the issue wasn't super clear about which cards type (aftermath, split or else...) where targeted by the new rule.
I guess it's not possible to test... I changed the panel "Start Game" to "Game", which always displays "Format" and "Info" about the format (draft, sealed, cube...) and Info (XLN/XLN/XLN, or Cube 3x15 for example). I also added these informations in the "Join Panel" of the Lobby. I did some testing, but I forgot to check the txt filename which also use the same infos. |
From #84 (comment)
More:
In addition, this includes several other changes:
e157bf
See a running version with this PR included: https://beta-dr4ft.herokuapp.com/