什么是最佳实践'如果你需要编辑一个框架的代码,以便它能做你想做的事情?

时间:2017-06-14 16:43:18

标签: frameworks frontend web-frameworks

我需要一个非常具体的功能,我为前端项目选择的框架不支持这个功能。我想知道什么是社区和最佳实践'或者这样做的准则。

例如:

在将Lumx UI框架(http://ui.lumapps.com/)集成两周后,我发现文件输入控制器组件(http://ui.lumapps.com/components/file-input)没有我需要的所有功能,例如指令不允许我使用' accept属性'类型,所以我不能限制它只接受' csv'文件。所以...

  1. 我进入lumx.js文件,找到文件输入指令并稍微更改它的代码,这样我就能得到我需要的结果。

  2. 我保存它(它有效!)。

  3. 5分钟过去了,我开始觉得我做了一些无法形容的事情,并开始强调我刚刚在未来的dev升级当前版本的lumx并且它破坏了我的界面时所做的更改。 ..

  4. 我在网上搜索,但不确定如何用短语提问,让google吐出结果,所以我在这里发帖...

1 个答案:

答案 0 :(得分:1)

Michael gave you the right answer. Simply fork the LumX repository, make the change you need and don't hesitate to send a Pull Request back to LumX so that we can include your modifications (if that makes sense) to the final release.

If it's something that cannot make it to the release, you can then use your very own fork as a bower source and thus use your own version of LumX. In this case, you have to keep in mind that you should regularly "update" your fork with the changes made in the origin repository (and may have some conflicts).

Once again, don't hesitate to open a Pull Request on LumX for bug fixes or changes that you think may be cool for the framework. If you think that you encountered an issue and you are not sure of how to fix it, you can also open an issue on the repository and a developer of our team will try to solve it as soon as possible.

See you soon on LumX

Clément from Lumapps