Re: Typescript with vibe.d

2020-03-11 Thread GreatSam4sure via Digitalmars-d-learn

On Tuesday, 10 March 2020 at 08:55:56 UTC, Jacob Carlborg wrote:

On Monday, 9 March 2020 at 09:42:16 UTC, GreatSam4sure wrote:
I want to know if it is possible to use typescript with the 
vibe.d since typescript is a superset of javascript. I will 
appreciate any example if it is possible


There's a Diet filter for TypeScript here [1], but it hasn't 
been updated since 2015.


[1] https://code.dlang.org/packages/diet-typescript

--
/Jacob Carlborg


Thanks, it will be really nice to enable the use of typescript by 
default since it is type-safe. I will appreciate this feature of 
it can be added. I personally don't like dynamic languages due to 
lack of declaring a type for every variable


Re: Typescript with vibe.d

2020-03-10 Thread Jacob Carlborg via Digitalmars-d-learn

On Monday, 9 March 2020 at 09:42:16 UTC, GreatSam4sure wrote:
I want to know if it is possible to use typescript with the 
vibe.d since typescript is a superset of javascript. I will 
appreciate any example if it is possible


There's a Diet filter for TypeScript here [1], but it hasn't been 
updated since 2015.


[1] https://code.dlang.org/packages/diet-typescript

--
/Jacob Carlborg


Re: Typescript with vibe.d

2020-03-10 Thread GreatSam4sure via Digitalmars-d-learn
On Monday, 9 March 2020 at 17:46:42 UTC, Steven Schveighoffer 
wrote:

On 3/9/20 1:23 PM, GreatSam4sure wrote:

[...]


You can use it, but you have to compile it yourself. Vibe.d 
does nothing with the javascript except serve it to the 
browser. It has no restrictions on what files can be sent, but 
does not convert anything for you.



[...]


No. This means that if you wanted to use, for instance, a diet 
template to generate typescript, this would not work.


My recommendation in that case is to generate javascript data 
using diet templates, and use it from a Typescript file that is 
pre-compiled before being served via vibe.d.


-Steve



Thanks, that is what I want to know



Re: Typescript with vibe.d

2020-03-09 Thread Steven Schveighoffer via Digitalmars-d-learn

On 3/9/20 1:23 PM, GreatSam4sure wrote:

On Monday, 9 March 2020 at 15:11:48 UTC, Steven Schveighoffer wrote:

On 3/9/20 5:42 AM, GreatSam4sure wrote:
I want to know if it is possible to use typescript with the vibe.d 
since typescript is a superset of javascript. I will appreciate any 
example if it is possible


My understanding is that Typescript needs to be compiled to 
javascript. You can't serve typescript directly to a browser.


So as long as you are doing this in a separate file, vibe.d can serve 
up the javascript files just fine.


-Steve


I am working on a web app using a vibe.d but I prefer typescript to 
javascript. So I want to use typescript. My question is that can I use 
typescript instead of javascript since it must be compiled to 
javascript? 


You can use it, but you have to compile it yourself. Vibe.d does nothing 
with the javascript except serve it to the browser. It has no 
restrictions on what files can be sent, but does not convert anything 
for you.



Does the vibe.d framework compile typescript to javascript?


No. This means that if you wanted to use, for instance, a diet template 
to generate typescript, this would not work.


My recommendation in that case is to generate javascript data using diet 
templates, and use it from a Typescript file that is pre-compiled before 
being served via vibe.d.


-Steve


Re: Typescript with vibe.d

2020-03-09 Thread GreatSam4sure via Digitalmars-d-learn
On Monday, 9 March 2020 at 15:11:48 UTC, Steven Schveighoffer 
wrote:

On 3/9/20 5:42 AM, GreatSam4sure wrote:
I want to know if it is possible to use typescript with the 
vibe.d since typescript is a superset of javascript. I will 
appreciate any example if it is possible


My understanding is that Typescript needs to be compiled to 
javascript. You can't serve typescript directly to a browser.


So as long as you are doing this in a separate file, vibe.d can 
serve up the javascript files just fine.


-Steve


I am working on a web app using a vibe.d but I prefer typescript 
to javascript. So I want to use typescript. My question is that 
can I use typescript instead of javascript since it must be 
compiled to javascript? Does the vibe.d framework compile 
typescript to javascript?


Re: Typescript with vibe.d

2020-03-09 Thread Steven Schveighoffer via Digitalmars-d-learn

On 3/9/20 5:42 AM, GreatSam4sure wrote:
I want to know if it is possible to use typescript with the vibe.d since 
typescript is a superset of javascript. I will appreciate any example if 
it is possible


My understanding is that Typescript needs to be compiled to javascript. 
You can't serve typescript directly to a browser.


So as long as you are doing this in a separate file, vibe.d can serve up 
the javascript files just fine.


-Steve


Re: Typescript with vibe.d

2020-03-09 Thread Panke via Digitalmars-d-learn

On Monday, 9 March 2020 at 09:42:16 UTC, GreatSam4sure wrote:
I want to know if it is possible to use typescript with the 
vibe.d since typescript is a superset of javascript. I will 
appreciate any example if it is possible


What do you want to do?


Typescript with vibe.d

2020-03-09 Thread GreatSam4sure via Digitalmars-d-learn
I want to know if it is possible to use typescript with the 
vibe.d since typescript is a superset of javascript. I will 
appreciate any example if it is possible