Skip to content

Add "allowJs" parameter to tsconfig.json editor #213

Closed

Description

@PhaserEditor2D

Add "allowJs" parameter to tsconfig.json editor.

The TypeScript compiler could be a nice alternative to BabelJS by just enabling JavaScript compilation on it. I will work on this.

Activity

  1. PhaserEditor2D commented on Sep 22, 2017

    @PhaserEditor2D
    Author

    By the way, when I set allowJs=true in the tsconfig.json project, and I save a js file, it is not compiled. I will look into this too and create a new issue.

  2. PhaserEditor2D commented on Sep 22, 2017

    @PhaserEditor2D
    Author

    If you run tsc -w it is compiled, but in TypeScript IDE it is not, so I guess it is something related to the TypeScript IDE Builder.

  3. angelozerr commented on Sep 22, 2017

    @angelozerr
    Owner

    Do you compile with tsserver (compileOnSave) or with Eclipse launch?

  4. PhaserEditor2D commented on Sep 22, 2017

    @PhaserEditor2D
    Author

    I use compileOnSave, but it does not work on JS files. With TS files it works.

    But I confirmed the allowJS compiles JS files if I do it manually, in the Terminal, by doing:

    tsc -w -p tsconfig.json

  5. PhaserEditor2D commented on Sep 22, 2017

    @PhaserEditor2D
    Author

    Well, actually, it is not compiling now on save, even if what I am saving is a TS file. I have to compile the whole project in the jsconfig.json editor.

  6. PhaserEditor2D commented on Sep 22, 2017

    @PhaserEditor2D
    Author

    If I execute in the terminal tsc -w -p tsconfig.json it works like a charm.

  7. angelozerr commented on Sep 22, 2017

    @angelozerr
    Owner

    To be honnest with you, I have never played with allowJS.

    I think the problem comes from https://github.com/angelozerr/typescript.java/blob/master/eclipse/ts.eclipse.ide.core/src/ts/eclipse/ide/core/builder/TypeScriptBuilder.java#L136 where only ts files are compiled.

    I'm a little afraid to add *.js file in the filter. Perhaps the best mean is to check allowJs is declared in tsconfig.json (just fine a quick mean to do that).

  8. PhaserEditor2D commented on Sep 22, 2017

    @PhaserEditor2D
    Author

    Yes, probably we should add a new method:

    TypeScriptResourceUtil.isAllowCompilation(resource) that check if it is a TS, TSX or JS file. In case of the JS file, it has to check if allowJs is set to true.

  9. PhaserEditor2D commented on Sep 22, 2017

    @PhaserEditor2D
    Author

    Are you going to work on it? Or I do it myself?

  10. angelozerr commented on Sep 22, 2017

    @angelozerr
    Owner

    TypeScriptResourceUtil.isAllowCompilation(resource)

    Not sure that its a good idea for performance.

    Are you going to work on it? Or I do it myself?

    To be honnest with you I'm very busy with https://github.com/angelozerr/ec4e for the moment. I would like in the future migrate to lsp4e once features around GenericEditor will provide the same features than typescript.java

  11. PhaserEditor2D commented on Sep 22, 2017

    @PhaserEditor2D
    Author

    By the way, I think that to compute if a property is set in a jsconfig.json file could be something tricky, because you have to check inheritance. I think the best is to ask tsserver if a specific file is in the scope of compilation. I don't know if tsserver supports something like that.

  12. PhaserEditor2D commented on Sep 22, 2017

    @PhaserEditor2D
    Author

    To be honnest with you I'm very busy with https://github.com/angelozerr/ec4e for the moment. I would like in the future migrate to lsp4e once features around GenericEditor will provide the same features than typescript.java

    What kind of features is missing in GenericEditor?

  13. angelozerr commented on Sep 22, 2017

    @angelozerr
    Owner

    I think the best is to ask tsserver if a specific file is in the scope of compilation. I don't know if tsserver supports something like that.

    I suggest you to see https://github.com/angelozerr/typescript.java/search?utf8=%E2%9C%93&q=compileOnSaveAffectedFileList&type=

    But my fear is to call compileOnSaveAffectedFileList for each js files and kill performance. That's why I filter before with ts files to try having the best performances.

    What kind of features is missing in GenericEditor?

    Not directly in GenericEditor but around generic editor like match brackets, etc, but with tm4e language configuration I hope I will fix that.

  14. PhaserEditor2D commented on Sep 25, 2017

    @PhaserEditor2D
    Author

    Hi @angelozerr

    If you are going to migrate to lsp4e then do you plan to integrate everything into eclipse blue sky? Is Eclipse Blue Sky going to be the final solution to JS, TS, CSS, HTML editor in Eclipse? What do you think?

  15. angelozerr commented on Sep 25, 2017

    @angelozerr
    Owner

    If you are going to migrate to lsp4e then do you plan to integrate everything into eclipse blue sky?

    Yes it's my plan. I'm working to bluesky, tm4e, ec4e for the momeent to try to provide same features than WTP and even better like color (see eclipse-wildwebdeveloper/wildwebdeveloper#43 and eclipse-wildwebdeveloper/wildwebdeveloper#48)

  16. PhaserEditor2D commented on Sep 25, 2017

    @PhaserEditor2D
    Author

    Ok then I think I will look into blue sky too.

  17. angelozerr commented on Sep 25, 2017

    @angelozerr
    Owner

    Ok then I think I will look into blue sky too.

    There are a lot of work I think before migrating typescript.java to lsp4e/bluesky. More tsserver doesn't support lsp, it exists 2 projects for that, but they don't provide the same features than tsserver like compile on save, etc

  18. PhaserEditor2D commented on Sep 25, 2017

    @PhaserEditor2D
    Author

    Yes I am testing it and I find a lot of issues but I guess it is a matter of time to get it ready. The oldy JSDT has features that I think will "never" be available on a lsp solution, because JSDT inherits a lot of concepts from the Java world and lsp inherits concepts from the text editors world. But it looks like all the efforts are going to lsp, it is cheaper and could be improved in the future (for example, maybe the fantastic Tern could get into the game and replace the Salsa).

    For the moment I think I should wait again and keep on JSDT until blue sky gets ready. I was thinking on provide TypeScript IDE but I cannot attach to something is going to disappear. I hope lsp4e is going to stay for a long time.

  19. angelozerr commented on Sep 25, 2017

    @angelozerr
    Owner

    Yes I am testing it and I find a lot of issues but I guess it is a matter of time to get it ready.

    Yes, time is a big pb:)

    I was thinking on provide TypeScript IDE but I cannot attach to something is going to disappear

    My first thing that I would like to do is to remove JSDT in typescript.java and uses GenericEditor and tm4e language configuration once they will be ready to provide the same feature than typescript.java (like match brackets).

    After that I could continue to use tsserver and migrate to lsp4e (or not if I don't see advantages).

  20. PhaserEditor2D commented on Sep 25, 2017

    @PhaserEditor2D
    Author

    I think it is a good plan. I will continue supporting TypeScript IDE as a third party component. Right now when you create a Phaser Editor project for TypeScript or JS6 it adds the TypeScript IDE builder so it is ready out of the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions