Skip to content

Commit

Permalink
update dependencies (#1310)
Browse files Browse the repository at this point in the history
* update dependencies

* combine all tests

* cleanup

* update dependencies

* fixes

* bump version
  • Loading branch information
romainmenke authored Oct 31, 2022
1 parent 05c4923 commit 87231a4
Show file tree
Hide file tree
Showing 30 changed files with 781 additions and 1,069 deletions.
1,125 changes: 417 additions & 708 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"prettier": {
"useTabs": true
},
"version": "1.0.1",
"version": "1.0.2",
"volta": {
"node": "18.10.0"
}
Expand Down
49 changes: 0 additions & 49 deletions packages/babel-plugin-core-web/lib/injector.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const { addSideEffect } = require("@babel/helper-module-imports");
const { get, has } = require("@mrhenry/core-web");
const { matchNode } = require("./ast-matcher");
// const toposort = require('toposort');

const identifierMatcher = require("./matchers/__identifier_matcher");
const identifierMatcherMap = require("./matchers/__identifier_matcher_map.json");
Expand Down Expand Up @@ -62,54 +61,6 @@ class Injector {
// insert in reverse order
let all = [...this.importSet];

// const graph = all.flatMap((name) => {
// const edges = get(name).deps.map((dep) => {
// return [
// dep,
// name
// ];
// });

// edges.push([name, '~~bundle']);
// return edges;
// });

// // Some polyfills do not have direct dependency - dependant relationship, but still require a fixed loading order.
// if (this.importSet.has('~shadydom')) {
// if (this.importSet.has('~element-qsa-scope')) {
// graph.push([
// '~shadydom',
// '~element-qsa-scope',
// ]);
// }

// if (this.importSet.has('~element-qsa-has')) {
// graph.push([
// '~shadydom',
// '~element-qsa-has',
// ]);
// }
// }

// all = toposort(graph);

all = all.filter((importName) => {
// if (!this.importSet.has(importName)) {
// // "~~bundle" was inserted to create the directed acyclic graph
// // All dependencies and aliases have been added
// // Filtering by the original `importSet` contents restores the intended imports.
// return false;
// }

// Some polyfills can't coexist.
// "golden" should only be imported if "all" doesn't exist.
if (importName === 'Intl.DateTimeFormat.~timeZone.golden') {
return all.indexOf('Intl.DateTimeFormat.~timeZone.all') === -1;
}

return true;
});

while (all.length) {
const importName = all.pop();
addSideEffect(path, `@mrhenry/core-web/modules/${importName}`);
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Ab":[{"matcher":{"type":"Identifier","name":"AbortController"},"feature":"AbortController"}],"Au":[{"matcher":{"type":"Identifier","name":"AudioContext"},"feature":"AudioContext"}],"Bl":[{"matcher":{"type":"Identifier","name":"Blob"},"feature":"Blob"},{"matcher":{"type":"Identifier","name":"Blob"},"feature":"Blob"},{"matcher":{"type":"Identifier","name":"BlobBuilder"},"feature":"Blob"}],"Cu":[{"matcher":{"type":"Identifier","name":"CustomEvent"},"feature":"CustomEvent"}],"DO":[{"matcher":{"type":"Identifier","name":"DOMRect"},"feature":"DOMRect"},{"matcher":{"type":"Identifier","name":"DOMTokenList"},"feature":"DOMTokenList"},{"matcher":{"type":"Identifier","name":"DOMTokenList"},"feature":"DOMTokenList"}],"Do":[{"matcher":{"type":"Identifier","name":"DocumentFragment"},"feature":"DocumentFragment"}],"Ev":[{"matcher":{"type":"Identifier","name":"Event"},"feature":"Event"},{"matcher":{"type":"Identifier","name":"EventSource"},"feature":"EventSource"}],"HT":[{"matcher":{"type":"Identifier","name":"HTMLDocument"},"feature":"HTMLDocument"},{"matcher":{"type":"Identifier","name":"HTMLPictureElement"},"feature":"HTMLPictureElement"},{"matcher":{"type":"Identifier","name":"HTMLTemplateElement"},"feature":"HTMLTemplateElement"},{"matcher":{"type":"Identifier","name":"HTMLTemplateElement"},"feature":"HTMLTemplateElement"}],"In":[{"matcher":{"type":"Identifier","name":"IntersectionObserver"},"feature":"IntersectionObserver"},{"matcher":{"type":"Identifier","name":"IntersectionObserverEntry"},"feature":"IntersectionObserverEntry"},{"matcher":{"type":"Identifier","name":"IntersectionObserverEntry"},"feature":"IntersectionObserverEntry"}],"ma":[{"matcher":{"type":"Identifier","name":"matchMedia"},"feature":"MediaQueryList.prototype.addEventListener"},{"matcher":{"type":"Identifier","name":"matchMedia"},"feature":"matchMedia"},{"matcher":{"type":"Identifier","name":"matchMedia"},"feature":"matchMedia"}],"Me":[{"matcher":{"type":"Identifier","name":"MediaQueryList"},"feature":"MediaQueryList.prototype.addEventListener"},{"matcher":{"type":"Identifier","name":"MediaQueryList"},"feature":"matchMedia"}],"Mu":[{"matcher":{"type":"Identifier","name":"MutationObserver"},"feature":"MutationObserver"}],"Re":[{"matcher":{"type":"Identifier","name":"ResizeObserver"},"feature":"ResizeObserver"},{"matcher":{"type":"Identifier","name":"Request"},"feature":"fetch"},{"matcher":{"type":"Identifier","name":"Response"},"feature":"fetch"}],"Te":[{"matcher":{"type":"Identifier","name":"TextEncoder"},"feature":"TextEncoder"},{"matcher":{"type":"Identifier","name":"TextDecoder"},"feature":"TextDecoder"}],"Us":[{"matcher":{"type":"Identifier","name":"UserTiming"},"feature":"UserTiming"}],"at":[{"matcher":{"type":"Identifier","name":"atob"},"feature":"atob"}],"co":[{"matcher":{"type":"Identifier","name":"console"},"feature":"console"}],"de":[{"matcher":{"type":"Identifier","name":"devicePixelRatio"},"feature":"devicePixelRatio"}],"fe":[{"matcher":{"type":"Identifier","name":"fetch"},"feature":"fetch"},{"matcher":{"type":"Identifier","name":"fetch"},"feature":"fetch"}],"He":[{"matcher":{"type":"Identifier","name":"Headers"},"feature":"fetch"}],"Bo":[{"matcher":{"type":"Identifier","name":"Body"},"feature":"fetch"}],"re":[{"matcher":{"type":"Identifier","name":"requestAnimationFrame"},"feature":"requestAnimationFrame"},{"matcher":{"type":"Identifier","name":"requestIdleCallback"},"feature":"requestIdleCallback"}],"Sh":[{"matcher":{"type":"Identifier","name":"ShadyDOM"},"feature":"~shadydom"},{"matcher":{"type":"Identifier","name":"ShadyCSS"},"feature":"~shadycss-scoping-shim"},{"matcher":{"type":"Identifier","name":"ShadyCSS"},"feature":"~shadycss-apply-shim"}],"sh":[{"matcher":{"type":"Identifier","name":"shadowRoot"},"feature":"~shadydom"}],"sc":[{"matcher":{"type":"Identifier","name":"scroll"},"feature":"scroll"},{"matcher":{"type":"Identifier","name":"scrollBy"},"feature":"scrollBy"},{"matcher":{"type":"Identifier","name":"scrollIntoView"},"feature":"scrollIntoView"}]}
{"Ab":[{"matcher":{"type":"Identifier","name":"AbortController"},"feature":"AbortController"}],"Au":[{"matcher":{"type":"Identifier","name":"AudioContext"},"feature":"AudioContext"}],"Bl":[{"matcher":{"type":"Identifier","name":"Blob"},"feature":"Blob"},{"matcher":{"type":"Identifier","name":"Blob"},"feature":"Blob"},{"matcher":{"type":"Identifier","name":"BlobBuilder"},"feature":"Blob"}],"Cu":[{"matcher":{"type":"Identifier","name":"CustomEvent"},"feature":"CustomEvent"}],"DO":[{"matcher":{"type":"Identifier","name":"DOMRect"},"feature":"DOMRect"},{"matcher":{"type":"Identifier","name":"DOMTokenList"},"feature":"DOMTokenList"},{"matcher":{"type":"Identifier","name":"DOMTokenList"},"feature":"DOMTokenList"}],"Do":[{"matcher":{"type":"Identifier","name":"DocumentFragment"},"feature":"DocumentFragment"}],"Ev":[{"matcher":{"type":"Identifier","name":"Event"},"feature":"Event"},{"matcher":{"type":"Identifier","name":"EventSource"},"feature":"EventSource"}],"HT":[{"matcher":{"type":"Identifier","name":"HTMLDocument"},"feature":"HTMLDocument"},{"matcher":{"type":"Identifier","name":"HTMLPictureElement"},"feature":"HTMLPictureElement"},{"matcher":{"type":"Identifier","name":"HTMLTemplateElement"},"feature":"HTMLTemplateElement"},{"matcher":{"type":"Identifier","name":"HTMLTemplateElement"},"feature":"HTMLTemplateElement"}],"In":[{"matcher":{"type":"Identifier","name":"IntersectionObserver"},"feature":"IntersectionObserver"},{"matcher":{"type":"Identifier","name":"IntersectionObserverEntry"},"feature":"IntersectionObserverEntry"},{"matcher":{"type":"Identifier","name":"IntersectionObserverEntry"},"feature":"IntersectionObserverEntry"}],"ma":[{"matcher":{"type":"Identifier","name":"matchMedia"},"feature":"MediaQueryList.prototype.addEventListener"},{"matcher":{"type":"Identifier","name":"matchMedia"},"feature":"matchMedia"},{"matcher":{"type":"Identifier","name":"matchMedia"},"feature":"matchMedia"}],"Me":[{"matcher":{"type":"Identifier","name":"MediaQueryList"},"feature":"MediaQueryList.prototype.addEventListener"},{"matcher":{"type":"Identifier","name":"MediaQueryList"},"feature":"matchMedia"}],"Mu":[{"matcher":{"type":"Identifier","name":"MutationObserver"},"feature":"MutationObserver"}],"Re":[{"matcher":{"type":"Identifier","name":"ResizeObserver"},"feature":"ResizeObserver"},{"matcher":{"type":"Identifier","name":"Request"},"feature":"fetch"},{"matcher":{"type":"Identifier","name":"Response"},"feature":"fetch"}],"Te":[{"matcher":{"type":"Identifier","name":"TextEncoder"},"feature":"TextEncoder"},{"matcher":{"type":"Identifier","name":"TextDecoder"},"feature":"TextDecoder"}],"Us":[{"matcher":{"type":"Identifier","name":"UserTiming"},"feature":"UserTiming"}],"at":[{"matcher":{"type":"Identifier","name":"atob"},"feature":"atob"}],"co":[{"matcher":{"type":"Identifier","name":"console"},"feature":"console"}],"de":[{"matcher":{"type":"Identifier","name":"devicePixelRatio"},"feature":"devicePixelRatio"}],"fe":[{"matcher":{"type":"Identifier","name":"fetch"},"feature":"fetch"},{"matcher":{"type":"Identifier","name":"fetch"},"feature":"fetch"}],"He":[{"matcher":{"type":"Identifier","name":"Headers"},"feature":"fetch"}],"Bo":[{"matcher":{"type":"Identifier","name":"Body"},"feature":"fetch"}],"re":[{"matcher":{"type":"Identifier","name":"requestAnimationFrame"},"feature":"requestAnimationFrame"},{"matcher":{"type":"Identifier","name":"requestIdleCallback"},"feature":"requestIdleCallback"}],"Sh":[{"matcher":{"type":"Identifier","name":"ShadyDOM"},"feature":"~shadydom"},{"matcher":{"type":"Identifier","name":"ShadyCSS"},"feature":"~shadycss-scoping-shim"}],"sh":[{"matcher":{"type":"Identifier","name":"shadowRoot"},"feature":"~shadydom"}],"sc":[{"matcher":{"type":"Identifier","name":"scroll"},"feature":"scroll"},{"matcher":{"type":"Identifier","name":"scrollBy"},"feature":"scrollBy"},{"matcher":{"type":"Identifier","name":"scrollIntoView"},"feature":"scrollIntoView"}]}
4 changes: 2 additions & 2 deletions packages/babel-plugin-core-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mrhenry/babel-plugin-core-web",
"version": "1.0.1",
"version": "1.0.2",
"description": "browser feature polyfills as a babel plugin",
"main": "lib/index.js",
"author": "Simon Menke <[email protected]>",
Expand Down Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@babel/helper-module-imports": "^7.15.4",
"@babel/types": "^7.18.13",
"@mrhenry/core-web": "^1.0.1",
"@mrhenry/core-web": "^1.0.2",
"fast-deep-equal": "^3.1.3"
},
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core-web-example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mrhenry/core-web-example",
"version": "1.0.1",
"version": "1.0.2",
"private": true,
"scripts": {
"build": "babel src -d lib"
Expand Down

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

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

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

Loading

0 comments on commit 87231a4

Please sign in to comment.