Here's a list of the notable changes in JTree.
main
entry to package.json so require.resolve
worksjtree/products/Path.js
TreeFileSystem.broswer.js
imports
code from Scroll into the TreeFileSystem
package for other TreeLangs to reuseThis is purely a maintenance release. Unused code and npm packages were removed. The minimum supported NodeJS version is now 16.
This is a major release with significant name breaks. All logic is the same but methods have been renamed to better express the core idea of Tree Languages as small simple parsers combined.
sortTemplate
. You can now use sortKey
in addition to keywords.sortTemplate
.cruxPathAsColumnName
method on parser definition nodesconcreteDescendantDefinitions
now recurses. use concreteInScopeDescendantDefinitions
for old behavior.This was a refactor of Grammar to support scoped parsers. I also took the opportunity to switch more get()
methods to getters.
getX()
have been changed to getters like get x()
:toX()
have been changed to getters like get asX()
:Disk.writeObjectToDisk
Utils.isAbsoluteUrl
, TreeNode.toFlatObject
, Disk.recursiveReaddirSync
, Disk.writeObjectToDisk
appendUniqueLine
methodgetCustomIndex
should return arrays of hits to work for non unique keys as wellgetCustomIndex
fnrunCommand
now also looks for commands on the parent classTrueBase
and tql
are now in the repo https://github.com/breck7/truebase
and npm package truebase
.selectAll
keywordquickCache
TrueBaseFolder:
makeId
getFile
rename
createFile
searchIndex
TrueBaseFile:
sort
prettifyAndSave
parsed
updatePermalinks
names
linksToOtherFiles
TrueBaseServer:
applyPatch
validateSubmission
requestTimes.log
writeIfChanged
method.products/jtree.browser.js
has been removed.get
methods with zero params.Before | After |
---|---|
getParent() | parent |
getContent() | content |
getRootNode() | root |
getWords() | words |
getFirstWord() | firstWord |
titleToPermalink
method from pldbsortFromSortTemplate
method from pldbpatch
method from pldbrename
keywordinitSearch
or listenProd
methods.limit
keywordoneOf
operatortitle
and description
fieldsgithub.stars
has
to hasFirstWord
and has
now works correctly for deep paths.sortBy
and reverse
keywords.csv
, text
, and scroll
output formats.This releases introduced a new language called Tree Query Language (TQL) for quering TrueBases. This release may have some bugs, you may want to wait before upgrading.
This is a major release that makes the code more modular and eliminates a lot of technical debt. In the past to simplify NodeJs+Browser isomorphism I created the jtree
namespace and bundled everything together. This was a mistake. This release fixes that, and makes each subproject more independent. This should speed up future development.
jtree.getVersion()
with TreeNode.getVersion()
products/TreeNotationCodeMirrorMode.js
is now products/GrammarCodeMirrorMode.js
jtree.browser.js
is now deprecated. That file will be kept for now (for external links) but will no longer be updated and will be removed in a future version. Include exactly what you need.Before:
<script src="../products/jtree.browser.js"></script>
After: (to get everything that was previously in the bundle)
<script src="../products/Utils.browser.js"></script>
<script src="../products/TreeNode.browser.js"></script>
<script src="../products/GrammarLanguage.browser.js"></script>
<script src="../products/GrammarCodeMirrorMode.browser.js"></script>
jtree
namespace is no more. Include exactly what you need:Before:
const {jtree} = require("jtree")
const tree = new jtree.TreeNode("hello world")
After:
const {TreeNode} = require("jtree/products/TreeNode.js")
const tree = new TreeNode("hello world")
Utils
as top level exportTreeNode.fromFolder
methodlist
getter on Grammar backed nodes returns an array of strings split by listDelimiter
. Fallback is same behavior as if
is the listDelimiter.contentDelimiter
is now listDelimiter
uniqueLine
to check for duplicate lines.This is an unstable release. Please wait a few days for bug fix releases before using.
trueBaseServer.node.js
and has been rewrittentrueBaseServer.node.js
TrueBaseBuilder
and rewritten class TrueBaseServer
rank
and webPermalink
abstract
from Grammar Language. Grammar Language is now a suffix AND prefix language. The functionality of abstract node type definitions is identical, but now instead of flagging them with the abstract
keyword, you need to ensure that the node type definition id begins with the word abstract
. This turned out to be the best design pattern already, so you may already do this, and then the migration step is simpleβjust delete all occurrences of /^ abstract\n/
in your *.grammar
files. In the rare chance you have any nodes that are not abstract whose id's begin with the prefix abstract
, you will need to give those nodes a new id.getDir
(use dir
); removed toProgram; getGrammarPaths is now grammarFilePathscontentDelimiter
propertysingle
keyword in a parent nodeType now propogates to child nodeTypestree.toDelimited("|", undefined, false)
where
query with notEmpty
operator would failsetStumpNodeCss
setShadowCss
nodeType person
now do personNode
and instead of cellType int
do intCell
A regex for finding breaks in untyped code:
\b(defaults|getExpectedLineCellTypes|nodeTypes|isLeafColumn|_getDuplicateLinesMap|_getFirstWordByIndex|toFlatTree|fromJson|toJson|getExpanded|getCompiledProgramName|getAncestorNodeTypeNamesArray|getCatchAllCellTypeName|getRequiredCellTypeNames|getRunTimeNodeTypeNames|getProgramErrorMessages|getFirstCellType|getProgram|getGrammarProgram|getParsedWords|getCellTypeName|getCellTypeDefinition|getNodeTypeDefinitionByName|getProgramErrors|getCompiledIndentation|getCompiledLine|getCompilerNode|getProgramErrorsIterator)\b
Use code below to update programs:
swarmProgram.updateNodeTypeIds(`#setup arrange
%%| constructWith
%| blockStringParam
=# lengthIs
=+ stringIncludes
=- stringExcludes
== stringIs
=| blockStringIs
=~ typeIs
#test test
+#test testOnly
-#test skipTest`)
def.getId
is now def.getNodeTypeIdFromDefinition
, def.getTopNodeTypes is now def.getTopNodeTypeIds, def.getKeywordDefinitionByName is now def.getNodeTypeDefinitionByName, def.getRunTimeKeywordMap is now def.getRunTimeFirstWordMap, def.getRunTimeKeywordNames is def.getRunTimeNodeTypeNames, def.getRunTimeKeywordMapWithDefinitions is def.getRunTimeFirstWordMapWithDefinitions, def.isOrExtendsAKeywordInScope is def.isOrExtendsANodeTypeInScope, def.getKeywordInheritanceSet is def.getNodeTypeInheritanceSet, def.getSyntaxContextId is def.getSublimeSyntaxContextId.?
should now be .*
getNumberOfLines
method