Skip to content

Commit

Permalink
v3.5.0 (#382)
Browse files Browse the repository at this point in the history
* chore: update plugins list

* fix:  Fix fetch lose `Status, Time` in Network && Fix fetch error for text reponse.

* feat: copy log

* chore: remove transitionEnd

* docs: update changelog

* chore: update NPM dependencies

* docs: update doc

* fix(log): do not sort array's keys

* chore: update syntax

* fix(network): Fix `disableLogScrolling` not working in Network panel. (issue #282, #379)

* chore: add .npmignore

* Perf(System): Rename "System" field to "Client", and add `MacOS` version.

* style(log): fix copy style

* perf(log): use localeCompare to sort keys

* docs: update changelog

Co-authored-by: 王鑫凯 <[email protected]>
Co-authored-by: zimv <[email protected]>
Co-authored-by: akai <[email protected]>
  • Loading branch information
4 people authored Apr 28, 2021
1 parent 30e1d23 commit a3fd1b7
Show file tree
Hide file tree
Showing 18 changed files with 2,156 additions and 2,020 deletions.
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.babelrc
webpack.config.js
webpack.dev.config.js
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
English | [简体中文](./CHANGELOG_CN.md)

#### 3.5.0 (2021-04-28)

- `Feature(Log)` Add ability to copy a single line of logs. (by @akai)
- `Feature(Plugin)` New third-party plugin [vconsole-vue-devtools-plugin](https://github.com/Zippowxk/vue-vconsole-devtools). (by @Zippowxk)
- `Perf(System)` Rename "System" field to "Client", and add `MacOS` version.
- `Fix(Log)` Use natural sorting to sort object and array's keys. (issue #372)
- `Fix(Network)` Fix JSON parse error when `contentType` is `text/html`. (by @zimv)
- `Fix(Network)` Fix `disableLogScrolling` not working in Network panel. (issue #282, #379)


#### V3.4.1 (2021-04-09)

- `Feature(General)` Add `setSwitchPosition(x, y)` method to update the position of switch button, see [Public Properties & Methods](./doc/public_properties_methods.md) for more details.
Expand All @@ -19,7 +29,7 @@ English | [简体中文](./CHANGELOG_CN.md)
- `Feature(Network)` Add `fetch` log in Network tab. (by @weiqian93)
- `Feature(Network)` Add Request Headers to Network tab.
- `Feature(Network)` Use short URL and display parameters in Network tab. (issue #291)
- `Feature(Plugin)` New plugin [vconsole-stats-plugin](https://github.com/smackgg/vConsole-Stats). (by @smackgg)
- `Feature(Plugin)` New third-party plugin [vconsole-stats-plugin](https://github.com/smackgg/vConsole-Stats). (by @smackgg)
- `Fix(General)` The position of the switch button will be reset by mistake when clicked.
- `Fix(General)` Fix `document.documentElement.offsetHeight|offsetWidth` is unreliable in newer browsers. (by @littlee)
- `Fix(General)` Prevent dispatchEvent for disabled or readOnly elements. (by @norux)
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG_CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
[English](./CHANGELOG.md) | 简体中文

#### 3.5.0 (2021-04-28)

- `Feature(Log)` 新增复制单行日志的能力。 (by @akai)
- `Feature(Plugin)` 新第三方插件 [vconsole-vue-devtools-plugin](https://github.com/Zippowxk/vue-vconsole-devtools)。 (by @Zippowxk)
- `Perf(System)` 将 "System" 字段改名为 "Client",并新增 `MacOS` 系统版本号。
- `Fix(Log)` 使用自然排序来排序 object 和 array 的键值。 (issue #372)
- `Fix(Network)` 修复当 `contentType``text/html` 时潜在的 JSON 错误。 (by @zimv)
- `Fix(Network)` 修复 `disableLogScrolling` 参数在 Network 面板中不生效的问题。 (issue #282, #379)


#### V3.4.1 (2021-04-09)

- `Feature(General)` 新增 `setSwitchPosition(x, y)` 方法以更新开关按钮的位置,见 [Public Properties & Methods](./doc/public_properties_methods_CN.md)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Plugin:
- [Plugin: Event List](./doc/plugin_event_list.md)


## Plugins
## Third-party Plugins

- [vConsole-sources](https://github.com/WechatFE/vConsole-sources)
- [vconsole-webpack-plugin](https://github.com/diamont1001/vconsole-webpack-plugin)
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ vConsole 本体:



## 插件列表
## 第三方插件列表

- [vConsole-sources](https://github.com/WechatFE/vConsole-sources)
- [vconsole-webpack-plugin](https://github.com/diamont1001/vconsole-webpack-plugin)
Expand Down
1 change: 1 addition & 0 deletions dev/data/success.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ok
5 changes: 5 additions & 0 deletions dev/log.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
}
});

// setInterval(() => {
// console.log(Math.random());
// console.log('[system]', Math.random());
// }, 300);

function formattedLog() {
console.info('formattedLog() Start');
console.log('[default]', 'This log should be shown in Log tab.');
Expand Down
45 changes: 44 additions & 1 deletion dev/network.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,24 @@
<a onclick="getFetchSimple()" href="javascript:;" class="weui_btn weui_btn_default">getFetch(simple)</a>
<a onclick="postFetch()" href="javascript:;" class="weui_btn weui_btn_default">postFetch</a>
<a onclick="postFetchByRequest()" href="javascript:;" class="weui_btn weui_btn_default">postFetchByRequest</a>
<a onclick="getFetchText()" href="javascript:;" class="weui_btn weui_btn_default">getFetchText</a>
<a onclick="getAjaxText()" href="javascript:;" class="weui_btn weui_btn_default">getAjaxText</a>
</div>
</body>
</html>

<script>
window.vConsole = new window.VConsole();
window.vConsole = new window.VConsole({
maxLogNumber: 1000,
// disableLogScrolling: true,
onReady: function() {
console.log('vConsole is ready.');
}
});

// setInterval(() => {
// postAjax();
// }, 300);

function postAjax() {
console.info('postAjax() Start, response should be logged after End');
Expand Down Expand Up @@ -130,4 +142,35 @@
console.info('postFetchByRequest() End');
}


function getFetchText() {
console.info('getFetchText() Start, response should be logged after End');
window.fetch('./data/success.txt?type=fetch&id=' + Math.random(), {
method: 'GET',
headers: {
'custom-header': 'foobar',
'content-type': 'application/json'
},
}).then((data) => {
return data.text();
}).then((data) => {
console.log('getFetchText Response:', data);
});
console.info('getFetchText() End');
}

function getAjaxText() {
console.info('getAjaxText() Start, response should be logged after End');
const xhr = new XMLHttpRequest();
xhr.open('GET', './data/success.txt?type=xhr&id=' + Math.random());
xhr.setRequestHeader('custom-header', 'foobar');
xhr.send();
xhr.onload = () => {
console.log('getAjaxText Response:', xhr.response);
};
xhr.onerror = () => {
console.log('getAjaxText Error');
};
console.info('getAjaxText() End');
}
</script>
4 changes: 2 additions & 2 deletions dist/vconsole.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit a3fd1b7

Please sign in to comment.