@trickfilm400/rollup-plugin-off-main-thread 2.2.3-fix → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/.travis.yml +8 -8
  2. package/CONTRIBUTING +27 -27
  3. package/CONTRIBUTORS +11 -11
  4. package/LICENSE +202 -202
  5. package/README.md +97 -97
  6. package/index.js +318 -318
  7. package/karma.conf.js +46 -46
  8. package/loader.ejs +76 -76
  9. package/package.json +42 -39
  10. package/run_tests.js +105 -105
  11. package/tests/amd-function-name.test.js +33 -33
  12. package/tests/asset-in-worker.test.js +33 -33
  13. package/tests/dynamic-import.test.js +33 -33
  14. package/tests/fixtures/amd-function-name/a.js +16 -16
  15. package/tests/fixtures/amd-function-name/build/runner.html +15 -15
  16. package/tests/fixtures/amd-function-name/config.json +3 -3
  17. package/tests/fixtures/amd-function-name/entry.js +22 -22
  18. package/tests/fixtures/assets-in-worker/build/runner.html +15 -15
  19. package/tests/fixtures/assets-in-worker/entry.js +17 -17
  20. package/tests/fixtures/assets-in-worker/rollup.config.js +25 -25
  21. package/tests/fixtures/assets-in-worker/worker.js +18 -18
  22. package/tests/fixtures/dynamic-import/a.js +16 -16
  23. package/tests/fixtures/dynamic-import/build/runner.html +15 -15
  24. package/tests/fixtures/dynamic-import/entry.js +14 -14
  25. package/tests/fixtures/import-meta/a.js +16 -16
  26. package/tests/fixtures/import-meta/build/runner.html +15 -15
  27. package/tests/fixtures/import-meta/entry.js +14 -14
  28. package/tests/fixtures/import-meta-worker/a.js +12 -12
  29. package/tests/fixtures/import-meta-worker/build/runner.html +15 -15
  30. package/tests/fixtures/import-meta-worker/entry.js +22 -22
  31. package/tests/fixtures/import-worker-url/a.js +16 -16
  32. package/tests/fixtures/import-worker-url/b.js +16 -16
  33. package/tests/fixtures/import-worker-url/build/runner.html +15 -15
  34. package/tests/fixtures/import-worker-url/entry.js +21 -21
  35. package/tests/fixtures/import-worker-url/worker.js +17 -17
  36. package/tests/fixtures/import-worker-url-custom-scheme/a.js +16 -16
  37. package/tests/fixtures/import-worker-url-custom-scheme/b.js +16 -16
  38. package/tests/fixtures/import-worker-url-custom-scheme/build/runner.html +15 -15
  39. package/tests/fixtures/import-worker-url-custom-scheme/config.json +3 -3
  40. package/tests/fixtures/import-worker-url-custom-scheme/entry.js +21 -21
  41. package/tests/fixtures/import-worker-url-custom-scheme/worker.js +17 -17
  42. package/tests/fixtures/module-worker/a.js +20 -20
  43. package/tests/fixtures/module-worker/b.js +20 -20
  44. package/tests/fixtures/module-worker/build/runner.html +15 -15
  45. package/tests/fixtures/module-worker/entry.js +17 -17
  46. package/tests/fixtures/module-worker/rollup.config.js +4 -4
  47. package/tests/fixtures/module-worker/worker.js +17 -17
  48. package/tests/fixtures/more-workers/a.js +16 -16
  49. package/tests/fixtures/more-workers/b.js +16 -16
  50. package/tests/fixtures/more-workers/build/runner.html +15 -15
  51. package/tests/fixtures/more-workers/entry.js +34 -34
  52. package/tests/fixtures/more-workers/worker_a.js +16 -16
  53. package/tests/fixtures/more-workers/worker_b.js +18 -18
  54. package/tests/fixtures/public-path/a.js +16 -16
  55. package/tests/fixtures/public-path/build/runner.html +15 -15
  56. package/tests/fixtures/public-path/config.json +3 -3
  57. package/tests/fixtures/public-path/entry.js +14 -14
  58. package/tests/fixtures/simple-bundle/a.js +16 -16
  59. package/tests/fixtures/simple-bundle/build/runner.html +15 -15
  60. package/tests/fixtures/simple-bundle/entry.js +16 -16
  61. package/tests/fixtures/single-default/a.js +14 -14
  62. package/tests/fixtures/single-default/build/runner.html +15 -15
  63. package/tests/fixtures/single-default/entry.js +16 -16
  64. package/tests/fixtures/url-import-meta-worker/a.js +17 -17
  65. package/tests/fixtures/url-import-meta-worker/b.js +16 -16
  66. package/tests/fixtures/url-import-meta-worker/build/runner.html +15 -15
  67. package/tests/fixtures/url-import-meta-worker/entry.js +20 -20
  68. package/tests/fixtures/url-import-meta-worker/worker.js +16 -16
  69. package/tests/fixtures/worker/a.js +17 -17
  70. package/tests/fixtures/worker/b.js +16 -16
  71. package/tests/fixtures/worker/build/runner.html +15 -15
  72. package/tests/fixtures/worker/entry.js +18 -18
  73. package/tests/fixtures/worker/worker.js +16 -16
  74. package/tests/import-meta-worker.test.js +37 -37
  75. package/tests/import-meta.test.js +33 -33
  76. package/tests/import-worker-url-custom-scheme.test.js +42 -42
  77. package/tests/import-worker-url.test.js +41 -41
  78. package/tests/module-worker.test.js +47 -47
  79. package/tests/more-workers.test.js +33 -33
  80. package/tests/public-path.test.js +33 -33
  81. package/tests/simple-bundle.test.js +33 -33
  82. package/tests/single-default.test.js +33 -33
  83. package/tests/url-import-meta-worker.test.js +34 -34
  84. package/tests/worker.test.js +33 -33
  85. package/.github/workflows/ci.yml +0 -32
  86. package/CODEOWNERS +0 -1
  87. package/Dockerfile +0 -20
  88. package/renovate.json +0 -3
@@ -1,33 +1,33 @@
1
- /**
2
- * Copyright 2018 Google Inc. All Rights Reserved.
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- * http://www.apache.org/licenses/LICENSE-2.0
7
- * Unless required by applicable law or agreed to in writing, software
8
- * distributed under the License is distributed on an "AS IS" BASIS,
9
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- * See the License for the specific language governing permissions and
11
- * limitations under the License.
12
- */
13
-
14
- describe("Worker", function() {
15
- beforeEach(function() {
16
- this.ifr = document.createElement("iframe");
17
- document.body.append(this.ifr);
18
- });
19
-
20
- afterEach(function() {
21
- this.ifr.remove();
22
- });
23
-
24
- it("can load multiple workers", function(done) {
25
- window.addEventListener("message", function l(ev) {
26
- if (ev.data === "a") {
27
- window.removeEventListener("message", l);
28
- done();
29
- }
30
- });
31
- this.ifr.src = "/base/tests/fixtures/more-workers/build/runner.html";
32
- });
33
- });
1
+ /**
2
+ * Copyright 2018 Google Inc. All Rights Reserved.
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS,
9
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ * See the License for the specific language governing permissions and
11
+ * limitations under the License.
12
+ */
13
+
14
+ describe("Worker", function() {
15
+ beforeEach(function() {
16
+ this.ifr = document.createElement("iframe");
17
+ document.body.append(this.ifr);
18
+ });
19
+
20
+ afterEach(function() {
21
+ this.ifr.remove();
22
+ });
23
+
24
+ it("can load multiple workers", function(done) {
25
+ window.addEventListener("message", function l(ev) {
26
+ if (ev.data === "a") {
27
+ window.removeEventListener("message", l);
28
+ done();
29
+ }
30
+ });
31
+ this.ifr.src = "/base/tests/fixtures/more-workers/build/runner.html";
32
+ });
33
+ });
@@ -1,33 +1,33 @@
1
- /**
2
- * Copyright 2018 Google Inc. All Rights Reserved.
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- * http://www.apache.org/licenses/LICENSE-2.0
7
- * Unless required by applicable law or agreed to in writing, software
8
- * distributed under the License is distributed on an "AS IS" BASIS,
9
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- * See the License for the specific language governing permissions and
11
- * limitations under the License.
12
- */
13
-
14
- describe("Public Path", function() {
15
- beforeEach(function() {
16
- this.ifr = document.createElement("iframe");
17
- document.body.append(this.ifr);
18
- });
19
-
20
- afterEach(function() {
21
- this.ifr.remove();
22
- });
23
-
24
- it("loads transpiled modules", function(done) {
25
- window.addEventListener("message", function l(ev) {
26
- if (ev.data === "a") {
27
- window.removeEventListener("message", l);
28
- done();
29
- }
30
- });
31
- this.ifr.src = "/base/tests/fixtures/public-path/build/runner.html";
32
- });
33
- });
1
+ /**
2
+ * Copyright 2018 Google Inc. All Rights Reserved.
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS,
9
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ * See the License for the specific language governing permissions and
11
+ * limitations under the License.
12
+ */
13
+
14
+ describe("Public Path", function() {
15
+ beforeEach(function() {
16
+ this.ifr = document.createElement("iframe");
17
+ document.body.append(this.ifr);
18
+ });
19
+
20
+ afterEach(function() {
21
+ this.ifr.remove();
22
+ });
23
+
24
+ it("loads transpiled modules", function(done) {
25
+ window.addEventListener("message", function l(ev) {
26
+ if (ev.data === "a") {
27
+ window.removeEventListener("message", l);
28
+ done();
29
+ }
30
+ });
31
+ this.ifr.src = "/base/tests/fixtures/public-path/build/runner.html";
32
+ });
33
+ });
@@ -1,33 +1,33 @@
1
- /**
2
- * Copyright 2018 Google Inc. All Rights Reserved.
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- * http://www.apache.org/licenses/LICENSE-2.0
7
- * Unless required by applicable law or agreed to in writing, software
8
- * distributed under the License is distributed on an "AS IS" BASIS,
9
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- * See the License for the specific language governing permissions and
11
- * limitations under the License.
12
- */
13
-
14
- describe("Simple bundle", function() {
15
- beforeEach(function() {
16
- this.ifr = document.createElement("iframe");
17
- document.body.append(this.ifr);
18
- });
19
-
20
- afterEach(function() {
21
- this.ifr.remove();
22
- });
23
-
24
- it("loads transpiled modules", function(done) {
25
- window.addEventListener("message", function l(ev) {
26
- if (ev.data === "a") {
27
- window.removeEventListener("message", l);
28
- done();
29
- }
30
- });
31
- this.ifr.src = "/base/tests/fixtures/simple-bundle/build/runner.html";
32
- });
33
- });
1
+ /**
2
+ * Copyright 2018 Google Inc. All Rights Reserved.
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS,
9
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ * See the License for the specific language governing permissions and
11
+ * limitations under the License.
12
+ */
13
+
14
+ describe("Simple bundle", function() {
15
+ beforeEach(function() {
16
+ this.ifr = document.createElement("iframe");
17
+ document.body.append(this.ifr);
18
+ });
19
+
20
+ afterEach(function() {
21
+ this.ifr.remove();
22
+ });
23
+
24
+ it("loads transpiled modules", function(done) {
25
+ window.addEventListener("message", function l(ev) {
26
+ if (ev.data === "a") {
27
+ window.removeEventListener("message", l);
28
+ done();
29
+ }
30
+ });
31
+ this.ifr.src = "/base/tests/fixtures/simple-bundle/build/runner.html";
32
+ });
33
+ });
@@ -1,33 +1,33 @@
1
- /**
2
- * Copyright 2018 Google Inc. All Rights Reserved.
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- * http://www.apache.org/licenses/LICENSE-2.0
7
- * Unless required by applicable law or agreed to in writing, software
8
- * distributed under the License is distributed on an "AS IS" BASIS,
9
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- * See the License for the specific language governing permissions and
11
- * limitations under the License.
12
- */
13
-
14
- describe("Single default const export", function() {
15
- beforeEach(function() {
16
- this.ifr = document.createElement("iframe");
17
- document.body.append(this.ifr);
18
- });
19
-
20
- afterEach(function() {
21
- this.ifr.remove();
22
- });
23
-
24
- it("loads transpiled modules", function(done) {
25
- window.addEventListener("message", function l(ev) {
26
- if (ev.data === 4) {
27
- window.removeEventListener("message", l);
28
- done();
29
- }
30
- });
31
- this.ifr.src = "/base/tests/fixtures/single-default/build/runner.html";
32
- });
33
- });
1
+ /**
2
+ * Copyright 2018 Google Inc. All Rights Reserved.
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS,
9
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ * See the License for the specific language governing permissions and
11
+ * limitations under the License.
12
+ */
13
+
14
+ describe("Single default const export", function() {
15
+ beforeEach(function() {
16
+ this.ifr = document.createElement("iframe");
17
+ document.body.append(this.ifr);
18
+ });
19
+
20
+ afterEach(function() {
21
+ this.ifr.remove();
22
+ });
23
+
24
+ it("loads transpiled modules", function(done) {
25
+ window.addEventListener("message", function l(ev) {
26
+ if (ev.data === 4) {
27
+ window.removeEventListener("message", l);
28
+ done();
29
+ }
30
+ });
31
+ this.ifr.src = "/base/tests/fixtures/single-default/build/runner.html";
32
+ });
33
+ });
@@ -1,34 +1,34 @@
1
- /**
2
- * Copyright 2018 Google Inc. All Rights Reserved.
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- * http://www.apache.org/licenses/LICENSE-2.0
7
- * Unless required by applicable law or agreed to in writing, software
8
- * distributed under the License is distributed on an "AS IS" BASIS,
9
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- * See the License for the specific language governing permissions and
11
- * limitations under the License.
12
- */
13
-
14
- describe("Worker", function() {
15
- beforeEach(function() {
16
- this.ifr = document.createElement("iframe");
17
- document.body.append(this.ifr);
18
- });
19
-
20
- afterEach(function() {
21
- this.ifr.remove();
22
- });
23
-
24
- it("loads module-relative worker paths", function(done) {
25
- window.addEventListener("message", function l(ev) {
26
- if (ev.data === "a") {
27
- window.removeEventListener("message", l);
28
- done();
29
- }
30
- });
31
- this.ifr.src =
32
- "/base/tests/fixtures/url-import-meta-worker/build/runner.html";
33
- });
34
- });
1
+ /**
2
+ * Copyright 2018 Google Inc. All Rights Reserved.
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS,
9
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ * See the License for the specific language governing permissions and
11
+ * limitations under the License.
12
+ */
13
+
14
+ describe("Worker", function() {
15
+ beforeEach(function() {
16
+ this.ifr = document.createElement("iframe");
17
+ document.body.append(this.ifr);
18
+ });
19
+
20
+ afterEach(function() {
21
+ this.ifr.remove();
22
+ });
23
+
24
+ it("loads module-relative worker paths", function(done) {
25
+ window.addEventListener("message", function l(ev) {
26
+ if (ev.data === "a") {
27
+ window.removeEventListener("message", l);
28
+ done();
29
+ }
30
+ });
31
+ this.ifr.src =
32
+ "/base/tests/fixtures/url-import-meta-worker/build/runner.html";
33
+ });
34
+ });
@@ -1,33 +1,33 @@
1
- /**
2
- * Copyright 2018 Google Inc. All Rights Reserved.
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- * http://www.apache.org/licenses/LICENSE-2.0
7
- * Unless required by applicable law or agreed to in writing, software
8
- * distributed under the License is distributed on an "AS IS" BASIS,
9
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- * See the License for the specific language governing permissions and
11
- * limitations under the License.
12
- */
13
-
14
- describe("Worker", function() {
15
- beforeEach(function() {
16
- this.ifr = document.createElement("iframe");
17
- document.body.append(this.ifr);
18
- });
19
-
20
- afterEach(function() {
21
- this.ifr.remove();
22
- });
23
-
24
- it("loads transpiled modules", function(done) {
25
- window.addEventListener("message", function l(ev) {
26
- if (ev.data === "a") {
27
- window.removeEventListener("message", l);
28
- done();
29
- }
30
- });
31
- this.ifr.src = "/base/tests/fixtures/worker/build/runner.html";
32
- });
33
- });
1
+ /**
2
+ * Copyright 2018 Google Inc. All Rights Reserved.
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS,
9
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ * See the License for the specific language governing permissions and
11
+ * limitations under the License.
12
+ */
13
+
14
+ describe("Worker", function() {
15
+ beforeEach(function() {
16
+ this.ifr = document.createElement("iframe");
17
+ document.body.append(this.ifr);
18
+ });
19
+
20
+ afterEach(function() {
21
+ this.ifr.remove();
22
+ });
23
+
24
+ it("loads transpiled modules", function(done) {
25
+ window.addEventListener("message", function l(ev) {
26
+ if (ev.data === "a") {
27
+ window.removeEventListener("message", l);
28
+ done();
29
+ }
30
+ });
31
+ this.ifr.src = "/base/tests/fixtures/worker/build/runner.html";
32
+ });
33
+ });
@@ -1,32 +0,0 @@
1
- name: Release
2
-
3
- on:
4
- workflow_dispatch:
5
- release:
6
- types:
7
- - published
8
-
9
- jobs:
10
- publish:
11
- runs-on: ubuntu-latest
12
- steps:
13
- - uses: actions/checkout@v4
14
- - uses: actions/setup-node@v4
15
- with:
16
- node-version: 20
17
- - run: npm ci
18
- # - run: npm run build
19
- #- run: npm version prerelease --no-git-tag-version --preid ${{ github.ref_name }}-${{ github.sha }} (using self-versioned package.json from now on)
20
- #### PUBLISH TO NPM ####
21
- - uses: JS-DevTools/npm-publish@v3
22
- with:
23
- token: ${{ secrets.NPM_TOKEN }}
24
- access: public
25
- tag: latest
26
- #### PUBLISH TO GITHUB NPM ####
27
- - uses: JS-DevTools/npm-publish@v3
28
- with:
29
- token: ${{ secrets.GITHUB_TOKEN }}
30
- registry: https://npm.pkg.github.com
31
- access: public
32
- tag: beta
package/CODEOWNERS DELETED
@@ -1 +0,0 @@
1
- * @surma
package/Dockerfile DELETED
@@ -1,20 +0,0 @@
1
- FROM selenium/node-chrome:latest
2
-
3
- USER root
4
-
5
- RUN apt-get update -qqy \
6
- && rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
7
- && rm /bin/sh && ln -s /bin/bash /bin/sh \
8
- && chown seluser /usr/local
9
-
10
- ENV NVM_DIR /usr/local/nvm
11
- RUN mkdir -p $NVM_DIR \
12
- && wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.35.2/install.sh | bash \
13
- && source $NVM_DIR/nvm.sh \
14
- && nvm install v12
15
-
16
- ENV CHROME_BIN /opt/google/chrome/chrome
17
- ENV INSIDE_DOCKER=1
18
-
19
- WORKDIR /usr/src
20
- ENTRYPOINT source $NVM_DIR/nvm.sh && npm i && npm test
package/renovate.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "extends": ["config:base"]
3
- }