关于我的项目和这些 JavaScript 框架,我哪里做错了?

首先,我希望创建的项目的基本框架是一个作为单页面 Web 应用程序实现的 wiki 引擎。我计划从一开始就拥有一系列可用的特性,并在以后添加大量的特性。

基本特征

  • 创建页面(为该文章创建 wiki 文章和讨论论坛)
  • 标记和所见即所得
  • 在标记/html/所见即所得之间进行动态转换
  • 快速导航的边栏
  • 用于选择编辑/查看的顶级工具栏

高级功能

  • 可配置的边栏导航通过不同的方法
  • 可配置的工具栏(可以添加所选择的标记语言)
  • 标签
  • 可编辑的待办事项
  • 拖放文件上传和图像附件

该引擎最初将包括最基本的页面创建、标记和所见即所得编辑以及保存。我最终想扩展这个基本的引擎与拖放图像支持,文件上传,实时数据图表,和一个侧边栏自定义视图。

我已经做了一个相当广泛的搜索一个体面的项目,从中基础我的项目,但除了 TiddlyWiki 似乎没有任何良好的基于 javascript 的 wiki 引擎。我还考虑过在现有的 wiki 引擎之上应用 Jquery,但我相信我最终还是会重写它(另外,随着我的发展添加我想要的功能会更令人兴奋)。无论哪种方式,我都已经用 javascript 库 + 框架实现了这个怪兽。

我知道,我们不能真正地将这些框架相互比较,因为它们非常不同。我试图将任何比较意见/问题与相关框架的可比部分进行对比,但我愿意接受更正。

我们开始吧:

根据我自己的研究和观点,我已经把清单缩小到以下几个项目。我故意省略了 SproutCore、 corMVC、 YUI 等内容,因为在我有限的能力范围内,我认为下面的内容更适合我。

我的选择


Jquery/UI + backbonejs

总的来说

据我所知,这种组合被许多人使用和喜爱,并且非常灵活和可扩展。我主要关心的是,这种组合不是开发更面向桌面的 UI 界面的最佳起点。

用户界面

虽然 jQueryUI 或 jqueryTools 可能具有竞争力,但它们似乎无法与其他框架的 UI 功能相提并论。具体来说,他们似乎沉重的影响,但缺乏体面的布局切片支持。

JavascriptMVC

总的来说

在我看来,JavascriptMVC 本质上就是 jquery + MVC (jqueryMX)扩展,还有一些其他的应用程序用于文档编写(documentJS)、功能测试(funUnit)以及代码和依赖管理(stealJS)。除了附加模块的好处之外,我认为功能上的争论实际上可以归结为 backbonejs 和 jqueryMX。在这一点上我是否正确,是否有人同时使用或比较过这两个模块?

  • 特点: 木星(jMVC 的制造商)的 特征概述
  • 链接到 JqueryMX

用户界面

JavascriptMVC 将 MXUI条目添加到 Jquery 可用的任何条目之上,因此我认为至少在这个类别中略胜一筹。

美女

总的来说

我对此的想法和关注点与 jquery + 主干注释非常相似。它们似乎都提供了相似的功能,但只是从不同的角度来看。一个经常被提到的缺点是敲除法将业务逻辑和表示与数据绑定过于紧密地结合在一起,而且这种绑定方法可能会因为复杂的 UI 交互而失效,但我很想知道为什么这不是问题。

用户界面

目前一片空白

Dojo & ExtJS

总的来说

我将结合讨论 Dojo 和 ExtJS,因为我对它们的了解最少,而且它们似乎在几乎相同的空间中运行。关于这两个堆栈溢出的大部分信息似乎已经过时了。据我所知,它们都是大型框架,有利于桌面应用程序的实现。Dojo 曾因文档不完善而受到指责,但现在情况似乎不再是这样了。ExtJS 当然拥有商业许可证,但是对于你所得到的东西来说,它是非常合理的,我不会对它有太多的抵触。ExtJS 中的小部件似乎比 Dojo 更专业一些,但我肯定可以在这里进行更正。我很想听听在这两方面都有经验的人的意见。

用户界面

Dojo 有 Dijit UI 库 ExtJS 有 UI 功能,但不在 Ext 核心中,这里是 文件,这里是他们的演示

卡布奇诺

总的来说

还有卡布奇诺。没有 CSS,没有 html,但是使用现有的 javascript 库也很困难。Objective-J 看起来并不可怕,特别是考虑到它们也能够编写普通的 javascript。演示令人印象深刻,似乎非常接近 wiki 引擎的 UI 需求。基于可可的 API 对于不熟悉它的人来说有很多东西需要学习,但也许它是值得的。我听说布局引擎并不总是容易使用,但是像这样一个年轻的、可能具有颠覆性的技术肯定会有一些缺点。

用户界面

目前一片空白

我很抱歉写了这么多,但是,嘿,至少这不是一个 x vs y vs z 的问题,希望得到很多廉价的答案。你觉得怎么样?我的桌面应该以什么为基础,比如 wiki 引擎,希望随着时间的推移,它能变得更加功能丰富(阅读复杂) ?

4680 次浏览

Your choice of framework might not constrain your UI choices as much as you may be imagining. This recent Henri Bergius article about decoupling content management illustrates the point much better than I could -- and, incidentally, links to a pretty sweet looking pure-JavaScript (framework-independent) in-place content editor.

I would suggest first coming up with specific UI requirements for your project. Which of the frameworks you've tried have you taken for a spin?

Personally, I got into ExtJS development because the projects I work on require a lot of customization of controls/widgets. ExtJS has a ton of them right out of the box and can always be extended, combined, or munged into whatever monstrosity your business requires.

ExtJS 4 also allows you to "skin" your UI's to further customize the look and feel.

If you are new to JavaScript, and are comfortable with Java, you might even look into a server-side solution such as GWT, JSF, or even Vaadin

Not sure about your timeline and resources, but when I'm trying to decide between multiple frameworks/environments, I just go ahead and try to quickly build a prototype. Even if it's just one or two major functions, I find that all the research and documentation in the world won't ever match actually trying to build something with the tools. I say take a day with each and see how far you get. That'll give you a pretty good indication of which tools are up to the task and feel most comfortable for you.

You are not alone!

VanillaJS and Ampersand .. are great examples of the serious drive for simpler, more modular JavaScript.

There's even a Book about it.

Simplicity is being driven by an under-rated es6 feature: Modules and the SystemJS implementation standard. It even can be used on non-es6 systems.

How cool is that!

One suggestion about Backbone, if you decide to use it you should go for Marionnete since it's Backbone but with a better architectural structure and more opinionated ( i personally feel that Backbone doesn't set any guidelines and that's feels like a downside in large apps ).

I worked with it for a few months combining different js libs and doesn't get in your way like other frameworks and the message pipeline is a really good way to connect components through out the app but keep them decouple.

Here you have a great talk that made me decide for it : https://www.youtube.com/watch?v=qWr7x9wk6_c

And here you have a demo prototype that also has the drag and drop element plus other js libs connected. Would love to heard what you think about my code since i have 1.5 years working on web development... i'm still a newbie : https://github.com/Drasky-Vanderhoff/marionette-demo/

About Knockout, is really good if you want interaction with the content you already have and you won't be connecting constantly with the backend. I worked with it for 6 months and i end up needing to use a lot of other js libs for routing; plus i end up repeating a lot of the structures that Backbone and other JS Frameworks end up having. What i will say is that it won't get in your way at all and be a tool rather than a constrain. Also this was almost a year ago so a few things have changed.

One thing, if you find Knockback ( Knockout + Backbone )... avoid it, the documentation is not as good as it should be and it will take you a lot more time to learn it. If you want to go for it make a fast prototype first to see if is what you want.

I would say you are wrong in your overall choice of candidates as you are omitting Angular and Ember both of which are better suited than any of the other frameworks listed.

Overall, I'd say Angular.js is the framework for this one.

Emphasis on Routing

Much of what you are talking about (several sidebars for navigation, a single page app) are functions of routing, or how the front end interprets the text in your URL navigation bar.

Both Angular.js and Ember have excellent routers that allow you to accomplish everything you require without additional code.

For your benefit, here is a quick breakdown of the features in Angular that can be used to create your single page wiki

The Structure of the Site Itself

Angular has an amazing library called UI router allows you both to create custom navigation and to set up an SEO friendly structure of revealing your content. Multiple views would allow a top toolbar as well.

Ui router tutorial: http://cacodaemon.de/index.php?id=57

WYSIWYG Editor

Angular is built on live two-way binding (when you change something somewhere, it automatically changes everywhere else.) Therefore it comes packaged with a lot of features that work well with this kind of editor. A few good ones have already been made and you only need to implement them.

http://textangular.com/

Graphs and Other Neat Stuff

Angular directives are designed to do things like create Chart components that are reusable. They are not totally different than Wordpress Widgets. Many of these have already been developed and can be dropped into your Angular project.

http://www.sitepoint.com/creating-charting-directives-using-angularjs-d3-js/

Regarding Ember, I do not know much about it so I cannot speak to its particular features.

is all the rage nowadays (the most starred full-stack JavaScript framework on GitHub and Meteorpedia is a wiki engine written in Meteor.

The launch video will get you hooked by 1:28.

It's agnostic with regards to the UI, and has been tested extensively with Bootstrap and Famo.us. It also generates mobile apps from the same codebase.