question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Switch To Typescript

See original GitHub issue

that’s good idea to create only one project for serene no script project anymore, but i have a little problem here:

  1. I use resharper and switch to typescript and causing duplicate identifier for all forms, i give one example below:

``` javascript` export class LanguageForm extends Serenity.PrefixedContext { static formKey = ‘Administration.Language’;

}
export interface LanguageForm {
    LanguageId: Serenity.StringEditor;
    LanguageName: Serenity.StringEditor;
}`
1. The project can build and running with error still there
2. With typescript i can't see intellisense again ...(i can live with that)
3. I have files with saltarelle now

Should i convert my existing project to typescript ?
Regards

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
volkanceylancommented, May 12, 2016

@ChenZhaobin, yes as that project is deleted now, updated their reference to an old commit in guide, thanks.

1reaction
volkanceylancommented, May 12, 2016

New Serene comes with one project only but this doesn’t mean there will be any changes to your project. I just dont want new users to write Saltaralle code anymore.

It might be a Resharper problem, maybe its not considering settings in tsconfig.json and ignoring TypeScriptCompiledBlocked setting in Web.csproj. If possible disable Resharper for TypeScript. One possibility is you have MyProject.Web.d.ts included into your project, it shouldn’t be. Check under scripts/site/ folder if there is a MyProject.Web.d.ts and if its included, exclude it from project.

Also check that you have this exclude config in tsconfig.json, replace Serene with your project name:

{
    "compileOnSave": true,
    "compilerOptions": {
        "preserveConstEnums": true,
        "experimentalDecorators": true,
        "declaration": true,
        "emitBOM": true,
        "sourceMap": true,
        "outFile": "Scripts/site/Serene.Web.js",
        "target": "ES5"
    },
    "exclude": [
        "Scripts/site/Serene.Web.d.ts"
    ]
}

I didn’t have that exclude part in tsconfig.json before. Updated guide.

Yes, you should try porting project, but me also have an app with 1000+ pages, which would take a very long time to port to TypeScript. So, i’ll try to preserve compability as long as possible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Migrating from JavaScript
Converting a JavaScript codebase over to TypeScript is, while somewhat tedious, usually not challenging. In this tutorial, we're going to look at how...
Read more >
JavaScript to TypeScript 101: A Comprehensive Guide
Step 1: Add TypeScript to the project · Step 2: Add the 'tsconfig.json' file · Step 3: Convert a file to TypeScript ·...
Read more >
TypeScript switch Statement
The switch statement is used to check for multiple values and executes sets of statements for each of those values. A switch statement...
Read more >
Converting a Javascript project to Typescript
Step 1: Install TypeScript compiler and loader · Step 2 · Step 3: Create a configuration file · Step 4: Setup Webpack ·...
Read more >
A simple guide for migrating from JavaScript to TypeScript
Another thing to keep in mind that makes migrating over a breeze is that you can configure your TypeScript compiler to allow JavaScript...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found