Coder Social home page Coder Social logo

marklet's People

Contributors

jjyyxx avatar kouchya avatar shigma avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

marklet's Issues

有关文件系统的一些问题

在 dev-server 中,我们的 edit 和 watch 都同时允许针对单文件或针对完整的 marklet 项目进行操作,但是它们之间存在一些区别,因此设计程序时应当对相关的一些问题加以考虑。

  1. 单文件和项目的 watch 方式和更新方式有所不同,项目中 .mkl 文件发生改动和 marklet.json 配置文件发生改动所预期的行为也有所不同。(还要考虑如果一个文件中引用了某张本地图片,是否将这张图片的地址也纳入 watch 的范畴?)
  2. 单文件的编辑只需存储对应文件的 model 即可,而项目的编辑过程中需要存储所有文件的 model(然后将是否改动显示在项目目录中),并记录前端操作(如在项目中新建文件,修改标题等)引起的项目配置的变化,如何处理?

第一阶段计划事项

core

  • lexer.macros属性,存储当前状态机内已使用的宏的正则表达式
  • macros支持传入函数,受当前config影响

dev-server

  • menu.json 增加mnemonic属性,用于支持键盘操控
  • 配置 monaco 的样式使得其与 marklet 更加协调

其他

  • 引入主题系统
  • 引入插件系统

提高 Lexer 实例构建速度

当前的 benchmark 如下:

codeblock   initial: 0.316535 ms.
codeblock   average: 0.032519 ms.
demo        initial: 0.289185 ms.
demo        average: 0.050263 ms.
inlinelist  initial: 0.308512 ms.
inlinelist  average: 0.046518 ms.
list        initial: 0.555395 ms.
list        average: 0.173990 ms.
section     initial: 0.798996 ms.
section     average: 0.234719 ms.
table       initial: 0.522939 ms.
table       average: 0.073123 ms.
text        initial: 0.324557 ms.
text        average: 0.124281 ms.

我们可以看到,实例初步构建所需的时间远超一次 parse 执行的时间。因此提高 Lexer 实例构建速度是一件很有必要的工作。

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.