-
- Notifications
You must be signed in to change notification settings - Fork 447
Updating documentation related to mod30 changes #746
Conversation
*/ | ||
| ||
import application = require("application"); | ||
import * as application from "application"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we import only the used methods from application?
import { on, uncaughtErrorEvent } from "application";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed but I think it is better to leave this specific example to import application as it is more readable application.on
instead of just on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use:
import { on as applicationOn }
the application module exports 46 things and we don't need most of them. If we import the whole module we can't benefit from the treeshaking that uglify.js performs.
``` TypeScript | ||
import observable = require("data/observable"); | ||
import applicationSettings = require("application-settings"); | ||
import * as observable from "data/observable"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { EventData } from "data/observable";
import observable = require("data/observable"); | ||
import applicationSettings = require("application-settings"); | ||
import * as observable from "data/observable"; | ||
import * as applicationSettings from "application-settings"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
"es2016" | ||
"compilerOptions": { | ||
... | ||
"lib": ["es6", "dom"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should have comma at the end of the row
## isFileOrResourcePath method | ||
| ||
Allows you to verify if the specified path points to a resource or local file. The method will return boolen value: | ||
`true` - if the string contains valid path structure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the new line is not rendered correctly here - check out the md version of the article.
ui/action-bar.md Outdated
import observable = require("data/observable"); | ||
import view = require("ui/core/view"); | ||
import * as observable from "data/observable"; | ||
import * as view from "ui/core/view"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { View } from "ui/core/view";
ui/icon-fonts.md Outdated
import observable = require("data/observable"); | ||
import pages = require("ui/page"); | ||
import * as observable from "data/observable"; | ||
import * as pages from "ui/page"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { Page } from "ui/page";
ui/icon-fonts.md Outdated
``` TypeScript | ||
import observable = require("data/observable"); | ||
import pages = require("ui/page"); | ||
import * as observable from "data/observable"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { EventData, Observable } from "data/observable";
ui/placeholder.md Outdated
``` | ||
```TypeScript | ||
import placeholder = require("ui/placeholder"); | ||
import * as placeholder from "ui/placeholder"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { CreateViewEventData } from "ui/placeholder";
Also there is one more snippet below that needs to be updated.
core-concepts/utils.md Outdated
var utilsModule = require("tns-core-modules/utils/utils"); | ||
``` | ||
```TypeScript | ||
import * as utils from "tns-core-modules/utils/utils"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can write something like this instead:
import { ... } from "tns-core-modules/utils/utils";
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
new core-concepts/utils.md article + code snippet changes related to modules-30