Regions in TypeScript [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
In my JavaScript (.js) files, I use a Visual Studio 2012 plugin for regions (here) like this:
//#region "My Region"
//Code here
//#endregion "My Region"
I would also like to have regions in TypeScript (.ts) files as well. Is this a possibility right now?

You can download Web Essentials 2012, it lets you use regions in TypeScript.
If you use, Visual Studio 2015, here is the freshest link.
Web Essentials 2015.3

Visual Studio 2017 also has support for regions here.
Support via Web Essentials for older versions may be found here.

You can follow the TypeScript GitHub issue here
TypeScript Regions #11073
Still no ETA on when this will be implemented, currently awaiting more feedback.

To request a new feature for TypeScript, you should start a discussion on Codeplex.
There are lots of opinions about regions being a bad thing - perhaps they are telling you that you have too much in a single file. TypeScript has a great way to load modules from many different files and it may be better to use that to separate your concerns.

Related

Why do websites try to hide their front-end technoloies? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
Recently I started learning web development. I tried to read the HTML and CSS codes of some famous websites in my web browser. But I observed that they intentionally mess everything such as changing the real names of the bootstrap classes, while looking at the design architecture and page layout anyone could guess what kinds of technologies are used.
What would be the possible reasons?
I think it's not about security because any average programmer can still know everything about their front-end technologies if he puts some efforts.
There are multiple reasons.
Some companies, indeed, try to obfuscate some of all of the code to hinder some of the attacks. That is not 100% proof, of course, because a sophisticated actor can still reverse engineer almost any code that's out in the open.
However, most of the times it's simply how modern frontend development is done nowadays. The trend has been moving more and more towards using various build, bundle, code-minification and packaging tools. Like Webpack, for example.
What you see simply is a result of source code being processed packaged for optimal delivery and running in the browser.
The days when we could view web-page source and inspect pure HTML/JS/CSS, as it was written by the original developer, are long gone.

Node.js Server Side applications written in Typescript vs JS (ES5) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Note: By regular js I refer to the ES5 version of js.
I am currently setting up the foundation to a project. The tech stack that I currently have choosen to go with is Node.js for the back-end w/ Angular2 for the front-end/client-side and I am using Gulp as my build tool. In addition I have chosen to use Typescript for Angular.
I have already set up the gulpfile to do everything necessary for an optimal Typescript build. In fact the way I set everything up gulp can handle all the Typescript in the application, which led me to the realization it might be useful to write the whole application in Typescript vs regular (Node.js - Server) js. Although, when looking for pros and cons of doing so I have been unable to find any real references and instances where people recommend doing so or if it is better to just write the server side of the application without utilizing TS.
In short my question: Is it optimal to write the back and front end utilizing the Javascript superset Typescript? Are there any real Pros or Cons? I would appreciate any 'real' experiences. For example if there where any hurdles/workarounds that occurred or what made TS in server and client optimal in your case?
Thank you in advance, have a great day!
Is it optimal to write the back and front end utilizing the Javascript superset Typescript?
I would say yes : https://medium.com/#basarat/typescript-won-a4e0dfde4b08
But of course it is my opinion. The key choice is if you want statically analyzable code. It does help with tooling at the very least. More on why typescript https://basarat.gitbooks.io/typescript/content/docs/why-typescript.html.

What program does apple uses to create modular javascript files [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
When I looked at the new MacBook website from Apple I saw a nice smooth scrolling effect on the wireless page. I started digging in the JavaScript and found an uncompressed JavaScript file and I was blown away. (https://www.apple.com/v/macbook/a/scripts/wireless.built.js)
There were so many comments, and you could almost follow what they were thinking when they created this script. I tried to create a JavaScript file like this on my own, but in less than 5 minutes I figured out that it was almost impossible to keep it nice looking and understandable. So my question is: What program does Apple use to create this kind of JavaScript files? It is not a default code editor, but a program that supports built file. There are some good ones out there, but they all have libraries you have to follow, this one is just plain JavaScript and nothing more.
There's no tool to magically make your code look nice.
Apple has a strict code style guide that requires all developers to show discipline when writing code, or their code will be rejected from entering their repo.
It's nothing special really, just proper developer discipline.

What is the point of ActiveXObjects? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a task which requires me to create rows of tables using MSXML ActiveXObjects. I don't understand what an ActiveXObject has to do with anything. How could I create a table with that? Why wouldn't I just create the table in the HTML DOM?
I read various threads and concluded that there seems to be a layer within the browser that is responsible for data transport of non-html related data. Is this essentially the point of ActiveXObjects?
This is essentially what I am trying to make:
I just don't understand what roll the ActiveXObject plays here
It is actually pretty straight forward: the ActiveXObject is a Microsoft extension to JavaScript that provides you with an interface to Microsoft's software framework ActiveX. ActiveX basically is a set of modular software components which are used to build Microsoft's software products (which are in turn also available as ActiveX components, e.g. Excel).
Wikiped Article
You can find some examples on the use of the ActiveXObject in the link below.
MSDN Documentation
I can only guess what your task is, but if it involves at any point the use of a proprietary Microsoft specific software component, that would be the reason for using the ActiveXObject. Some functionalities provided by the ActiveXObject are however redundant (e.g. Microsoft.XMLHTTP since newer versions of Internet Explorer implement the standardized XMLHttpRequest interface).

Javascript IDE for agile development [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
Which IDE will suit agile development at its best? When I talk about agile, I primarily think about refactoring flexibility, powerful code browsing and all kinds of code inspection / warnings tips (similar to JSlint etc). Optionally, SVN/GIT integration would be nice to get supported as well as an ability to run both on Unix and Windows. Freeware or commercial - both options are valid.
Update: read this post, but the tools there support mainly Microsoft platforms (which is good thing, but alternatives are welcomed as well).
vim or Sublime text 2 combined with unix.
Why? Because JS is dynamic. So just use a text editor.
All IDEs leak with false positives on their code analysis.
Apatana is pretty good - it's available standalone or as an Eclipse plugin so you shouyld be able to use most of the support that that Eclipse has for SVN etc
even Eclipse EE with corresponding facet is quite good. But I will Also recommen you Apatana+Eclipse
I have been using PHPStorm for a good year now: http://www.jetbrains.com/phpstorm/.
It has an integrated GIT and SVN Client and you can run external applications such as jslint. You can include libraries such as jQuery and it has a good code formatter (one that actually works).
Also have a look at Webstorm: http://www.jetbrains.com/webstorm/.
(Webstorm = PHPStorm - PHP)
Finally chosen IntelliJ Idea Ultimate Edition - works out of the box, has an impressive code browsing and refactoring capabilities. Tried Eclipse and other related vendors, but (personally) found the installation procedure not that as 1-2-3 clicks easy as expected. All that said, this is only my personal subjective impression.

Categories

Resources