Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

chore: merge release in master #905

Merged
merged 3 commits into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
<a name="0.22.0"></a>
# [0.22.0](https://github.com/NativeScript/nativescript-dev-webpack/compare/0.21.0...0.22.0) (2019-05-15)


### Bug Fixes

* ignore the Webpack runtime chunks when sending HMR updates ([be82ab7](https://github.com/NativeScript/nativescript-dev-webpack/commit/be82ab7))
* show proper stack traces from uglified code (split by new line instead of semicolon) ([0ae6030](https://github.com/NativeScript/nativescript-dev-webpack/commit/0ae6030))
* sourceMap not generated with Uglify ([#819](https://github.com/NativeScript/nativescript-dev-webpack/issues/819)) ([b5fd066](https://github.com/NativeScript/nativescript-dev-webpack/commit/b5fd066))
* support platform specific files that are not directly imported anywhere in the app ([#843](https://github.com/NativeScript/nativescript-dev-webpack/issues/843)) ([e1e9463](https://github.com/NativeScript/nativescript-dev-webpack/commit/e1e9463))
* update the css loader in order to fix a bug with leading dashes of css classes ([#847](https://github.com/NativeScript/nativescript-dev-webpack/issues/847)) ([7670e33](https://github.com/NativeScript/nativescript-dev-webpack/commit/7670e33))
* **hmr:** run ts-loader in transpileOnly mode ([#878](https://github.com/NativeScript/nativescript-dev-webpack/issues/878)) ([0317729](https://github.com/NativeScript/nativescript-dev-webpack/commit/0317729))


### Features

* replace UglifyJs with Terser ([621090a](https://github.com/NativeScript/nativescript-dev-webpack/commit/621090a))
* support hidden source maps to map error stack traces from crash reports ([#854](https://github.com/NativeScript/nativescript-dev-webpack/issues/854)) ([dbcfbc2](https://github.com/NativeScript/nativescript-dev-webpack/commit/dbcfbc2))


<a name="0.21.2"></a>
## [0.21.2](https://github.com/NativeScript/nativescript-dev-webpack/compare/0.21.0...0.21.2) (2019-04-22)

Expand Down Expand Up @@ -531,7 +551,7 @@ module.exports = env => {
nsWebpack.loadAdditionalPlugins({ projectDir: projectRoot }); // <----- Add this line

// ...
```
```

* The `getAppPath` method expects two arguments now - `platform` and `projectRoot`. The usage inside the project's `webpack.config.js` should be changed in the following way:

Expand Down
18 changes: 16 additions & 2 deletions snapshot/android/snapshot-generator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require("fs");
const { dirname, join } = require("path");
const { dirname, join, EOL } = require("path");
const os = require("os");
const child_process = require("child_process");

Expand All @@ -12,6 +12,7 @@ const BUNDLE_PREAMBLE_PATH = join(__dirname, "snapshot-generator-tools/bundle-pr
const BUNDLE_ENDING_PATH = join(__dirname, "snapshot-generator-tools/bundle-ending.js");
const INCLUDE_GRADLE_PATH = join(__dirname, "snapshot-generator-tools/include.gradle");
const MKSNAPSHOT_TOOLS_DOWNLOAD_ROOT_URL = "https://raw.githubusercontent.com/NativeScript/mksnapshot-tools/production/";
const MKSNAPSHOT_TOOLS_DOWNLOAD_TIMEOUT = 60000;
const SNAPSHOT_BLOB_NAME = "TNSSnapshot";

function shellJsExecuteInDir(dir, action) {
Expand Down Expand Up @@ -66,7 +67,20 @@ SnapshotGenerator.prototype.downloadMksnapshotTool = function(snapshotToolsPath,

const downloadUrl = MKSNAPSHOT_TOOLS_DOWNLOAD_ROOT_URL + mksnapshotToolRelativePath;
createDirectory(dirname(mksnapshotToolPath));
snapshotToolsDownloads[mksnapshotToolPath] = downloadFile(downloadUrl, mksnapshotToolPath);
snapshotToolsDownloads[mksnapshotToolPath] = downloadFile(downloadUrl, mksnapshotToolPath, MKSNAPSHOT_TOOLS_DOWNLOAD_TIMEOUT);
snapshotToolsDownloads[mksnapshotToolPath].catch(err => {
const errorMessage = err && err.message ? err.message : "";
let cleanupError = "";
try {
fs.unlinkSync(mksnapshotToolPath);
} catch (unlinkErr) {
if (unlinkErr && unlinkErr.code !== "ENOENT") {
cleanupError = `${EOL}Failed to cleanup mksnapshot tool.`;
}
}

throw new Error(`Failed to download mksnapshot tool. Error: ${errorMessage}.${cleanupError}`);
});
return snapshotToolsDownloads[mksnapshotToolPath];
}

Expand Down
8 changes: 4 additions & 4 deletions snapshot/android/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const CONSTANTS = {

const createDirectory = dir => mkdir('-p', dir);

const downloadFile = (url, destinationFilePath) =>
const downloadFile = (url, destinationFilePath, timeout) =>
new Promise((resolve, reject) => {
getRequestOptions(url)
getRequestOptions(url, timeout)
.then(options =>
get(options)
.on("error", reject)
Expand Down Expand Up @@ -49,9 +49,9 @@ const getJsonFile = url =>
).catch(reject);
});

const getRequestOptions = (url) =>
const getRequestOptions = (url, timeout) =>
new Promise((resolve, reject) => {
const options = { url };
const options = { url, timeout };
getProxySettings()
.then(proxySettings => {
const allOptions = Object.assign(options, proxySettings);
Expand Down