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

Olives: update to olives and emily 3.x, remove dependency on requirejs, Fixes #1029 #1242

Closed
wants to merge 1 commit into from

Conversation

podefr
Copy link
Contributor

@podefr podefr commented Mar 31, 2015

Hi,

This PR should fix #1029 (focus on load). The issue was fixed by updating olives and emily to their 3.0.x version.

The changes in this PR are:

  1. Update to emily 3.0.3
  2. Update to olives 3.0.5
  3. Remove dependency on requirejs
  4. Use node's require to replace requirejs
  5. Use browserify to bundle the application
  6. Update HTML to only load the bundle
  7. Add a "build" and "watch" scripts to package.json to build the app
  8. Use lowercase names for the UI components as they were never actually newed up.

This PR doesn't add the routing feature, this will come in a future PR as I'm working on it.

Thanks,
Olivier

@podefr podefr changed the title Olives: update to olives and emily 3.x, remove dependency on requirejs Olives: update to olives and emily 3.x, remove dependency on requirejs, Fixes #1029 Mar 31, 2015
@podefr podefr mentioned this pull request Mar 31, 2015
7 tasks
@arthurvr
Copy link
Member

Thanks! I'll review this shortly.

},
"scripts": {
"build": "browserify ./js/app.js -o olives-todo.js",
"watch": "watchify ./js/app.js -o olives-todo.js"
Copy link
Member

Choose a reason for hiding this comment

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

package.json files use 2 spaces indentation.

@arthurvr
Copy link
Member

This PR should fix #1029 (focus on load). The issue was fixed by updating olives and emily to their 3.0.x version.

Works for me in firefox, but not in Chrome or Safari. Could you double-check it?

@arthurvr
Copy link
Member

This PR doesn't add the routing feature, this will come in a future PR as I'm working on it.

Thanks, awesome!

@podefr
Copy link
Contributor Author

podefr commented Mar 31, 2015

Thanks for your feedback, I'll update this later on today and will push a new commit.

@podefr
Copy link
Contributor Author

podefr commented Apr 1, 2015

I converted the spaces to tabs and added the newlines at the bottom of each JS file, although they don't seem to appear in github.
I double-checked in safari 8.0.4/chrome 43/firefox 31, and I do get the autofocus on the input field on load. Is anybody else seeing the same issue?

@podefr
Copy link
Contributor Author

podefr commented Apr 1, 2015

oh and btw, let me know if you want me to squash the commits before merging

@arthurvr
Copy link
Member

arthurvr commented Apr 1, 2015

LGTM at the moment. No idea what was going on with the autofocus as atm it works fine for me as well :/ All tests pass for olives except the routing. Awesome work @podefr! If nobody objects I'm gonna land this one.

"olives": "^3.0.5",
"todomvc-app-css": "^1.0.1",
"todomvc-common": "^1.0.1"
},
Copy link
Member

Choose a reason for hiding this comment

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

Oh, one little thing, Browserify and watchify will need to be in the dev deps.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, I'll fix it and push a new commit later on today

Copy link
Member

Choose a reason for hiding this comment

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

@podefr Thanks

@podefr podefr force-pushed the update-olives-3 branch from d97ed60 to 05e6a07 Compare April 2, 2015 03:44
@podefr
Copy link
Contributor Author

podefr commented Apr 2, 2015

I've added browserify and watchify to the package.json and squashed all the commits. Thanks for taking the time to review this @arthurvr!

@arthurvr
Copy link
Member

arthurvr commented Apr 2, 2015

Great!

@@ -1,4 +1,3 @@
/*global define*/
(function () {
Copy link
Member

Choose a reason for hiding this comment

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

the iffy wrapper seems odd now that we are using commonjs right?

Copy link
Member

Choose a reason for hiding this comment

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

👍

@samccone
Copy link
Member

samccone commented Apr 2, 2015

I am not sure we want to delete

examples/olives/node_modules/todomvc-app-css/index.css

@podefr podefr force-pushed the update-olives-3 branch 2 times, most recently from af586c1 to 92fdf4f Compare April 3, 2015 20:00
@podefr
Copy link
Contributor Author

podefr commented Apr 3, 2015

@samccone, index.css hasn't been deleted, don't know why github is confused. It has been modified though, probably when updating the dependencies.

Here's what the file looks like as of this commit:

https://github.com/tastejs/todomvc/tree/92fdf4fbd67132df26ee468d46304bcbe9cbad88/examples/olives/node_modules/todomvc-app-css

@podefr
Copy link
Contributor Author

podefr commented Apr 8, 2015

@arthurvr @samccone I believe I've answered all your comments, let me know if there's anything else I can do so you can close this, thanks.

} else {
this.classList.remove(className);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

For this file same thing as #1242 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

And it looks like all the other files as well. package.json is the only one that shouldn't use tabs.

@podefr podefr force-pushed the update-olives-3 branch from 92fdf4f to 94af548 Compare April 9, 2015 01:47
@podefr
Copy link
Contributor Author

podefr commented Apr 9, 2015

@arthurvr done!

@samccone
Copy link
Member

samccone commented Apr 9, 2015

hi @podefr looks like you have a failing spec

 TodoMVC - olives
    When page is initially opened
      ✓ should focus on the todo input field
    No Todos
      ✓ should hide #main and #footer (74ms)
    New Todo
      ✓ should allow me to add todo items (381ms)
      ✓ should clear text input field when an item is added (175ms)
      ✓ should append new items to the bottom of the list (468ms)
      ✓ should trim text input (213ms)
      ✓ should show #main and #footer when items added (221ms)
    Mark all as completed
      ✓ should allow me to mark all items as completed (494ms)
      ✓ should allow me to clear the completion state of all items (556ms)
      ✓ complete all checkbox should update state when items are completed / cleared (585ms)
    Item
      ✓ should allow me to mark items as complete (480ms)
      ✓ should allow me to un-mark items as complete (441ms)
      ✓ should allow me to edit an item (771ms)
      ✓ should show the remove button on hover
    Editing
      ✓ should hide other controls when editing (443ms)
      ✓ should save edits on enter (666ms)
      ✓ should save edits on blur (847ms)
      ✓ should trim entered text (818ms)
      ✓ should remove the item if an empty text string was entered (634ms)
      ✓ should cancel edits on escape (735ms)
      1) "after each" hook

  20 passing (45s)
  1 failing

  1) TodoMVC - olives "after each" hook:
     Uncaught AssertionError: 3 items expected in the todo list, 2 items observed
      at /Users/sam/Desktop/repos/todomvc/browser-tests/testOperations.js:126:12
      at _fulfilled (/Users/sam/Desktop/repos/todomvc/browser-tests/node_modules/q/q.js:794:54)
      at self.promiseDispatch.done (/Users/sam/Desktop/repos/todomvc/browser-tests/node_modules/q/q.js:823:30)
      at Promise.promise.promiseDispatch (/Users/sam/Desktop/repos/todomvc/browser-tests/node_modules/q/q.js:756:13)
      at /Users/sam/Desktop/repos/todomvc/browser-tests/node_modules/q/q.js:564:44
      at flush (/Users/sam/Desktop/repos/todomvc/browser-tests/node_modules/q/q.js:110:17)
      at process._tickCallback (node.js:419:13)

@podefr
Copy link
Contributor Author

podefr commented Apr 13, 2015

@samccone I pulled down the latest master and ran:

npm run test -- --framework=olives

but I'm not seeing any failing test apart from routing. Can you double-check?

   TodoMVC - olives
    When page is initially opened
      ✓ should focus on the todo input field
    No Todos
      ✓ should hide #main and #footer (79ms)
    New Todo
      ✓ should allow me to add todo items (313ms)
      ✓ should clear text input field when an item is added (145ms)
      ✓ should append new items to the bottom of the list (336ms)
      ✓ should trim text input (149ms)
      ✓ should show #main and #footer when items added (185ms)
    Mark all as completed
      ✓ should allow me to mark all items as completed (366ms)
      ✓ should allow me to clear the completion state of all items (397ms)
   TodoMVC - olives
    When page is initially opened
      ✓ should focus on the todo input field
    No Todos
      ✓ should hide #main and #footer (73ms)
    New Todo
      ✓ should allow me to add todo items (303ms)
      ✓ should clear text input field when an item is added (143ms)
      ✓ should append new items to the bottom of the list (347ms)
      ✓ should trim text input (154ms)
      ✓ should show #main and #footer when items added (185ms)
    Mark all as completed
      ✓ should allow me to mark all items as completed (369ms)
      ✓ should allow me to clear the completion state of all items (381ms)
      ✓ complete all checkbox should update state when items are completed / cleared (424ms)
    Item
      ✓ should allow me to mark items as complete (375ms)
      ✓ should allow me to un-mark items as complete (326ms)
      ✓ should allow me to edit an item (524ms)
      ✓ should show the remove button on hover
    Editing
      ✓ should hide other controls when editing (318ms)
      ✓ should save edits on enter (521ms)
      ✓ should save edits on blur (612ms)
      ✓ should trim entered text (533ms)
      ✓ should remove the item if an empty text string was entered (471ms)
      ✓ should cancel edits on escape (449ms)
    Counter
      ✓ should display the current number of todo items (232ms)
    Clear completed button
      ✓ should display the number of completed items (375ms)
      ✓ should remove completed items when clicked (403ms)
      ✓ should be hidden when there are no items that are completed (369ms)
    Routing
      1) should allow me to display active items
      2) should respect the back button
      3) should allow me to display completed items
      4) should allow me to display all items
      5) should highlight the currently applied filter


  24 passing (44s)
  5 failing

@podefr
Copy link
Contributor Author

podefr commented Apr 19, 2015

@samccone @arthurvr seems like the tests are passing for me (expect for routing), can you double check and maybe close this PR that's been open for 20 days? I'll add routing as part of another PR.

Thanks,
Olivier

@arthurvr
Copy link
Member

@podefr Indentation is still wrong. Otherwise I'm fine with landing this as olives doesn't pass the specs in master too.

@podefr
Copy link
Contributor Author

podefr commented Apr 19, 2015

thanks @arthurvr, fixing the indent now. I had never saw the comment above about using tabs instead of spaces :/

@podefr
Copy link
Contributor Author

podefr commented Apr 19, 2015

@arthurvr done

@arthurvr
Copy link
Member

@samccone I can actually confirm the failing test, but the spec which is failing is due to #789, which is another issue and thus not topic for this PR.

"scripts": {
"build": "browserify ./js/app.js -o olives-todo.js",
"watch": "watchify ./js/app.js -o olives-todo.js"
},
Copy link
Member

Choose a reason for hiding this comment

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

Mind adding a note about these scripts in the examples/olives/readme.md? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@arthurvr
Copy link
Member

one last comment, for the rest this looks good.

@arthurvr
Copy link
Member

Oh, and, thanks for your hard work!

@samccone
Copy link
Member

👏

@podefr
Copy link
Contributor Author

podefr commented Apr 26, 2015

@arthurvr @samccone I've updated the README with the notes about the two scripts. When this is merged in, I'll add the router

npm install
```


Copy link
Member

Choose a reason for hiding this comment

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

remove these lines :)

@arthurvr
Copy link
Member

Instead of nitpicking more I'll land this this and do some tweaks myself! Once again, awesome work!

@arthurvr arthurvr closed this in 5a3c81c Apr 27, 2015
@arthurvr
Copy link
Member

When this is merged in, I'll add the router

That would be super awesome!

mhoyer pushed a commit to mhoyer/todomvc that referenced this pull request Dec 5, 2015
* Update to the latest version of the Olives framework.
* Update to the latest version of Emily
* Remove requirejs in favor of browserify
   - also implemented npm scripts and updated the readme

As a result of updating dependencies, this fixes the issue in tastejs#1029.

Ref tastejs#1029
Close tastejs#1242
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Focus on load
4 participants