apazureck / UI5TypescriptDeclarations

Typescript declarations for UI5
MIT License
15 stars 4 forks source link

Question: How to run it? #1

Open SunboX opened 7 years ago

SunboX commented 7 years ago

Hi,

I have to build it via $ gulp, that will launch the Chrome Browser, but the VSC debugger get's not attached. So if I start debugging, a second Chrome windows will be launched (and I have to close the first one).

Is this the right way or should I do something else?

apazureck commented 7 years ago

I think those steps should do the trick:

  1. Open the generator folder in vscode
  2. Go to your terminal
  3. Type npm install
  4. Type bower install
  5. Run the build task (CTRL + B) and wait until the browser sync has been started (may take a while). This will open your default browser (which explains your first open of chrome).
  6. Check in the debug section, which launch task is selected. It should be firefox, change it to chrome
  7. Press the run button or F5, which will bring up chrome (again) and attach the debugger.

Hope it works, I think I made a typo in some of the examples. Let me know if it does not work. I am currently on vacation and do not have my dev machine with me, so I cannot test it right now.

apazureck commented 7 years ago

And the generator is not really a generator, sorry. I started this project, but it is abandoned. Please use the declarations from here or dt. I am currently working on a generator with a modular ES6 syntax, which uses a custom typescript transpiler to convert to ui5 javascript style.

I referenced this on my ui5 extension as a template with bs and typescript chrome debugging.

RobertoMalatesta commented 7 years ago

Hi @apazureck. I just saw your July comments on Slack and I'm bringing the matter here just because @github is the only social that does not suck.

Would be nice to see some coordination on the typescript topic, as there are multiple TS definitions out there and it's getting more and more messy. I am just trying to use the typescript compiler API to get an ES6/AMD syntax style in ts and native UI5 code.

And I am not sure how they want to do that. Adjust their module system? Imports in Typescript would be handled like import { Button, Table } from "sap/m";, in UI5 you would have to write import * as Button from "sap/m/Button"; import * as Table from "sap/m/Table";.

But that's just cleaner/better syntax. And async and await is just working "perfectly" in TS, as they introduced a ES5 shim in TS version 2.1 or so. That was a real relief.

And going to ES6 syntax without decreasing performance on some places would be really challenging. They would need to provide some wrappers or just put out UI5 2.0. But let's see where this is going...

I frankly don't know what - apart Dummheitkonditioniertweltanschauung - is preventing the Sole contributor At Project UI5 to spend a couple of days of a few of their resources in creating an automatic emitter of TS bindings from documentation itself.

It would be a marketing winning edge as well, as it could foster adoption in teams where the web is seen as evil.

Nur Gott weiß warum nicht.

--R

apazureck commented 7 years ago

Oh I have done that, but I wanted to have a better syntax (ES6 syntax). And you could do much more than that, Generics for models, events, etc.

But I have a guess: SAP is distributing their own dev environment, so they are not interested in anything else, which will not make them money. Why use crappy slow and buggy software (yes, I have used their designer...), if you have a fast and lightweight open source solution? And it's a big, German company, so they tend to have each decision go through multiple committees until it passes. If you have a look at the starting point of some typescript projects, which was around October / November last year, I am not surprised of the lack of attendance.

And I think 90% of the customers using SAP UI are SAP customers anyway and, therefore, have their IDE and stuff and support, etc.

But I think it would be cheaper and easier for SAP to make offers to some devs already on that topic to make them a typescript generator instead of letting someone start from scratch. I think the DT declarations are from some company, which SAP could easily buy, I guess ;)

BTW @SunboX: Did my instructions work?

RobertoMalatesta commented 7 years ago

100% agree. I even ported the crappy slow IDE to work on my Linux machine to show it to developers that ask "Is there an official tool to write UI5 apps?" -- reactions are very funny. Next time that I set up a UI5 intro in some company I'll make a video of the devs seeing it for the first time and post it to youtube :grinning:

Fun (and sad as well) is that interest in UI5+TypeScript started to rise in 2014: https://github.com/SAP/openui5/issues/88 By that time UI5 had all the aces in its hand to become the framework, since Angular was pestilent (still it is crappy but TS made it win the race, and other frameworks are building on top of it: https://github.com/Teradata/covalent ).

Now, alternatives abound. Personally I'm leaning toward adopting TS with bare HTML5 + CSS + some components, since all you need in enterprise apps is:

Still I hope one day UI5 will be great again.

--R

sebi5000 commented 6 years ago

Hi,

i tried to use this definitions, because I want to test building ui5 Apps with typescript. I just installed npm and bower and compile tsc -w, but if start index.html in VSCode with F5 I just see an empty page and if I refresh I'm getting following error:

image

What can I miss? I set index.html at starting point in launch.json:

image

apazureck commented 6 years ago

I think you need run the gulp task instead of manually running tsc. Did you use ctrl+shift+b for the build task? It may not work anymore, as vscode changed the layout. In you out folder is no resources folder, thus the gulp installui5resources did not run.