GithubHelp home page GithubHelp logo

marionette.upgrade's People

Contributors

amirnissim avatar beng-hee-eu avatar davidsulc avatar haroldkyle avatar jamesplease avatar jasonlaster avatar jdaudier avatar ryotakato avatar samccone 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marionette.upgrade's Issues

run in windows

update files

file upgrade.py

add import os

rom os import *
import os
import sys

change the command line
from

codemod = "./bin/codemod.py"

to

codemod = "python %s" % os.path.join(os.path.dirname(os.path.abspath(__file__)), "bin", "codemod.py")

file bin/codemod.py

comment line 745

  # sys.stdout.write(curses.tigetstr('sgr0'))

add curse

goto http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses
download and install

run script

workaround to codemod issue: facebookarchive/codemod#32
open cmd
cd your project to upgrade

run script

python c:\Marionette.Upgrade\upgrade.py .\

Add a CLI Preview tool

It'd be great if you could preview the changes that were going to be made.

A sample preview would look like:

53 Changes
5 CollectionView changes
10 ItemView changes

Not replacement itemView -> childView

Hi, This is Nice tool ! Thank you.

I try change Marionette 1.8 -> Marionette 2.2.
But did'nt replace "itemView" to "childVIew" in CollectionView .

Code is

  return Backbone.Marionette.CollectionView.extend({
    itemView: SampleView,
    tagName:"ul",
    initialize: function() {
    }
  });

Why not ? Colon ?

Wrong code

125 subMethod("addChildView", "onChildAdd")
126 subMethod("removeItemView", "onChildRemove")

@close => .destroy (coffeescript)

for code in which a view has a method to close (now destroy itself), the coffeescript might have looked like:

  goAway:  ->
       @close()

and upgrade.py proposes to replace this with:

  goAway:  ->
       .destroy()

rather than:

 goAway: ->
      @destroy()

Problems running upgrade.py for Windows7

Hi, I was able to successfully upgrade a project to Marionette 2.0.1 in Linux but I'm having problems with a similar project in my Windows7 environment.

Windows7 seems to be having problems with the print statement in line #27

I installed Python 2.7.8

I've tried both the DOS cmd console and the git/bash console. It no worky...

upgrade py output

Any ideas?

Run error

OS X - Python 2.7.5

Traceback (most recent call last):
  File "upgrade.py", line 1, in <module>
    from sub import *
ImportError: No module named sub

Skip whole file with `d`

Like git add -p, an option to skip a whole file with d would be awesome.
All in all, the best upgrading experience I ever had :)

"Replace:" prompts can be skipped (?)

The thing that asks whether you'd like to replace a category of changes seems to either skip some categories, or (if it's only asking for things it found) ask to replace things it hasn't found.

Example:

Replace:

    "itemViewEventPrefix"  with  "childViewEventPrefix"

[y,n,q]


Searching for first instance...

Replace:

    "itemViewOptions"  with  "childViewOptions"

[y,n,q] y



Searching for first instance...

Replace:

    "itemEvents"  with  "childEvents"

[y,n,q]


Searching for first instance...

Replace:

    "itemViewContainer"  with  "childViewContainer"

[y,n,q] _

Note that the first prompt, for itemViewEventPrefix » childViewEventPrefix, doesn't have a y/n/q response; it didn't open a prompt for input at the question, and instead skipped right to the itemViewOptions » childViewOptions prompt. That one lets me answer "y", but doesn't find anything, and then it shows the itemEvents » childEvents replacement but doesn't let me answer the question, instead it goes straight to the itemViewContainer » childViewContainer prompt.

"closest" -> "destroyst"

upgrade.py wants to replace a call to jQuery's $.fn.closest with destroyst. It appears to be finding the "close" substring and trying to replace with "destroy".

      isInteractive: ($target) ->
-       $target.closest('.actions').length or $target.is('.close')
+       $target.destroyst('.actions').length or $target.is('.close')

      showThumbnail: ->

Potentially related: #21

UI should explain first step

I see this when first starting upgrade.py:

Replace:

    '.close\('  with  '.destroy('

[y,n,q] _

Based on the readme, I expected to see a diff with some context and a file name and line number. Instead I think this is going to blanket-replace all instances of .close( with .destroy(, which I don't actually want to do.

It would be nice if the UI explained that I am selecting whether or not I want to attempt to replace any calls of .close( with .destroy(.

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.