dyatko / arkit

JavaScript architecture diagrams and dependency graphs

Home Page:https://arkit.pro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not implemented feature for syntax kind 'ObjectBindingPattern' / 'ArrayBindingPattern'

Semigradsky opened this issue · comments

Bug description

To Reproduce

  1. Operating system - Ubuntu 17.10

  2. Arkit version and CLI arguments - 1.5.0
    LEVEL=trace npx arkit -o arkit.svg > arkit-logs.txt

  3. Arkit config, if any was used - no

  4. Source code example, if it's possible - no


There is html file in arkit.svg:

<!DOCTYPE html>
	<html>
	  <head>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta charset="utf-8">
		<title>Application Error</title>
		<style media="screen">
		  html,body,iframe {
			margin: 0;
			padding: 0;
		  }
		  html,body {
			height: 100%;
			overflow: hidden;
		  }
		  iframe {
			width: 100%;
			height: 100%;
			border: 0;
		  }
		</style>
	  </head>
	  <body>
		<iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>
	  </body>
	</html>

There are some errors in logs:

[2019-03-26 09:52:49.137 +0000] �[33mWARN �[39m: �[36mNot implemented feature for syntax kind 'ObjectBindingPattern'.�[39m
    Error: Not implemented feature for syntax kind 'ObjectBindingPattern'.
        at NotImplementedError.BaseError [as constructor] (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/errors/classes/BaseError.js:8:28)
        at new NotImplementedError (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/errors/classes/NotImplementedError.js:10:23)
        at Object.getNotImplementedForSyntaxKindError (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/errors/helpers.js:79:12)
        at ParameterDeclaration.DeclarationNamedNodeInternal.class_1.getNameNode (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/name/DeclarationNamedNode.js:35:34)
        at ParameterDeclaration.DeclarationNamedNodeInternal.class_1.getName (/home/ITRANSITION.CORP/d.semigradsky/.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/name/DeclarationNamedNode.js:42:33)
        at ParameterDeclaration.DeclarationNamedNodeInternal.class_1.getStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/name/DeclarationNamedNode.js:57:28)
        at Object.callBaseGetStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/callBaseGetStructure.js:9:51)
        at ParameterDeclaration.InitializerSetExpressionableNode.class_1.getStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/initializer/InitializerSetExpressionableNode.js:50:43)
        at Object.callBaseGetStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/callBaseGetStructure.js:9:51)
        at ParameterDeclaration.TypedNode.class_1.getStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/TypedNode.js:85:43)

and

[2019-03-26 09:52:50.002 +0000] �[33mWARN �[39m: �[36mNot implemented feature for syntax kind 'ArrayBindingPattern'.�[39m
    Error: Not implemented feature for syntax kind 'ArrayBindingPattern'.
        at NotImplementedError.BaseError [as constructor] (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/errors/classes/BaseError.js:8:28)
        at new NotImplementedError (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/errors/classes/NotImplementedError.js:10:23)
        at Object.getNotImplementedForSyntaxKindError (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/errors/helpers.js:79:12)
        at ParameterDeclaration.DeclarationNamedNodeInternal.class_1.getNameNode (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/name/DeclarationNamedNode.js:35:34)
        at ParameterDeclaration.DeclarationNamedNodeInternal.class_1.getName (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/name/DeclarationNamedNode.js:42:33)
        at ParameterDeclaration.DeclarationNamedNodeInternal.class_1.getStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/name/DeclarationNamedNode.js:57:28)
        at Object.callBaseGetStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/callBaseGetStructure.js:9:51)
        at ParameterDeclaration.InitializerSetExpressionableNode.class_1.getStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/initializer/InitializerSetExpressionableNode.js:50:43)
        at Object.callBaseGetStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/callBaseGetStructure.js:9:51)
        at ParameterDeclaration.TypedNode.class_1.getStructure (/home/.../.npm/_npx/8522/lib/node_modules/arkit/node_modules/ts-morph/dist/compiler/ast/base/TypedNode.js:85:43)

Hey @Semigradsky, any chance you can provide the lines of your source code where it breaks? Perhaps, there are some clues in the logs.

It looks like this happens in functions with object/array destructuring in arguments.

class ...
...
   sanitizeEntry([name, dimension]) {
...
export function getNodeKey({ type, id }) {

@Semigradsky since latest arkit@1.5.4 based on ts-morph@2.0.0, it should work now. Please give it a try.

@dyatko
There are no warnings more, but svg file still not great.

arkit.svg:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>504 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection.
<BR clear="all"/>
If you received this error while trying to use an app or access a website, please contact the provider or website owner for assistance.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by following steps in the CloudFront documentation
(<A href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-504-gateway-timeout.html">https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-504-gateway-timeout.html</A>).
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: ...
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>

@dyatko Thanks for this cool library! My run seems to complete successfully (and generates an svg file), but it contains the same 504 XML error in my final SVG file as @Semigradsky.

Do you happen to have any ideas on how to debug further? Thanks!

Edit: I started debugging and I think found that this is related to the PlantUML -> SVG/PNG conversion via web service. Presumably the puml output for my project was too large for the web service. If I stop with the puml output, everything seems fine. So, I guess I don't need any help, but it did give me an idea:

Maybe a nice enhancement would be checking for the length of the puml before attempting to convert to image, in case it's so large we know it will never work? There's probably not a hard limit since it might have to do with complexity rather than sheer length, but we could probably set some upper bound (my project is about 14k files for reference). Then we could potentially show the user some more useful output rather than the cloudfront XML error - and save your service from the load.