Skip to content
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

Update ancient emberjs version and use ember-cli #1582

Merged
merged 3 commits into from
Jun 10, 2016

Conversation

cibernox
Copy link
Contributor

@cibernox cibernox commented Jan 12, 2016

READY TO MERGE

The current version uses Ember 1.4, which is pretty ancient and the idioms are completely outdated.

This version uses Ember 2.3 and uses ember-cli as build tool.

The structure pretty different to the suggested one because of ember-cli. Ember-cli is the build took used by nearly 100% of ember projects and not using ember-cli in 2016 would be totally nuts.
I don't know if how the build system that deploys the demos works, I'll dig into it.

People in the community will review it.

@samccone
Copy link
Member

Welcome @cibernox! I am excited to have you looking at this,

Let me know when you would like a review 👀 ...


xref

#1333
#1069
#1134
#1110
#1360
#1362

@cibernox cibernox force-pushed the add-ember-cli-project branch from ddd2e30 to 707c437 Compare January 12, 2016 22:15
import Ember from 'ember';

export default Ember.Controller.extend({
todos: Ember.computed.filterBy('model', 'completed', false),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left-over comma

@samccone
Copy link
Member

@cibernox

Some things to check

  • Vendor all the dependencies for the final project in the repo
  • Tests should be green (they are really reliable)
  • Add any code that should not be linted to our root jscs file in the repo

@cibernox cibernox force-pushed the add-ember-cli-project branch 3 times, most recently from 82b2e0e to 1221e18 Compare January 12, 2016 22:49
@cibernox
Copy link
Contributor Author

@samccone Just one question. Is 4 spaces indentation a hard requirement?

@samccone
Copy link
Member

it is unless the language does not support it.

I do not like it either, but consistency wins the argument here

@cibernox cibernox force-pushed the add-ember-cli-project branch 6 times, most recently from a559557 to 01b855b Compare January 13, 2016 09:38
@cibernox
Copy link
Contributor Author

@samccone I'm back with this, after update it to ember 2.3 final, but I'm seeing some failures in travis that don't seem related with the PR itself.

Can you check the travis log to see if I'm missing something?

@addyosmani
Copy link
Member

I'm currently seeing CI failures here:


/home/travis/build/tastejs/todomvc/tests/node_modules/selenium-webdriver/lib/goog/async/nexttick.js:41
  goog.global.setTimeout(function() { throw exception; }, 0);
                                      ^
NoSuchElementError: no such element: Unable to locate element: {"method":"css selector","selector":".todo-list li"}
  (Session info: chrome=49.0.2579.0)
  (Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Linux 3.13.0-40-generic x86_64)
    at new bot.Error (/home/travis/build/tastejs/todomvc/tests/node_modules/selenium-webdriver/lib/atoms/error.js:108:18)
    at Object.bot.response.checkResponse (/home/travis/build/tastejs/todomvc/tests/node_modules/selenium-webdriver/lib/atoms/response.js:109:9)
    at /home/travis/build/tastejs/todomvc/tests/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:379:20
    at promise.Promise.goog.defineClass.invokeCallback_ (/home/travis/build/tastejs/todomvc/tests/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1337:14)
    at promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_.execute_ (/home/travis/build/tastejs/todomvc/tests/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2776:14)
    at promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_ (/home/travis/build/tastejs/todomvc/tests/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2758:21)
    at goog.async.run.processWorkQueue (/home/travis/build/tastejs/todomvc/tests/node_modules/selenium-webdriver/lib/goog/async/run.js:124:15)
    at process._tickCallback (node.js:401:9)
From: Task: WebElement.isDisplayed()
    at webdriver.WebDriver.schedule (/home/travis/build/tastejs/todomvc/tests/node_modules/selenium-

As far as I can tell, these aren't strictly related to the PR itself. Will keep digging. cc @samccone @passy in case they have any ideas.

@addyosmani
Copy link
Member

(Side: if we have time, we might want to bump to ember-cli 2.4.3 as part of this PR)

export default Ember.Controller.extend({
repo: Ember.inject.service(),
remaining: Ember.computed.filterBy('model', 'completed', false),
completed: Ember.computed.filterBy('model', 'completed', true),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these two seem to be unused, or did I miss something?

@samccone
Copy link
Member

samccone commented Apr 4, 2016

re @addyosmani a rebase off of master should resolve this test failure (it is due to selenium making a breaking change)

@cibernox
Copy link
Contributor Author

cibernox commented Apr 4, 2016

@samccone I'll rebase this and go to sleep.

@cibernox cibernox force-pushed the add-ember-cli-project branch 4 times, most recently from 3b72fa7 to d904190 Compare April 4, 2016 17:32
@cibernox cibernox force-pushed the add-ember-cli-project branch 3 times, most recently from 324edde to d797874 Compare May 20, 2016 11:08
@cibernox
Copy link
Contributor Author

@samccone I'm resuscitating this but I still have no idea how to make tests pass. I think that whatever the test runner is doing, it doesn't like my file structure.

Who can give me a hand with this?

@cibernox cibernox force-pushed the add-ember-cli-project branch from d797874 to c5a0e53 Compare May 20, 2016 21:32
@cibernox
Copy link
Contributor Author

Ok, I figure this out. I'll let someone else review the code but should be good to go in a couple days top.

startEditing() {
this.get('onStartEdit')();
this.set('editing', true);
Ember.run.scheduleOnce('afterRender', this, 'focusInput');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a bit hackish :\

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Afaik there is no other way.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would moving it to didRender wouldn't work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didRender will be called whenever this component is rendered or rerendered, while this is a one-time only action. This has to happen specifically after this action and never again.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autofocus attr doesn't work here?

@cibernox cibernox force-pushed the add-ember-cli-project branch 2 times, most recently from 24e4a1f to 2faec97 Compare May 21, 2016 17:52
@cibernox cibernox force-pushed the add-ember-cli-project branch from 2faec97 to b72d5e5 Compare May 21, 2016 17:54
@cibernox
Copy link
Contributor Author

This PR is done. Feel free to merge.

Ember 2.6 and Ember-cli 2.6 will be out next week and I'll update this then. I intend to keep this up to date from now own and avoid it to fall far behind again.

@samccone
Copy link
Member

oh awesomeeeee 👯 we just need someone who knows ember to review this... any ideas?

@cibernox
Copy link
Contributor Author

@samccone I think that Ember 2.6 is going to be released tonight, so I'll wait one more day before merging. I'll ask someone in the core team to sanction this PR.

export default Ember.Service.extend({
lastId: 0,
data: null,
findAll() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a blank line above, just stylistic purposes?

@samccone
Copy link
Member

💥 time to land this one :)

Thanks a million @cibernox

@samccone samccone merged commit 8019b40 into tastejs:master Jun 10, 2016
@cibernox cibernox deleted the add-ember-cli-project branch June 10, 2016 12:53
@cibernox
Copy link
Contributor Author

@samccone Do I need to create another PR to point the Ember.js version in the main page to this version instead of the 1.10 one?

@samccone
Copy link
Member

samccone commented Jun 10, 2016

@cibernox no :)

Looks like something broke in our autodeploy script
#1635

I am going to investigate --- when that is fixed then things will autoflow from here. I plan on taking a look after my workday ends today.

@cibernox
Copy link
Contributor Author

This example didn't replace the old one. It was created with a different name (ember-cli), so I don't think it can be automated.

@samccone
Copy link
Member

oh right of course :P Yeah we can switch up the link quite easily

@cibernox
Copy link
Contributor Author

Maybe it could replace it tho, because saying Ember today effectively means saying ember + ember-cli. It is the officially sanctioned path.

@samccone
Copy link
Member

I am 100000% fine with removing it since the old one is very outdated. git mv FTW

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants