Skip to content

Commit

Permalink
fix(lib): upgrade dependencies
Browse files Browse the repository at this point in the history
Upgrade dependencies and add minor improvement.
  • Loading branch information
Masquerade-Circus committed Aug 5, 2020
1 parent 8d033a0 commit cc87ccd
Show file tree
Hide file tree
Showing 12 changed files with 2,990 additions and 2,347 deletions.
11 changes: 8 additions & 3 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"dist/valyrian.min.js": {
"bundled": 12898,
"minified": 5018,
"gzipped": 2069
"bundled": 12955,
"minified": 5036,
"gzipped": 2075
},
"valyrian.min.js": {
"bundled": 12953,
"minified": 5030,
"gzipped": 2068
}
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{
"deepcode.uploadApproved": true
}
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
### [4.3.1](https://github.com/Masquerade-Circus/valyrian.js/compare/4.3.0...4.3.1) (2020-04-10)


### Code Refactoring

* **directives:** identify create or update event on directives by undefined oldvnode ([594960f](https://github.com/Masquerade-Circus/valyrian.js/commit/594960f0226d494d61a7917b37ff038f94370f06))
- **directives:** identify create or update event on directives by undefined oldvnode ([594960f](https://github.com/Masquerade-Circus/valyrian.js/commit/594960f0226d494d61a7917b37ff038f94370f06))

## [4.3.0](https://github.com/Masquerade-Circus/valyrian.js/compare/4.2.3...4.3.0) (2020-04-06)

Expand Down
2 changes: 1 addition & 1 deletion dist/valyrian.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/valyrian.min.js.map

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function valyrian() {
let name = `__on${e.type}`;
while (dom) {
if (dom[name]) {
dom[name](e);
dom[name](e, dom);
if (!e.defaultPrevented) {
v.update();
}
Expand Down Expand Up @@ -256,11 +256,13 @@ function valyrian() {
}

if (newTree.length === 0) {
let i = oldTree.length;
while (i--) {
callRemove(oldTree[i]);
if (oldTree.length > 0) {
let i = oldTree.length;
while (i--) {
callRemove(oldTree[i]);
}
parentNode.dom.textContent = '';
}
parentNode.dom.textContent = '';

// Is keyed list
} else if (oldTree.length && newTree[0] instanceof Vnode && newTree[0].props.key) {
Expand Down
61 changes: 33 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"dev:scratchpad": "cross-env NODE_ENV=development nodemon -w ./test -w ./lib -w ./plugins -w ./scratchpad.js --exec 'mocha --timeout 10000 --slow 0 --require @babel/register --require esm \"scratchpad.js\"'",
"dev:test": "cross-env NODE_ENV=development nodemon -w ./test -w ./lib -w ./plugins --exec 'mocha --bail --timeout 10000 --slow 0 --require @babel/register --require esm \"test/**/*_test.js\"'",
"dev:test:nyc": "cross-env NODE_ENV=development nodemon -w ./test -w ./lib -w ./plugins --exec 'nyc --reporter=text --reporter=lcov mocha --timeout 10000 --slow 0 --require @babel/register --require esm \"test/**/*_test.js\"'",
"dev": "run-all 'yarn dev:source' 'yarn dev:test'",
"build": "yarn build:source && yarn remark",
"build:source": "cross-env NODE_ENV=production node rollupSource.js",
"test": "cross-env NODE_ENV=development nyc mocha --timeout 10000 --require @babel/register --require esm \"test/**/*_test.js\"",
Expand All @@ -46,53 +47,53 @@
"dependencies": {
"clean-css": "^4.2.3",
"cssnano": "^4.1.10",
"favicons": "^6.0.0",
"favicons": "^6.2.0",
"form-data": "^3.0.0",
"node-fetch": "^2.6.0",
"parse5": "^5.1.1",
"purgecss": "2.1.0"
"parse5": "^6.0.1",
"purgecss": "2.3.0"
},
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/plugin-transform-react-jsx": "^7.9.4",
"@babel/preset-env": "^7.9.0",
"@babel/register": "^7.9.0",
"@babel/core": "^7.11.0",
"@babel/plugin-transform-react-jsx": "^7.10.4",
"@babel/preset-env": "^7.11.0",
"@babel/register": "^7.10.5",
"@istanbuljs/nyc-config-babel": "^3.0.0",
"@release-it/conventional-changelog": "^1.1.0",
"@rollup/plugin-buble": "^0.21.1",
"@rollup/plugin-commonjs": "^11.0.2",
"@rollup/plugin-node-resolve": "^7.1.1",
"@release-it/conventional-changelog": "^1.1.4",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^14.0.0",
"@rollup/plugin-node-resolve": "^8.4.0",
"babel-eslint": "^10.1.0",
"babel-plugin-istanbul": "^6.0.0",
"compression": "^1.7.4",
"coveralls": "^3.0.11",
"coveralls": "^3.1.0",
"cross-env": "^7.0.2",
"cz-conventional-changelog": "3.1.0",
"dayjs": "^1.8.23",
"eslint": "^6.8.0",
"cz-conventional-changelog": "3.2.0",
"dayjs": "^1.8.31",
"eslint": "^7.6.0",
"eslint-plugin-sonarjs": "^0.5.0",
"esm": "^3.2.25",
"expect": "^25.2.7",
"expect": "^26.2.0",
"faker": "^4.1.0",
"micro": "^9.3.4",
"micro-ex-router": "^1.7.2",
"mocha": "^7.1.1",
"node-dev": "^4.0.0",
"nyc": "^15.0.1",
"release-it": "^13.5.1",
"remark-cli": "^8.0.0",
"mocha": "^8.1.0",
"node-dev": "^5.1.0",
"nyc": "^15.1.0",
"release-it": "^13.6.6",
"remark-cli": "^8.0.1",
"remark-toc": "^7.0.0",
"rollup": "^2.3.2",
"rollup": "^2.23.0",
"rollup-plugin-async": "^1.2.0",
"rollup-plugin-filesize": "^6.2.1",
"rollup-plugin-filesize": "^9.0.2",
"rollup-plugin-includepaths": "^0.2.3",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-progress": "^1.1.1",
"rollup-plugin-size-snapshot": "^0.11.0",
"rollup-plugin-sourcemaps": "^0.5.0",
"rollup-plugin-progress": "^1.1.2",
"rollup-plugin-size-snapshot": "^0.12.0",
"rollup-plugin-sourcemaps": "^0.6.2",
"rollup-plugin-string": "^3.0.0",
"rollup-plugin-terser": "^5.3.0",
"yargs": "^15.3.1"
"rollup-plugin-terser": "^6.1.0",
"yargs": "^15.4.1"
},
"babel": {
"presets": [
Expand Down Expand Up @@ -171,5 +172,9 @@
"yarn remark"
]
}
},
"resolutions": {
"jpeg-js": "^0.4.0",
"dot-prop": "^5.1.1"
}
}
12 changes: 4 additions & 8 deletions plugins/node.sw.tpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ let fetchedFromNetwork = (event) => (response) => {
caches
.open(config.version + config.name)
.then((cache) => cache.put(event.request, cacheCopy))
.then(() => Log('WORKER: fetch response stored in cache.', event.request.url));
.then(() => Log('WORKER: fetch response stored in cache.', event.request.url))
.catch((err) => Log('WORKER: fetch response could not be stored in cache.', err));
return response;
};

Expand All @@ -37,17 +38,15 @@ let unableToResolve = () => {
self.addEventListener('fetch', (event) => {
Log('WORKER: fetch event in progress.', event.request.url);

let url = new URL(event.request.url);

// We only handle Get requests all others let them pass
if (event.request.method !== 'GET') {
return;
}

// TODO: Make a callback available here to filter if this request must be catched or let it pass directly
// TODO: Make a callback available here to filter if this request must be cached or let it pass directly
// This callback must return true or false

Log('WORKER: fetchevent for ' + url);
Log('WORKER: fetchevent for ' + event.request.url);

event.respondWith(
caches.match(event.request).then((cached) => {
Expand All @@ -67,12 +66,9 @@ self.addEventListener('fetch', (event) => {

self.addEventListener('install', (event) => {
event.waitUntil(
// We can't use cache.add() here, since we want OFFLINE_URL to be the cache key, but
// the actual URL we end up requesting might include a cache-busting parameter.
caches
.open(config.version + config.name)
.then((cache) => cache.addAll(config.urls))
.catch((error) => console.error('WORKER: Failed to cache', error))
);
});

Expand Down
6 changes: 3 additions & 3 deletions rollupSource.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let rollup = require('rollup');
let commonjs = require('@rollup/plugin-commonjs');
let nodeResolve = require('@rollup/plugin-node-resolve');
let {nodeResolve} = require('@rollup/plugin-node-resolve');
let includepaths = require('rollup-plugin-includepaths');
let filesize = require('rollup-plugin-filesize');
let progress = require('rollup-plugin-progress');
Expand Down Expand Up @@ -53,15 +53,15 @@ if (process.env.NODE_ENV === 'production') {
outputOptions.sourcemap = false;
inputOptions.plugins.push(terser({
warnings: 'verbose',
sourcemap: false,
output: {
ecma: 6
}
}));
rollup
.rollup(inputOptions)
.then((bundle) => bundle.write(outputOptions))
.then(() => console.log('Bundle finished.'));
.then(() => console.log('Bundle finished.'))
.catch(console.log);
}

if (process.env.NODE_ENV !== 'production') {
Expand Down
5 changes: 3 additions & 2 deletions test/directives_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,13 @@ describe('Directives', () => {
});

/**
* The v-html directive is used to direct raw html render to increase performance
* The v-html directive is used to direct raw html render. It is just a helper directive
* and it does not improve performance because Valyrian.js is already very fast with vnodes.
* We can use this directive to replace the v.trust use like in this test
*/
describe('v-html', () => {
it('should handle direct html render', () => {
// Using v.trust example
// Using v.trust example
let Component = () => <div>{v.trust('<div>Hello world</div>')}</div>;
let result = v.mount('body', Component);

Expand Down
Loading

0 comments on commit cc87ccd

Please sign in to comment.