Giter Club home page Giter Club logo

Comments (17)

h13i32maru avatar h13i32maru commented on September 23, 2024

@mmoss Thanks question!

I welcome pull-request that is ignore ES6+ features 😄
However, Espree does not seem to support ES6+.
So, this work is hard for me 😓

And, for now, I am not going to merge opt-into ES6+ feature pull request. Sorry.

from esdoc.

mysticatea avatar mysticatea commented on September 23, 2024

Actually, espree supports ES7 Rest/Spread Properties (stage 1) experimentally.
But currently espree seems to have no plan to support more. 😢

from esdoc.

h13i32maru avatar h13i32maru commented on September 23, 2024

@mysticatea oh...
ES7 support is very hard for everyone.
(Babel and @sebmck is special!)

from esdoc.

mmoss avatar mmoss commented on September 23, 2024

I'll take a stab at adding the ability to ignore ES7 features (at least decorators), or at the very least try and figure out a way to output a warning if a file is ignored due to ES7 syntax preventing parsing.

from esdoc.

benmosher avatar benmosher commented on September 23, 2024

FWIW, babel-eslint is essentially an Esprima-/Espree-compatible parser that uses Babel under the covers, but returns an Espree-like AST. (its intent is only to support ESLint, but I suspect it might be generally useful as a mostly-Esprima-compatible parser)

One option: provide a setting to configure an alternate parser (like ESLint does) and let users attempt to use ES7+ features at their own peril. You can then continue to default to (and only officially support) Espree, but users/potential committers can play around on the bleeding edge.

Pending your tolerance for non-ESTree/SpiderMonkey node types (things like ExportNamespaceSpecifier from Lee Byron's import/export symmetry proposal: export * as ns from 'module'), it may be as simple as dropping in the parser config option.

from esdoc.

h13i32maru avatar h13i32maru commented on September 23, 2024

@mmoss @benmosher Thanks 😄

I am considering plugin feature #27 . The plugin provides onHandleCodeParser to use own JavaScript parser. The parser must be compatible with Espree.

exports.onHandleCodeParser = function(event) {
  var code = event.code;
  var ast = yourParser.parse(code);
  event.ast = ast;
}

And, with this feature, it becomes possible with TypeScript and other transpile language not only ES7.

from esdoc.

PinkaminaDianePie avatar PinkaminaDianePie commented on September 23, 2024

i tried to use esdoc, but it fails on files with es7 syntax (i am using async/await + decorators + property initializers), so i was forced to switch on yuidoc. It will be nice to see possibility to use another js parsers, such babel.

from esdoc.

h13i32maru avatar h13i32maru commented on September 23, 2024

@PinkaminaDianePie Thanks for comment! I will try to provide the plugin feature 🚀

from esdoc.

mmoss avatar mmoss commented on September 23, 2024

@h13i32maru let me know if I can help out in any way 😄

from esdoc.

h13i32maru avatar h13i32maru commented on September 23, 2024

@mmoss Thank you!

from esdoc.

h13i32maru avatar h13i32maru commented on September 23, 2024

@mmoss @benmosher @PinkaminaDianePie @mysticatea Hi!
I published ESDoc ES7 Plugin 😄
This plugin enables to generate documentation from source code including ES7.
You can use this plugin with [email protected]

from esdoc.

PinkaminaDianePie avatar PinkaminaDianePie commented on September 23, 2024

@h13i32maru, cool, thx! Ill try it tomorrow, i hope ill move out from yui. One more question: esdoc supports markdown? Or maybe custom templates, where i can switch from html to markdown? its usefull feature for easier integration to github-pages site, created from markdown via jekyll. I can use same styles for manual docs and for auto-generated.

from esdoc.

h13i32maru avatar h13i32maru commented on September 23, 2024

@PinkaminaDianePie ESDoc does not support markdown documentation. However, you can perhaps generate it by using plugin feature. But I think that it is very hard work...

On the other hand, I have been developing ESDoc Hosting Service.
In there, you can generate your documentation and host it. Please try it if it is good for you 😄

from esdoc.

PinkaminaDianePie avatar PinkaminaDianePie commented on September 23, 2024

I was tried to use esdoc with es7 plugin, but it does not help T_T I thought what only es7 features will be ignored or maybe async functions will be parsed like es5 functions but... any code uses es7 will be ignored, so if i use async function in my class - entire class will be ignored. So almost nothing was generated. Sad. And some code still crushes esdoc, i dont know exacly where

from esdoc.

h13i32maru avatar h13i32maru commented on September 23, 2024

@PinkaminaDianePie The plugin requires ESDoc version 0.2.1. Do you use the version?
If it is ok, please tell me your code or repository url.

The plugin supports async/await of ES7 following code.

export class ES7AsyncFunctions {
  async method(){
    await Promise.revole(1);
  }
}

FYI: https://doc.esdoc.org/github.com/esdoc/esdoc-hosting-safe-plugin/class/src/ES7/ES7AsyncFunctions.js~ES7AsyncFunctions.html

from esdoc.

PinkaminaDianePie avatar PinkaminaDianePie commented on September 23, 2024

@h13i32maru, oh, im sorry, thx for answer! There was something with my global modules, even after install v0.1.2 was used. For now everything is ok. Ok, ill see what can i use for my docs, maybve it will be better than yui

from esdoc.

h13i32maru avatar h13i32maru commented on September 23, 2024

@PinkaminaDianePie 👍

from esdoc.

Related Issues (20)

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.