TriplyDB / Yasgui

Yet Another Sparql GUI
https://yasgui.triply.cc
MIT License
190 stars 55 forks source link

Multiple YASR instances on one page and caching #151

Closed retog closed 4 years ago

retog commented 4 years ago

I'm having multiple YASQUE and multiple YASR instances on one page. The problem is that when coming back to the page all YASR instances show the same results of the query that was last run rather than the results of the query in the associated YASQE. I've tried setting persistencyExpire to 0 but this had no effect.

LaurensRietveld commented 4 years ago

What I think happens here: Yasqe and Yasr use a localstorage identifier based on the parent dom IDs. This becomes problematic when multiple instances of Yasqe and Yasr have parent dom elements with IDs, or when they share these dom elements. We'll probably need to improve the logic a bit to avoid such collisions.

Could you try adding a unique persistenceId field to each yasqe and yasr instance? Or, if you want to disable persisting the results/configuration to localstorage, you can set this to null instead. Let me know if this works out for you.

retog commented 4 years ago

Thanks @LaurensRietveld

Setting persistenceId to null seems to be incompatible with the type declaration so I can't do this in TypeScript. Setting persistenceId to a random String seems to have the desired effect, however I think this might fill the localstorage as data is stored but not retrieved.

LaurensRietveld commented 4 years ago

The latest release has improved typings for these configuration fields, could you check that one?

retog commented 4 years ago

@LaurensRietveld After ungrading @triply/yasqe and @triply/yasr from version 4.0.105 to version 4.0.107 I'm getting the followin error messages:

ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/grammar/tokenizer.d.ts(1,13):
1:13 'CodeMirror' refers to a UMD global, but the current file is a module. Consider adding an import instead.
  > 1 | import type CodeMirror from "codemirror";
      |             ^
    2 | export interface State {
    3 |     tokenize: (stream: CodeMirror.StringStream, state: State) => string;   
    4 |     inLiteral: "SINGLE" | "DOUBLE" | undefined;
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/grammar/tokenizer.d.ts(1,24):
1:24 Cannot find name 'from'.
  > 1 | import type CodeMirror from "codemirror";
      |                        ^
    2 | export interface State {
    3 |     tokenize: (stream: CodeMirror.StringStream, state: State) => string;   
    4 |     inLiteral: "SINGLE" | "DOUBLE" | undefined;
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(1,8):
1:8 Duplicate identifier 'type'.
  > 1 | import type { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position 
as CmPosition, EditorConfiguration as CmEditorConfiguration } from 'codemirror';   
      |        ^
    2 | import * as sparql11Mode from "../grammar/tokenizer";
    3 | import type { TokenizerState } from "./index";
    4 | declare namespace CodeMirror {
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(1,15):
1:15 Cannot find name 'Editor'.
  > 1 | import type { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position 
as CmPosition, EditorConfiguration as CmEditorConfiguration } from 'codemirror';   
      |               ^
    2 | import * as sparql11Mode from "../grammar/tokenizer";
    3 | import type { TokenizerState } from "./index";
    4 | declare namespace CodeMirror {
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(1,25):
1:25 Cannot find name 'CmEditor'.
  > 1 | import type { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position 
as CmPosition, EditorConfiguration as CmEditorConfiguration } from 'codemirror';   
      |                         ^
    2 | import * as sparql11Mode from "../grammar/tokenizer";
    3 | import type { TokenizerState } from "./index";
    4 | declare namespace CodeMirror {
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(1,35):
1:35 Cannot find name 'Doc'.
  > 1 | import type { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position 
as CmPosition, EditorConfiguration as CmEditorConfiguration } from 'codemirror';   
      |                                   ^
    2 | import * as sparql11Mode from "../grammar/tokenizer";
    3 | import type { TokenizerState } from "./index";
    4 | declare namespace CodeMirror {
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(1,42):
1:42 Cannot find name 'CmDoc'.
  > 1 | import type { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position 
as CmPosition, EditorConfiguration as CmEditorConfiguration } from 'codemirror';   
      |                                          ^
    2 | import * as sparql11Mode from "../grammar/tokenizer";
    3 | import type { TokenizerState } from "./index";
    4 | declare namespace CodeMirror {
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(1,49):
1:49 Cannot find name 'Token'.
  > 1 | import type { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position 
as CmPosition, EditorConfiguration as CmEditorConfiguration } from 'codemirror';   
      |                                                 ^
    2 | import * as sparql11Mode from "../grammar/tokenizer";
    3 | import type { TokenizerState } from "./index";
    4 | declare namespace CodeMirror {
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(1,58):
1:58 Cannot find name 'CmToken'.
  > 1 | import type { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position 
as CmPosition, EditorConfiguration as CmEditorConfiguration } from 'codemirror';   
      |                                                          ^
    2 | import * as sparql11Mode from "../grammar/tokenizer";
    3 | import type { TokenizerState } from "./index";
    4 | declare namespace CodeMirror {
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(1,67):
1:67 'Position' only refers to a type, but is being used as a value here.
  > 1 | import type { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position 
as CmPosition, EditorConfiguration as CmEditorConfiguration } from 'codemirror';   
      |                                                                   ^        
    2 | import * as sparql11Mode from "../grammar/tokenizer";
    3 | import type { TokenizerState } from "./index";
    4 | declare namespace CodeMirror {
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(1,79):
1:79 Cannot find name 'CmPosition'.
  > 1 | import type { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position 
as CmPosition, EditorConfiguration as CmEditorConfiguration } from 'codemirror';   
      | 
   ^
    2 | import * as sparql11Mode from "../grammar/tokenizer";
    3 | import type { TokenizerState } from "./index";
    4 | declare namespace CodeMirror {
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(1,91):
1:91 Cannot find name 'EditorConfiguration'.
  > 1 | import type { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position 
as CmPosition, EditorConfiguration as CmEditorConfiguration } from 'codemirror';   
      | 
               ^
    2 | import * as sparql11Mode from "../grammar/tokenizer";
    3 | import type { TokenizerState } from "./index";
    4 | declare namespace CodeMirror {
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(1,114):
1:114 Cannot find name 'CmEditorConfiguration'.
  > 1 | import type { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position 
as CmPosition, EditorConfiguration as CmEditorConfiguration } from 'codemirror';   
      | 
                                      ^
    2 | import * as sparql11Mode from "../grammar/tokenizer";
    3 | import type { TokenizerState } from "./index";
    4 | declare namespace CodeMirror {
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(1,138):
1:138 Cannot find name 'from'.
  > 1 | import type { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position 
as CmPosition, EditorConfiguration as CmEditorConfiguration } from 'codemirror';   
      | 
                                                              ^
    2 | import * as sparql11Mode from "../grammar/tokenizer";
    3 | import type { TokenizerState } from "./index";
    4 | declare namespace CodeMirror {
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(3,8):
3:8 Duplicate identifier 'type'.
    1 | import type { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position 
as CmPosition, EditorConfiguration as CmEditorConfiguration } from 'codemirror';   
    2 | import * as sparql11Mode from "../grammar/tokenizer";
  > 3 | import type { TokenizerState } from "./index";
      |        ^
    4 | declare namespace CodeMirror {
    5 |     type Doc = CmDoc;
    6 |     type Position = CmPosition;
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(3,15):
3:15 Cannot find name 'TokenizerState'.
    1 | import type { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position 
as CmPosition, EditorConfiguration as CmEditorConfiguration } from 'codemirror';   
    2 | import * as sparql11Mode from "../grammar/tokenizer";
  > 3 | import type { TokenizerState } from "./index";
      |               ^
    4 | declare namespace CodeMirror {
    5 |     type Doc = CmDoc;
    6 |     type Position = CmPosition;
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(3,32):
3:32 Cannot find name 'from'.
    1 | import type { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position 
as CmPosition, EditorConfiguration as CmEditorConfiguration } from 'codemirror';   
    2 | import * as sparql11Mode from "../grammar/tokenizer";
  > 3 | import type { TokenizerState } from "./index";
      |                                ^
    4 | declare namespace CodeMirror {
    5 |     type Doc = CmDoc;
    6 |     type Position = CmPosition;
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(5,16):
5:16 Cannot find name 'CmDoc'.
    3 | import type { TokenizerState } from "./index";
    4 | declare namespace CodeMirror {
  > 5 |     type Doc = CmDoc;
      |                ^
    6 |     type Position = CmPosition;
    7 |     type EditorConfiguration = CmEditorConfiguration;
    8 |     interface Token extends CmToken {
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(6,21):
6:21 Cannot find name 'CmPosition'.
    4 | declare namespace CodeMirror {
    5 |     type Doc = CmDoc;
  > 6 |     type Position = CmPosition;
      |                     ^
    7 |     type EditorConfiguration = CmEditorConfiguration;
    8 |     interface Token extends CmToken {
    9 |         state: sparql11Mode.State;
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(7,32):
7:32 Cannot find name 'CmEditorConfiguration'.
     5 |     type Doc = CmDoc;
     6 |     type Position = CmPosition;
  >  7 |     type EditorConfiguration = CmEditorConfiguration;
       |                                ^
     8 |     interface Token extends CmToken {
     9 |         state: sparql11Mode.State;
    10 |     }
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(8,29):
8:29 Cannot find name 'CmToken'.
     6 |     type Position = CmPosition;
     7 |     type EditorConfiguration = CmEditorConfiguration;
  >  8 |     interface Token extends CmToken {
       |                             ^
     9 |         state: sparql11Mode.State;
    10 |     }
    11 | }
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(12,35):
12:35 Cannot find name 'CmEditor'.
    10 |     }
    11 | }
  > 12 | interface CodeMirror extends Omit<CmEditor, 'getOption' | 'setOption' | 'on' | 'off'> {
       |                                   ^
    13 |     getOption(opt: "queryType"): TokenizerState["queryType"];
    14 |     setOption(opt: "queryType", val: TokenizerState["queryType"]): void;  
    15 |     foldCode(firstPrefixLine: number, prefix: string, collapse: "fold" | "unfold"): void;
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(13,34):
13:34 Cannot find name 'TokenizerState'.
    11 | }
    12 | interface CodeMirror extends Omit<CmEditor, 'getOption' | 'setOption' | 'on' | 'off'> {
  > 13 |     getOption(opt: "queryType"): TokenizerState["queryType"];
       |                                  ^
    14 |     setOption(opt: "queryType", val: TokenizerState["queryType"]): void;
    15 |     foldCode(firstPrefixLine: number, prefix: string, collapse: "fold" | "unfold"): void;
    16 | }
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/CodeMirror.d.ts(14,38):
14:38 Cannot find name 'TokenizerState'.
    12 | interface CodeMirror extends Omit<CmEditor, 'getOption' | 'setOption' | 'on' | 'off'> {
    13 |     getOption(opt: "queryType"): TokenizerState["queryType"];
  > 14 |     setOption(opt: "queryType", val: TokenizerState["queryType"]): void;  
       |                                      ^
    15 |     foldCode(firstPrefixLine: number, prefix: string, collapse: "fold" | "unfold"): void;
    16 | }
    17 | declare const CodeMirror: {
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/index.d.ts(3,15):
3:15 Cannot find name 'as'.
    1 | import * as superagent from "superagent";
    2 | import { Prefixes } from "./prefixUtils";
  > 3 | import type * as sparql11Mode from "../grammar/tokenizer";
      |               ^
    4 | import { Storage as YStorage } from "@triply/yasgui-utils";
    5 | import * as queryString from "query-string";
    6 | import * as Sparql from "./sparql";
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/index.d.ts(3,18):
3:18 Cannot find name 'sparql11Mode'.
    1 | import * as superagent from "superagent";
    2 | import { Prefixes } from "./prefixUtils";
  > 3 | import type * as sparql11Mode from "../grammar/tokenizer";
      |                  ^
    4 | import { Storage as YStorage } from "@triply/yasgui-utils";
    5 | import * as queryString from "query-string";
    6 | import * as Sparql from "./sparql";
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/index.d.ts(3,31):
3:31 Cannot find name 'from'.
    1 | import * as superagent from "superagent";
    2 | import { Prefixes } from "./prefixUtils";
  > 3 | import type * as sparql11Mode from "../grammar/tokenizer";
      |                               ^
    4 | import { Storage as YStorage } from "@triply/yasgui-utils";
    5 | import * as queryString from "query-string";
    6 | import * as Sparql from "./sparql";
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/index.d.ts(172,38):
172:38 Cannot find namespace 'sparql11Mode'.
    170 |     } & Partial<Autocompleter.CompleterConfig>, enable?: boolean): void; 
    171 | }
  > 172 | export declare type TokenizerState = sparql11Mode.State;
        |                                      ^
    173 | export declare type Position = CodeMirror.Position;
    174 | export declare type Token = CodeMirror.Token;
    175 | export interface HintList {
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/prefixUtils.d.ts(1,23):
1:23 Cannot find name 'as'.
  > 1 | import type { default as Yasqe, Token } from "./";
      |                       ^
    2 | export declare type Prefixes = {
    3 |     [prefixLabel: string]: string;
    4 | };
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/prefixUtils.d.ts(1,26):
1:26 Cannot find name 'Yasqe'.
  > 1 | import type { default as Yasqe, Token } from "./";
      |                          ^
    2 | export declare type Prefixes = {
    3 |     [prefixLabel: string]: string;
    4 | };
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/prefixUtils.d.ts(1,26):
1:26 Left side of comma operator is unused and has no side effects.
  > 1 | import type { default as Yasqe, Token } from "./";
      |                          ^
    2 | export declare type Prefixes = {
    3 |     [prefixLabel: string]: string;
    4 | };
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/prefixUtils.d.ts(1,33):
1:33 Cannot find name 'Token'.
  > 1 | import type { default as Yasqe, Token } from "./";
      |                                 ^
    2 | export declare type Prefixes = {
    3 |     [prefixLabel: string]: string;
    4 | };
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/prefixUtils.d.ts(1,41):
1:41 Cannot find name 'from'.
  > 1 | import type { default as Yasqe, Token } from "./";
      |                                         ^
    2 | export declare type Prefixes = {
    3 |     [prefixLabel: string]: string;
    4 | };
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/prefixUtils.d.ts(5,44):
5:44 Cannot find name 'Yasqe'.
    3 |     [prefixLabel: string]: string;
    4 | };
  > 5 | export declare function addPrefixes(yasqe: Yasqe, prefixes: string | Prefixes): void;
      |                                            ^
    6 | export declare function addPrefixAsString(yasqe: Yasqe, prefixString: string): void;
    7 | export declare function removePrefixes(yasqe: Yasqe, prefixes: Prefixes): void;
    8 | export declare function getPrefixesFromQuery(yasqe: Yasqe): Token["state"]["prefixes"];
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/prefixUtils.d.ts(6,50):
6:50 Cannot find name 'Yasqe'.
    4 | };
    5 | export declare function addPrefixes(yasqe: Yasqe, prefixes: string | Prefixes): void;
  > 6 | export declare function addPrefixAsString(yasqe: Yasqe, prefixString: string): void;
      |                                                  ^
    7 | export declare function removePrefixes(yasqe: Yasqe, prefixes: Prefixes): void;
    8 | export declare function getPrefixesFromQuery(yasqe: Yasqe): Token["state"]["prefixes"];
    9 | export declare function getIndentFromLine(yasqe: Yasqe, line: number, charNumber?: number): string;
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/prefixUtils.d.ts(7,47):
7:47 Cannot find name 'Yasqe'.
     5 | export declare function addPrefixes(yasqe: Yasqe, prefixes: string | Prefixes): void;
     6 | export declare function addPrefixAsString(yasqe: Yasqe, prefixString: string): void;
  >  7 | export declare function removePrefixes(yasqe: Yasqe, prefixes: Prefixes): 
void;
       |                                               ^
     8 | export declare function getPrefixesFromQuery(yasqe: Yasqe): Token["state"]["prefixes"];
     9 | export declare function getIndentFromLine(yasqe: Yasqe, line: number, charNumber?: number): string;
    10 | 
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/prefixUtils.d.ts(8,53):
8:53 Cannot find name 'Yasqe'.
     6 | export declare function addPrefixAsString(yasqe: Yasqe, prefixString: string): void;
     7 | export declare function removePrefixes(yasqe: Yasqe, prefixes: Prefixes): 
void;
  >  8 | export declare function getPrefixesFromQuery(yasqe: Yasqe): Token["state"]["prefixes"];
       |                                                     ^
     9 | export declare function getIndentFromLine(yasqe: Yasqe, line: number, charNumber?: number): string;
    10 | 
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/prefixUtils.d.ts(8,61):
8:61 Cannot find name 'Token'.
     6 | export declare function addPrefixAsString(yasqe: Yasqe, prefixString: string): void;
     7 | export declare function removePrefixes(yasqe: Yasqe, prefixes: Prefixes): 
void;
  >  8 | export declare function getPrefixesFromQuery(yasqe: Yasqe): Token["state"]["prefixes"];
       |                                                             ^
     9 | export declare function getIndentFromLine(yasqe: Yasqe, line: number, charNumber?: number): string;
    10 | 
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/prefixUtils.d.ts(9,50):
9:50 Cannot find name 'Yasqe'.
     7 | export declare function removePrefixes(yasqe: Yasqe, prefixes: Prefixes): 
void;
     8 | export declare function getPrefixesFromQuery(yasqe: Yasqe): Token["state"]["prefixes"];
  >  9 | export declare function getIndentFromLine(yasqe: Yasqe, line: number, charNumber?: number): string;
       |                                                  ^
    10 | 
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/sparql.d.ts(1,23):
1:23 Cannot find name 'as'.
  > 1 | import type { default as Yasqe, Config } from "./";
      |                       ^
    2 | export declare type YasqeAjaxConfig = Config["requestConfig"];
    3 | export interface PopulatedAjaxConfig {
    4 |     url: string;
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/sparql.d.ts(1,26):
1:26 Cannot find name 'Yasqe'.
  > 1 | import type { default as Yasqe, Config } from "./";
      |                          ^
    2 | export declare type YasqeAjaxConfig = Config["requestConfig"];
    3 | export interface PopulatedAjaxConfig {
    4 |     url: string;
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/sparql.d.ts(1,26):
1:26 Left side of comma operator is unused and has no side effects.
  > 1 | import type { default as Yasqe, Config } from "./";
      |                          ^
    2 | export declare type YasqeAjaxConfig = Config["requestConfig"];
    3 | export interface PopulatedAjaxConfig {
    4 |     url: string;
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/sparql.d.ts(1,33):
1:33 Cannot find name 'Config'.
  > 1 | import type { default as Yasqe, Config } from "./";
      |                                 ^
    2 | export declare type YasqeAjaxConfig = Config["requestConfig"];
    3 | export interface PopulatedAjaxConfig {
    4 |     url: string;
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/sparql.d.ts(1,42):
1:42 Cannot find name 'from'.
  > 1 | import type { default as Yasqe, Config } from "./";
      |                                          ^
    2 | export declare type YasqeAjaxConfig = Config["requestConfig"];
    3 | export interface PopulatedAjaxConfig {
    4 |     url: string;
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/sparql.d.ts(2,39):
2:39 Cannot find name 'Config'.
    1 | import type { default as Yasqe, Config } from "./";
  > 2 | export declare type YasqeAjaxConfig = Config["requestConfig"];
      |                                       ^
    3 | export interface PopulatedAjaxConfig {
    4 |     url: string;
    5 |     reqMethod: "POST" | "GET";
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/sparql.d.ts(13,46):
13:46 Cannot find name 'Yasqe'.
    11 |     withCredentials: boolean;
    12 | }
  > 13 | export declare function getAjaxConfig(yasqe: Yasqe, _config?: Partial<Config["requestConfig"]>): PopulatedAjaxConfig | undefined;
       |                                              ^
    14 | export declare function executeQuery(yasqe: Yasqe, config?: YasqeAjaxConfig): Promise<any>;
    15 | export declare type RequestArgs = {
    16 |     [argName: string]: string | string[];
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/sparql.d.ts(13,71):
13:71 Cannot find name 'Config'.
    11 |     withCredentials: boolean;
    12 | }
  > 13 | export declare function getAjaxConfig(yasqe: Yasqe, _config?: Partial<Config["requestConfig"]>): PopulatedAjaxConfig | undefined;
       |                                                                       ^   
    14 | export declare function executeQuery(yasqe: Yasqe, config?: YasqeAjaxConfig): Promise<any>;
    15 | export declare type RequestArgs = {
    16 |     [argName: string]: string | string[];
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/sparql.d.ts(14,45):
14:45 Cannot find name 'Yasqe'.
    12 | }
    13 | export declare function getAjaxConfig(yasqe: Yasqe, _config?: Partial<Config["requestConfig"]>): PopulatedAjaxConfig | undefined;
  > 14 | export declare function executeQuery(yasqe: Yasqe, config?: YasqeAjaxConfig): Promise<any>;
       |                                             ^
    15 | export declare type RequestArgs = {
    16 |     [argName: string]: string | string[];
    17 | };
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/sparql.d.ts(18,48):
18:48 Cannot find name 'Yasqe'.
    16 |     [argName: string]: string | string[];
    17 | };
  > 18 | export declare function getUrlArguments(yasqe: Yasqe, _config: Config["requestConfig"]): RequestArgs;
       |                                                ^
    19 | export declare function getAcceptHeader(yasqe: Yasqe, _config: Config["requestConfig"]): any;
    20 | export declare function getAsCurlString(yasqe: Yasqe, _config?: Config["requestConfig"]): string;
    21 | 
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/sparql.d.ts(18,64):
18:64 Cannot find name 'Config'.
    16 |     [argName: string]: string | string[];
    17 | };
  > 18 | export declare function getUrlArguments(yasqe: Yasqe, _config: Config["requestConfig"]): RequestArgs;
       |                                                                ^
    19 | export declare function getAcceptHeader(yasqe: Yasqe, _config: Config["requestConfig"]): any;
    20 | export declare function getAsCurlString(yasqe: Yasqe, _config?: Config["requestConfig"]): string;
    21 | 
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/sparql.d.ts(19,48):
19:48 Cannot find name 'Yasqe'.
    17 | };
    18 | export declare function getUrlArguments(yasqe: Yasqe, _config: Config["requestConfig"]): RequestArgs;
  > 19 | export declare function getAcceptHeader(yasqe: Yasqe, _config: Config["requestConfig"]): any;
       |                                                ^
    20 | export declare function getAsCurlString(yasqe: Yasqe, _config?: Config["requestConfig"]): string;
    21 | 
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/sparql.d.ts(19,64):
19:64 Cannot find name 'Config'.
    17 | };
    18 | export declare function getUrlArguments(yasqe: Yasqe, _config: Config["requestConfig"]): RequestArgs;
  > 19 | export declare function getAcceptHeader(yasqe: Yasqe, _config: Config["requestConfig"]): any;
       |                                                                ^
    20 | export declare function getAsCurlString(yasqe: Yasqe, _config?: Config["requestConfig"]): string;
    21 | 
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/sparql.d.ts(20,48):
20:48 Cannot find name 'Yasqe'.
    18 | export declare function getUrlArguments(yasqe: Yasqe, _config: Config["requestConfig"]): RequestArgs;
    19 | export declare function getAcceptHeader(yasqe: Yasqe, _config: Config["requestConfig"]): any;
  > 20 | export declare function getAsCurlString(yasqe: Yasqe, _config?: Config["requestConfig"]): string;
       |                                                ^
    21 | 
ERROR in /mnt/synospecies/node_modules/@triply/yasqe/build/ts/src/sparql.d.ts(20,65):
20:65 Cannot find name 'Config'.
    18 | export declare function getUrlArguments(yasqe: Yasqe, _config: Config["requestConfig"]): RequestArgs;
    19 | export declare function getAcceptHeader(yasqe: Yasqe, _config: Config["requestConfig"]): any;
  > 20 | export declare function getAsCurlString(yasqe: Yasqe, _config?: Config["requestConfig"]): string;
       |                                                                 ^
    21 | 
ERROR in /mnt/synospecies/node_modules/@triply/yasr/build/ts/src/index.d.ts(3,24):
3:24 Cannot find name 'from'.
    1 | /// <reference types="node" />
    2 | import { EventEmitter } from "events";
  > 3 | import type { Plugin } from "./plugins";
      |                        ^
    4 | import { Storage as YStorage } from "@triply/yasgui-utils";
    5 | import Parser from "./parsers";
    6 | export { default as Parser } from "./parsers";
ERROR in /mnt/synospecies/node_modules/@triply/yasr/build/ts/src/index.d.ts(17,58):
17:58 Type 'Plugin' is not generic.
    15 |     on(event: "change", listener: (instance: Yasr) => void): this;        
    16 |     emit(event: "change", instance: Yasr): boolean;
  > 17 |     on(event: "draw", listener: (instance: Yasr, plugin: Plugin<any>) => void): this;
       |                                                          ^
    18 |     emit(event: "draw", instance: Yasr, plugin: Plugin<any>): boolean;    
    19 |     on(event: "drawn", listener: (instance: Yasr, plugin: Plugin<any>) => 
void): this;
    20 |     emit(event: "drawn", instance: Yasr, plugin: Plugin<any>): boolean;   
ERROR in /mnt/synospecies/node_modules/@triply/yasr/build/ts/src/index.d.ts(18,49):
18:49 Type 'Plugin' is not generic.
    16 |     emit(event: "change", instance: Yasr): boolean;
    17 |     on(event: "draw", listener: (instance: Yasr, plugin: Plugin<any>) => void): this;
  > 18 |     emit(event: "draw", instance: Yasr, plugin: Plugin<any>): boolean;    
       |                                                 ^
    19 |     on(event: "drawn", listener: (instance: Yasr, plugin: Plugin<any>) => 
void): this;
    20 |     emit(event: "drawn", instance: Yasr, plugin: Plugin<any>): boolean;   
    21 |     on(event: "toggle-help", listener: (instance: Yasr) => void): this;   
ERROR in /mnt/synospecies/node_modules/@triply/yasr/build/ts/src/index.d.ts(19,59):
19:59 Type 'Plugin' is not generic.
    17 |     on(event: "draw", listener: (instance: Yasr, plugin: Plugin<any>) => void): this;
    18 |     emit(event: "draw", instance: Yasr, plugin: Plugin<any>): boolean;    
  > 19 |     on(event: "drawn", listener: (instance: Yasr, plugin: Plugin<any>) => 
void): this;
       |                                                           ^
    20 |     emit(event: "drawn", instance: Yasr, plugin: Plugin<any>): boolean;   
    21 |     on(event: "toggle-help", listener: (instance: Yasr) => void): this;   
    22 |     emit(event: "toggle-help", instance: Yasr): boolean;
ERROR in /mnt/synospecies/node_modules/@triply/yasr/build/ts/src/index.d.ts(20,50):
20:50 Type 'Plugin' is not generic.
    18 |     emit(event: "draw", instance: Yasr, plugin: Plugin<any>): boolean;    
    19 |     on(event: "drawn", listener: (instance: Yasr, plugin: Plugin<any>) => 
void): this;
  > 20 |     emit(event: "drawn", instance: Yasr, plugin: Plugin<any>): boolean;   
       |                                                  ^
    21 |     on(event: "toggle-help", listener: (instance: Yasr) => void): this;   
    22 |     emit(event: "toggle-help", instance: Yasr): boolean;
    23 | }
ERROR in /mnt/synospecies/node_modules/@triply/yasr/build/ts/src/index.d.ts(34,25):
34:25 Type 'Plugin' is not generic.
    32 |     storage: YStorage;
    33 |     plugins: {
  > 34 |         [name: string]: Plugin<any>;
       |                         ^
    35 |     };
    36 |     helpDrawn: Boolean;
    37 |     private drawnPlugin;
ERROR in /mnt/synospecies/node_modules/@triply/yasr/build/ts/src/index.d.ts(50,26):
50:26 Type 'Plugin' is not generic.
    48 |     emptyFallbackElement(): void;
    49 |     getSelectedPluginName(): string;
  > 50 |     getSelectedPlugin(): Plugin<any>;
       |                          ^
    51 |     private updatePluginSelectors;
    52 |     private getCompatiblePlugins;
    53 |     draw(): void;
Version: typescript 3.7.5
LaurensRietveld commented 4 years ago

The newest release used the import type typescript syntax. But, didn't realise this syntax is preserved when creating the type definitions in the build directory. As a consequence, this made yasgui incompatible with older typescript versions (like 3.7.5). I've reverted the import type syntax changes for now, so all recent typescript versions are supported again.

Version 4.0.108 (the one that includes the fix) is being released now

retog commented 4 years ago

Thanks @LaurensRietveld, it is working now.