kov-blog icon indicating copy to clipboard operation
kov-blog copied to clipboard

Migration to Vue 2.0

Open fizerkhan opened this issue 8 years ago • 15 comments

Is there any plan to migrate a Vue 1.x app to 2.0?

fizerkhan avatar Dec 16 '16 10:12 fizerkhan

Recently I'm working on another Vue 2.0 project: leetcode-viewer. If you just need an Vue 2.0 example, leetcode-viewer and the demo may be a candidate. In view of the current works, it seems that it's not difficult to use Vue 2.0. So surely I will migrate this project to 2.0. But sorry to tell you that the migration won't be done recently for time reason.
The deadline of my master paper makes me mad. :sob: :sob:

Ma63d avatar Dec 16 '16 14:12 Ma63d

@Ma63d Thanks for the quick update. I understood your priorities. I will take a loot at leetcode-viewer

One small suggestion: If you have simple login management, it could not very useful in the current project.

fizerkhan avatar Dec 16 '16 15:12 fizerkhan

@fizerkhan could not very useful?

Ma63d avatar Dec 16 '16 16:12 Ma63d

@Ma63d We are thinking to use this project for our internal docs, it will great if we have signup options. So everyone can login and update docs. Also if there is any support for english, that will be awesome.

fizerkhan avatar Dec 16 '16 16:12 fizerkhan

@Ma63d If you take this project in the direction of knowledge base docs instead of just blogs, that will be awesome since there are not much better knowledge base open source projects. But we have too many static blog tools.

fizerkhan avatar Dec 16 '16 16:12 fizerkhan

I understand your needs. But the blog is created just for personal presentation. If I upgrade it to an multi-user blog, the total blog need to be fully changed and recreated, including the table of database, the backend logic and UI.

I've designed some functions based on my previous experience in writing blog posts to make the blog more conveniently used. For example, this blog admin is like a note app, which means you can write a note and whenever you think the content has substantial content and depth, publish it. So as far as i am concerned, the blog is convenient. If I change it to knowledge base docs, some functions must be off and the blog will get more difficult to use than now.

There are a lot of open-source multi-user blog projects, such as b2evolution, LifeType.More generic, wordpress, duraple both meet your need. And this one: koa blog. By the way, I think confluence is the best one for your internal docs and team collaboration.

Ma63d avatar Dec 16 '16 17:12 Ma63d

@Ma63d Yes you are correct. I agree with you. I also really love the concept of writing my blog just like a note. I might be wrong because I was thinking that it will be useful for other support docs purpose too.

Okay. Now lets focus on migration alone.

fizerkhan avatar Dec 17 '16 08:12 fizerkhan

@fizerkhan I recently wrote a multi-user blog based on vue2.1, https://github.com/ZinCode/vue-ssr-blog-client Currently the project is still under development, you can focus on this project, a few days later this project will be on the line,forgive me poor English level

jsm1003 avatar Dec 21 '16 01:12 jsm1003

@ZinCode Thanks. For me too, English is the second language. Unfortunately I don't know Mandarin. However I will take a look at it.

fizerkhan avatar Dec 21 '16 14:12 fizerkhan

BTW , Is there any plan to migrate a Koa 1.x app to 2.0? Wish all the best for your master paper @Ma63d

Hellowor1d avatar Apr 18 '17 17:04 Hellowor1d

Thx @Hellowor1d . Migration of Koa 2.x is important but not difficult. The next version will both upgrade Vue, koa and use SSR.

Ma63d avatar Apr 19 '17 01:04 Ma63d

^^厉害了老铁,先star了,等你升级完毕,期待能给出攻略

sfyr111 avatar Jun 21 '17 07:06 sfyr111

@sfyr111 已经在抽空升级了,可以查看 v2 分支。server 端改动了一下,升级了 koa v2, 重新设计了一下代码逻辑,加入了评论功能,封装了 schema 层和加入了切面编程。前端也还在改。admin 部分的 vue v2改造还没完成。最近入职新的实习公司,忙成猪头,最近怕是没时间再改了,只能后续再加油。

目前的升级计划如下:

  • 升级 vue 全家桶至2.x版本
  • 升级 koa 至2.x版本
  • 升级 webpack 至2.x版本
  • 增加服务器端渲染( SSR )
  • 增加 PWA , 主要是推送功能与启动页
  • 自己手动实现评论功能,去掉了多说
  • 样式小幅更改
  • 将1.x版本中考虑的 [隐藏已发布文章] 功能完成
  • 增加打包完成后的 CDN 上传配置
  • 上HTTPS
  • 可能 基于七牛云 API 实现图片粘贴上传功能, 极简图床这次更新是在太傻逼, 不想用了, 有余力就自己搞粘贴上传

Ma63d avatar Jun 21 '17 07:06 Ma63d

token登录这我看你的代码,有个问题: 就是token在后台路由中写了一个router.get('/tokens/check',mw.verify_token,check); 这段代码没有看懂,作用是?验证token不是在前台请求头中,发到后台了么,这个是不是调试时拉下的?要不就是有作用没有看明白

jixianu avatar Jun 29 '17 17:06 jixianu

@jixianu check 是单纯用来测试 [带了 token 的话是否能通过外部 mw.verify_token 的检查正确抵达业务逻辑],确实是单纯 debug 用的,因为上线之后也依然用这个接口进行测试了一下。所以就在 master 分支里保留了。最近升级 v2 分支时已经干掉了。

建议不要看 master 分支的代码,最开始写的时候,写的很急,几乎所有的逻辑都在 controller 层,model 层实则只是个输出 ORM 的摆设。业务报错、校验等逻辑都没有切分。controller层又重又乱。 v2 分支改善了这些问题。

但是 v2 分支最近只是改完了 server 部分和 一些 admin 部分,暂时停滞着。

Ma63d avatar Jun 30 '17 04:06 Ma63d