-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doc Error - Worse than no Doc: JQuery Import Fails using ES6 #20266
Comments
The module is defined in |
I have read all of this trying to understand and make it work. The documentation and tools are not aligned or I would have been able to do this I’m sure. I am using a VS2017 15.5 Preview 4 version in a ASP.NET Core 2.0 (2.0.1) project that is using the standard tools. It does NOT have a tsconfig.json file. It is using the tools. I have not been able to import even my own modules (files). I have tried every setting on the tooling page (there aren’t that many) to hit on a combination and nothing I have done has allowed me to import ANY module mine or JQuery or anything else. There is a deficiency here in the documentation. There is NO working project that I can find to even copy and the tooling templates do not create a working sample.
I am getting work done by putting everything in a single .ts file and mostly writing a lot of JavaScript there. I’m sure that this is not the intended approach. The documentation does not give me enough direction to understand what the approach should be. I don’t know at this point if the “web” application is fundamentally different from and node.js app for example that the loaders are therefore different.
What I think I need is a direction like this… If you are building an application for web and using .NET Core then you need these things: {things I need.} It works this way: {basically how it works}. You should expect this when it is built: {what I should see in my project}. From here I think I could figure it out. At this point I am just getting more confused. There is so much conflicting information out there that I do not have an authoritative source.
I picked YOU as the authority because you talk with Anders and he is the Apostille.
Thank you for helping me.
Larry
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
…________________________________
From: Mohamed Hegazy <[email protected]>
Sent: Monday, November 27, 2017 3:26:41 PM
To: Microsoft/TypeScript
Cc: Larry Aultman; Author
Subject: Re: [Microsoft/TypeScript] Doc Error - Worse than no Doc: JQuery Import Fails using ES6 (#20266)
The module is defined in JQuery.d.ts a few lines below, and it does have a default. I am fine changing the name of the module to something else less specific to avoid the confusion.
A PR is welcomed. the sources of the handbook can be found at https://github.com/Microsoft/TypeScript-Handbook. This specific file is at https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Modules.md
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#20266 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ATVSMjpP8TLUhCbtNtonxhiJNBKk43Diks5s6xsAgaJpZM4Qqji1>.
|
Thanks Troy, I appreciate the references. I have followed the tutorials and in fact the very one you referenced, first. The problems are the gaps between where the tools and language and the documentation. I know nobody has time to do documentation and I know it MUST lag behind the development. I also know that I must invest in myself. BUT, what I really think is missing is the intent. Coming in completely cold, I don’t have the background knowledge. So lots of the verbiage is meaningless.
In short the tutorials are out of date far enough that they don’t work with current tools. Setups don’t work, references are stale, and thus the documentation makes no sense.
In a real world sense – I must turn back to what we do know that works and abandon this effort. In my opinion the TypeScript and tools set is not useful to the layman only to the elite insiders. This is typified by a comment from a apparently prime contributor who from his own words has not more time for those who are the uneducated. Pure arrogance.
Thanks for trying, we are no longer looking.
Larry
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
…________________________________
From: Troy Gerwien <[email protected]>
Sent: Thursday, November 30, 2017 5:42:05 AM
To: Microsoft/TypeScript
Cc: Larry Aultman; Author
Subject: Re: [Microsoft/TypeScript] Doc Error - Worse than no Doc: JQuery Import Fails using ES6 (#20266)
There are some tutorials in the handbook<https://www.typescriptlang.org/docs/home.html> - maybe this one<https://www.typescriptlang.org/docs/handbook/asp-net-core.html> would help you?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#20266 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ATVSMoGdJsIWg-lz2BG2iutp0V72lv0xks5s7oZ9gaJpZM4Qqji1>.
|
The handbook has been rewritten, so this is moot. |
The documentation specifically references the JQuery import using the current ES6 syntax which does not work.
From this page: https://www.typescriptlang.org/docs/handbook/modules.html we read...
Default exports
Each module can optionally export a default export. Default exports are marked with the keyword default; and there can only be one default export per module. default exports are imported using a different import form.
default exports are really handy. For instance, a library like JQuery might have a default export of jQuery or $, which we’d probably also import under the name $ or jQuery.
From the above, I like other readers would suppose the JQuery does in fact have a "default". It does not as Visual Studio/Resharper clearly report.
After many hours over two days of searching I found this comment by Anders Hejlsberg from March 2015.
#2242 (comment) which explicitly states the correct usage. @ahejlsberg
Correct documentation is critical. Incorrect documentation costs companies lots of money and devalues the product.
Thank you in advance for making the corrections.
-Larry
The text was updated successfully, but these errors were encountered: