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

Migration guide #4

Open
mhulse opened this issue Jan 31, 2017 · 8 comments
Open

Migration guide #4

mhulse opened this issue Jan 31, 2017 · 8 comments

Comments

@mhulse
Copy link

mhulse commented Jan 31, 2017

Coming from Director, I was not able to make a quick switch to tarantino.

Setting aside the discussions of the future/direction of this repo, I think it would be of help Director users to have a director -> tarantino migration guide.

I have only been using the browser implementation, so I would be of no help for writing a TL;DR for the server-side/node bits … Though, I would not mind making notes for the browser part.

Thoughts?

@SpaceK33z
Copy link

SpaceK33z commented Jan 31, 2017

I'm only using the browser part too. I didn't change anything to the other implementations. There were only a few changes to the browser part, but it shouldn't break too much stuff. The biggest change was that I switched the module bundler from CodeSurgeon (which is deprecated), to Rollup. Also I enabled html5history API by default.

@mhulse
Copy link
Author

mhulse commented Jan 31, 2017

Ah, the html5history API may have been breaking my non-html5history setup when doing the switch. I'll try again and make notes; I will update this issue once I have something. At a bare minimum, maybe having this issue will suffice in terms of a guide. 👍

Thanks!

@mhulse
Copy link
Author

mhulse commented Feb 1, 2017

Ah, the html5history API may have been breaking my non-html5history setup when doing the switch.

I think the real reason why html5 history did not work is because my app was not deployed at the root of my local dev. I could be wrong, but it seems like html5 option requires a site deployed at the root of the url.

http://stackoverflow.com/questions/10045540/history-pushstatedata-title-url-concatenates-instead-of-replacing-url-to-add

Still learning about html5 pushstate and replacestate, so bare with me.

@SpaceK33z
Copy link

It doesn't really require the app to be at your root, but if it's not at the root you need some additional config. In that case, you should append the path to the route url:

{
  '/mypath/dog': function() {},
  '/mypath/cat': function() {},
}

You're probably thinking now, that's fucked up, and it is. However, you could "automate" this by setting this path in a variable and use that each time. Or, but I haven't tested this, you could do something like this:

{
  '/mypath': {
     '/dog': function() {},
     '/cat': function() {},
  }
}

@mhulse
Copy link
Author

mhulse commented Feb 1, 2017

t doesn't really require the app to be at your root, but if it's not at the root you need some additional config.

Ahh, I see! Thanks for the tips!

I will be officially making the switch today and will update this issue if I run into any issues. :octocat:

@mhulse
Copy link
Author

mhulse commented Feb 3, 2017

One thing I noticed was that I needed to call the router like so:

tarantino.Router(......)

The docs just specify "Router".

I can do a PR to correct this, unless I am overlooking something. 👍

@SpaceK33z
Copy link

@mhulse ah yes that seems to be wrong in the first example. Btw, we could update the Node.js examples to be const { Router } = require('tarantino');, that's a bit more fancy.

@mhulse
Copy link
Author

mhulse commented Feb 4, 2017

ah yes that seems to be wrong in the first example. Btw, we could update the Node.js examples to be const { Router } = require('tarantino');, that's a bit more fancy.

Awesome, I'll update the docs. 👍

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

No branches or pull requests

2 participants