profile
viewpoint

GoogleChromeLabs/squoosh 9461

Make images smaller using best-in-class codecs, right in the browser.

GoogleChromeLabs/proxx 978

A game of proximity

GoogleChrome/devsummit 700

Chrome Dev Summit Conference Site

dominiccooney/cache-polyfill 455

Service Worker Cache polyfill extracted from https://jakearchibald.github.io/trained-to-thrill/

GoogleChromeLabs/file-drop 156

A simple file drag and drop custom-element

issue commentjakearchibald/idb

Edge crashes

You might need to transpile if the browser doesn't support spread. The latest version of Edge definitely supports it.

DavidSichau

comment created time in 12 hours

issue commentWICG/compression

Readable byte stream

as well as the backlog of higher-priority work

hah, yeah, I know what you mean.

jakearchibald

comment created time in 2 days

pull request commentWICG/compression

Simplify example. Fixes #29.

Thanks for looking into the performance characteristics! I learned a lot.

jakearchibald

comment created time in 2 days

delete branch jakearchibald/compression

delete branch : patch-2

delete time in 2 days

issue commentwhatwg/streams

ReadableStream.prototype.arrayBuffer()

How about:

  • array() - Array of chunks
  • blob(BlobPropertyBag) - Blob. Rejects and cancels stream if any chunks are not BlobPart.
  • arrayBuffer({ into }) - Rejects and cancels stream if any chunks are not buffer sources, or if into is provided and isn't big enough to hold the data. Resolves with an arraybuffer, which will be a slice of into if it's provided.

Maybe we can look at text() later, but (await stream.array()).join('') doesn't seem too bad.

ricea

comment created time in 2 days

issue commentwhatwg/streams

ReadableStream.from(X)

Actually, thinking about it more:

ReadableStream.from(uint8Array);

Seems a bit odd that this creates a stream of numbers. Maybe we should special-case buffer source types, which would create a readable byte stream. Or have an opt-in like @MattiasBuelens suggests.

ReadableStream.from(uint8Array, { type: 'bytes' });

Or, since the option impacts both the accepted input and produced output:

ReadableStream.fromBytes(uint8Array);
ricea

comment created time in 2 days

issue commentwhatwg/streams

ReadableStream.from(X)

Fwiw, I agree with @domenic. Allow 1 & 2, throw otherwise.

ricea

comment created time in 2 days

issue openedWICG/compression

Readable byte stream

Looking at the spec, it seems like these transforms create regular readable streams. Should they be readable byte streams?

created time in 2 days

pull request commentWICG/compression

Simplify example. Fixes #29.

Interesting! I've changed the PR to use Response rather than Blob.

jakearchibald

comment created time in 2 days

push eventjakearchibald/compression

Jake Archibald

commit sha b005ebf1ca3dc3db7c528d682d525cf907f00aa5

Use response rather than blob

view details

push time in 2 days

pull request commentWICG/compression

Simplify example. Fixes #29.

Makes me wonder if https://github.com/wicg/compression/blob/master/explainer.md#gzip-decompress-a-blob-to-a-blob is similarly slow, and makes even more of a case for the high-level methods.

jakearchibald

comment created time in 2 days

pull request commentWICG/compression

Simplify example. Fixes #29.

Whoa, any idea where the overhead comes from? The conversion to blob, or to response?

jakearchibald

comment created time in 2 days

push eventjakearchibald/sketch-chain

Jake Archibald

commit sha 802baae9455bf58b5153155a89cc0c8a4259ef7a

Adding basic confirms to destructive actions

view details

Jake Archibald

commit sha 23edb7e9a46a580f1a97f5f94a9cdf2c0014e3ac

Better start game button

view details

push time in 2 days

push eventjakearchibald/compression

Jake Archibald

commit sha 3bdea6ad7df0db9212d134ee64bbf3ac5eb0e916

Update explainer.md

view details

push time in 2 days

Pull request review commentWICG/compression

Simplify example. Fixes #29.

 there are a number of benefits to a built-in capability: const compressedReadableStream = inputReadableStream.pipeThrough(new CompressionStream('gzip')); ``` -### Deflate-compress an ArrayBuffer to a Uint8Array+### Deflate-compress an ArrayBuffer  ```javascript-async function compressArrayBuffer(input) {-  const cs = new CompressionStream('deflate');-  const writer = cs.writable.getWriter();-  writer.write(input);-  writer.close();-  const output = [];-  const reader = cs.readable.getReader();-  let totalSize = 0;-  while (true) {-    const { value, done } = await reader.read();-    if (done)-      break;-    output.push(value);-    totalSize += value.byteLength;-  }-  const concatenated = new Uint8Array(totalSize);-  let offset = 0;-  for (const array of output) {-    concatenated.set(array, offset);-    offset += array.byteLength;-  }-  return concatenated;+function compressArrayBuffer(input) {+  const stream = new Blob(input)
  const stream = new Blob([input])
jakearchibald

comment created time in 2 days

pull request commentWICG/compression

Simplify example. Fixes #29.

If the performance is very different, maybe we need some higher level APIs:

function compressArrayBuffer(input) {
  return ReadableStream.from(input)
    .pipeThrough(new CompressionStream('deflate'))
    .arrayBuffer();
}
jakearchibald

comment created time in 3 days

issue commentWICG/compression

Compress arraybuffer example

PR https://github.com/WICG/compression/pull/30

jakearchibald

comment created time in 3 days

PR opened WICG/compression

Simplify example. Fixes #29.
+6 -23

0 comment

1 changed file

pr created time in 3 days

push eventjakearchibald/compression

Jake Archibald

commit sha c00779891f3dca57aa108c6d840a58d4484c73bb

Simplify example. Fixes #29.

view details

push time in 3 days

push eventjakearchibald/compression

Jake Archibald

commit sha 2ab759bf8e534c9c7a102ca21e60a8293918d27e

Simplfy example. Fixes #29.

view details

push time in 3 days

fork jakearchibald/compression

Standard text for CompressionStream and DecompressionStream API

fork in 3 days

issue openedWICG/compression

Compress arraybuffer example

https://github.com/wicg/compression/blob/master/explainer.md#deflate-compress-an-arraybuffer-to-a-uint8array

It could be:

function compressArrayBuffer(input) {
  const stream = new Blob(input)
    .stream()
    .pipeThrough(new CompressionStream('deflate'));
  return new Response(stream).arrayBuffer();
}

I guess it's a little hacky, but the following example already uses blob/response, so maybe it's ok?

created time in 3 days

push eventjakearchibald/sketch-chain

Jake Archibald

commit sha 972272fffc9913f373f12548ac9626d9bbf3c1c0

Redirect to https

view details

push time in 4 days

push eventjakearchibald/sketch-chain

Jake Archibald

commit sha 99614b572a79c79a4d6deced3f47125ab01529b7

Better layout in end screen

view details

push time in 4 days

push eventjakearchibald/sketch-chain

Jake Archibald

commit sha ba020376e3c4e9de4356d71358478f9826ab7373

Fix (probably) all the iOS issues.

view details

Jake Archibald

commit sha 0039ad5e686657521a97e6627fabee23740bfe5e

DB download

view details

push time in 4 days

pull request commentGoogleChromeLabs/two-up

Add demo

Perfect

developit

comment created time in 6 days

delete branch GoogleChromeLabs/two-up

delete branch : add-demo

delete time in 6 days

push eventGoogleChromeLabs/two-up

Jason Miller

commit sha 56d1542d86fcb5b1a13c4247ce8b5ad99835d37e

Add demo

view details

Jake Archibald

commit sha c5be728848958e816ca22e58d9b1f391c75a165d

Merge pull request #3 from GoogleChromeLabs/add-demo Add demo

view details

push time in 6 days

PR merged GoogleChromeLabs/two-up

Reviewers
Add demo

https://codepen.io/developit/pen/qBdbNLK

+1 -1

0 comment

1 changed file

developit

pr closed time in 6 days

push eventjakearchibald/sketch-chain

Jake Archibald

commit sha 1dad28f11d303e10711de88526cfe64f53af2323

Fixes for Glitch

view details

push time in 6 days

push eventjakearchibald/sketch-chain

Jake Archibald

commit sha 3d275f8823a1af60d8cbc2f4b70c99f200c664a9

Bugfix: Removing last player now ends game

view details

Jake Archibald

commit sha cb9cb9318a1ee06cbe8b59f5da4efd03a39772be

iOS touch fixes

view details

push time in 6 days

push eventjakearchibald/sketch-chain

Jake Archibald

commit sha fb89f55e278cd50c8ce72529a3009031b9b32602

i am dumb

view details

push time in 7 days

push eventjakearchibald/sketch-chain

Jake Archibald

commit sha 00d932251b8b371feecebac9a8a9835e0a398b1a

Update node resolve

view details

push time in 7 days

push eventjakearchibald/sketch-chain

Jake Archibald

commit sha 17ba351195dde9a7af8067556eea8cd54fd5f221

Preserve symlinks for pnpm

view details

push time in 7 days

push eventjakearchibald/sketch-chain

Jake Archibald

commit sha 976201761164ba587095e57d0ade3cde0d26d87c

Fixing game state

view details

Jake Archibald

commit sha 493460d8fdc4cb3b986dc970292b48ef9dbd21b1

Fixing fullscreen and timing issues

view details

Jake Archibald

commit sha ea31eddf2ae1b359656593dc10b6c39366aca798

Crop drawing

view details

Jake Archibald

commit sha 707b000ec20fee6f9683446e57d1ff94e792674f

Better layout of images

view details

push time in 7 days

push eventjakearchibald/sketch-chain

Jake Archibald

commit sha b3f832d5719781bf20397e9ce6119b290188a2a4

Better image data

view details

push time in 8 days

Pull request review commentannevk/orb

Take 2 of the algorithm

-# orb-Opaque Response Blocking (CORB++)+# Opaque Response Blocking (ORB, aka CORB++)++## Objective++To block as many opaque responses as possible while remaining web compatible.++## High-level idea++CSS, JavaScript, and media (audio, images, video) can be requested across origins without CORS. Except for CSS there is no MIME type enforcement. Ideally we still block as many responses as possible that are not one of these types to avoid leaking their contents through side channels.++## Processing model++A user agent has a **opaque-safelisted requesters set**. (This should be scoped similar to other network caches.)++A request has an associated **opaque media identifier** (null or an opaque identifier). Null unless explicitly stated otherwise.++\[The idea here is that the opaque media identifier is owned by the media element (audio/video only; I'm assuming we won't do range for images without at least requiring MIME types at this point). As part of the element being GC'd, it would send a message to get all the relevant entries from the user agent's opaque-safelisted requesters set removed. There might be better strategies available here and it's not clear to me to what extent we need to specify this, but it's probably good to have a model that does not leak memory forever so the set needs to be keyed to something. The fetch group might also be reasonable.]
\[The idea here is that the opaque media identifier is owned by the media element (audio/video only; I'm assuming we won't do range requests for images without at least requiring MIME types at this point). As part of the element being GC'd, it would send a message to get all the relevant entries from the user agent's opaque-safelisted requesters set removed. There might be better strategies available here and it's not clear to me to what extent we need to specify this, but it's probably good to have a model that does not leak memory forever so the set needs to be keyed to something. The fetch group might also be reasonable.]

In terms of the leaking, could it use some sort of unique object rather than an ID? Then you could use weakmap-like semantics.

annevk

comment created time in 9 days

PR closed GoogleChromeLabs/proxx

Test SW build (Attempt #1)

I've tried to build the service worker ONLY. It kinda works, but if I remove the first two lines of the src/sw/index.ts file (those imports), and I replace them with constants, tsc -b gives me compilation errors 🤔

I'd expect this to work.

In order to test it, clone this branch, comment the line 1 and 2 in the src/sw/index.ts file and de-comment the line 6 and 7 in the same file. The result should be this:

// import version from "consts:version";
// import resourceList from "resource-list:";
// Give TypeScript the correct global.
declare var self: ServiceWorkerGlobalScope;

const version = 2;
const resourceList: Array<string> = [];

Then, you can try to compile by running tsc -b in src/sw/

+35 -33

2 comments

3 changed files

NicholasPeretti

pr closed time in 9 days

pull request commentGoogleChromeLabs/proxx

Test SW build (Attempt #1)

Closing, since this isn't a pull request.

NicholasPeretti

comment created time in 9 days

PublicEvent

push eventjakearchibald/sketch-chain

Jake Archibald

commit sha c1bde5d766e6c9d67d4f40607c695e9b04411518

Allow more line width

view details

push time in 13 days

PR closed jakearchibald/idb

Reviewers
Correcting the terminated event name

It is onclose not close 😅

+1 -1

2 comments

1 changed file

sidati

pr closed time in 13 days

pull request commentjakearchibald/idb

Correcting the terminated event name

Closing this. Please reopen if I'm wrong.

sidati

comment created time in 13 days

push eventGoogleChromeLabs/big-web-quiz

Jake Archibald

commit sha 5ffcd671303752bd4528cfbb796fb3358865f4c9

Check state of socket before sending data

view details

Jake Archibald

commit sha f9618ae0f23543a4be8251767d0cbccf37e785e6

Remove TODO from readme

view details

push time in 15 days

issue closedw3c/ServiceWorker

Service worker spec meetup

At TPAC we suggested meeting up again between TPACs. Let's try to figure out a date.

BlinkOn is in London on April 7-8, so I figured some folks would already be in town. Are there dates around there that work?

https://doodle.com/poll/8dugy78e577rbdk8 - let me know.

If we can't make it work, I'll find some more dates. Also, let me know if there's anything I should consider when looking at the next set of dates.

cc @jungkees @aliams @slightlyoff @wanderview @mattto @asakusuma @n8schloss @annevk @asutherland @youennf @cdumez (please tag anyone I've forgotten)

closed time in 15 days

jakearchibald

issue commentw3c/ServiceWorker

Service worker spec meetup

It doesn't seem like enough folks can make it around BlinkOn. I'll try to find some other dates later in the year, probably June. I'll open a new issue for that.

jakearchibald

comment created time in 15 days

push eventjakearchibald/compressstream-explainer

Jake Archibald

commit sha 156e866133e2e85644bef4cc2e302cec8d2392cb

Avoid JS keyword in example

view details

push time in 16 days

pull request commentmourner/simplify-js

Add TypeScript defintion

Whoa, thanks for the quick response! And thanks for the library.

dhritzkiv

comment created time in 16 days

pull request commentmourner/simplify-js

Add TypeScript defintion

Can this be published to npm?

dhritzkiv

comment created time in 16 days

pull request commentjakearchibald/idb

Correcting the terminated event name

I don't think so https://w3c.github.io/IndexedDB/#closing-connection. Can you explain what you mean, or give an example where this PR works but the current version of the library doesn't?

sidati

comment created time in 17 days

PullRequestEvent

PR closed jakearchibald/idb

Reviewers
Correcting the terminated event name

It is onclose not close 😅

+1 -1

1 comment

1 changed file

sidati

pr closed time in 17 days

pull request commentjakearchibald/idb

Correcting the terminated event name

I don't think so. The spec says the event is close https://en.m.wikipedia.org/wiki/Cross-site_request_forgery

sidati

comment created time in 17 days

issue commentWICG/portals

Portals should load and retain state even when they're not in the document

You could observe whether it had run, which is itself an antipattern,

Sure, but it's how the bfcache works.

jakearchibald

comment created time in 20 days

issue closedjakearchibald/idb

Idb does not work on iOS browsers

When idb is used in iOS browsers, the following error is thrown:

undefined is not an object (evaluating 'request')

I created the following pen to demonstrate this error. Just run in any iOS browser:

https://codepen.io/webstermath/pen/LYEoRzX?editors=0012

closed time in 21 days

webstermath

issue commentjakearchibald/idb

Idb does not work on iOS browsers

Unfortunately Safari now disables browser storage when your page is within an iframe. You need to call their non-standard API to enable it https://webkit.org/blog/8124/introducing-storage-access-api/.

By the way, you're using a pretty old version of the library.

webstermath

comment created time in 21 days

issue commentWICG/portals

Portals should load and retain state even when they're not in the document

I mean we wouldn't discard it while it was still in reference, but we can discard it on GC. At that point you aren't exposing GC, because there aren't any events to fire.

I think the one-more-task solution is good enough though.

jakearchibald

comment created time in 21 days

issue commentjakearchibald/idb

Not able to get it working with Angular 5

This isn't a problem with Vue and React. It's a problem with Angular because it wants to control the building of the project too.

Sankey28

comment created time in 21 days

issue commentw3c/ServiceWorker

navigate() behavior in browsers for file:/// and mixed content does not match spec

I think we should reject if the URL cannot be parsed, but otherwise we just resolve with undefined if the navigation ends in a network error. Iframes don't 'error' in these situations, so we shouldn't either.

I propose:

  • Remove step 2 of https://w3c.github.io/ServiceWorker/#client-navigate which prevents about:blank as a value.
  • Change about:blank test so it's expected to resolve with undefined rather than reject.
  • Update tests so navigate only throws if the client's service worker isn't this service worker, if the url is invalid, or document has been discarded.

@wanderview @asutherland @jungkees @matto @youennf any objections?

bzbarsky

comment created time in 21 days

issue openedw3c/ServiceWorker

Service worker spec meetup

At TPAC we suggested meeting up again between TPACs. Let's try to figure out a date.

BlinkOn is in London on April 7-8, so I figured some folks would already be in town. Are there dates around there that work?

https://doodle.com/poll/8dugy78e577rbdk8 - let me know.

If we can't make it work, I'll find some more dates. Also, let me know if there's anything I should consider when looking at the next set of dates.

cc @jungkees @aliams @slightlyoff @wanderview @mattto @asakusuma @n8schloss @annevk @asutherland @youennf @cdumez (please tag anyone I've forgotten)

created time in 22 days

issue commentjakearchibald/idb

module error in VS Code

Fwiw, I'm pretty sure these error are down to:

  • Using an old version of TypeScript/Angular.
  • Missing "esnext" in the libs section of tsconfig.json.
smout74

comment created time in 22 days

issue closedjakearchibald/idb

Not able to get it working with Angular 5

I am getting below errors while serving the application.

ERROR in node_modules/idb/with-async-ittr.d.ts(1,15): error TS2691: An import path cannot end with a '.d.ts' extension. Consider importing './build/esm/index' instead. src/app/shared/services/data.service.ts(10,10): error TS2305: Module '"D:/DEV/HSE/ARA.WebApp/node_modules/idb/with-async-ittr"' has no exported member 'openDB'.

closed time in 22 days

Sankey28

issue commentjakearchibald/idb

Not able to get it working with Angular 5

I got this working by updating ts-node and typescript to their latest versions, then changing "es2017" in tsconfig.json to "esnext".

Although, it now shows this warning: "@angular/compiler-cli@5.2.11 requires typescript@'>=2.4.2 <2.7.0' but 3.7.5 was found instead. Using this version can result in undefined behaviour and difficult to debug problems."

Unfortunately, it just seems like this project is using a too-old version of angular.

Sankey28

comment created time in 22 days

issue commentjakearchibald/idb

Not able to get it working with Angular 5

Yep, I'm running npm install.

<details><summary>Full log</summary>

~/dev/tmp/angular5-idb master
❯ npm install
npm WARN @rollup/plugin-commonjs@11.0.1 requires a peer of rollup@^1.20.0 but none is installed. You must install peer dependencies yourself.
npm WARN @rollup/pluginutils@3.0.6 requires a peer of rollup@^1.20.0 but none is installed. You must install peer dependencies yourself.

audited 14200 packages in 6.653s

20 packages are looking for funding.
Run "npm fund" to find out more.

~/dev/tmp/angular5-idb master 8s
❯ npm run start

> my-angular-project@0.0.0 start /Users/jakearchibald/dev/tmp/angular5-idb
> ng serve

Cannot read property 'config' of null
TypeError: Cannot read property 'config' of null
    at Class.run (/Users/jakearchibald/dev/tmp/angular5-idb/node_modules/@angular/cli/tasks/serve.js:51:63)
    at /Users/jakearchibald/dev/tmp/angular5-idb/node_modules/@angular/cli/commands/serve.js:123:26
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-angular-project@0.0.0 start: `ng serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-angular-project@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jakearchibald/.npm/_logs/2020-01-29T13_11_51_548Z-debug.log

</details>

Sankey28

comment created time in 22 days

pull request commentjakearchibald/idb

Reduce NPM package size

I've published this change as 5.0.1, along with another change that avoids publishing the test build. Thanks

alexeyraspopov

comment created time in 22 days

push eventjakearchibald/idb

Jake Archibald

commit sha a71996b4b319e25ca411042d21be359b60acf851

5.0.1

view details

push time in 22 days

push eventjakearchibald/idb

Jake Archibald

commit sha b76a905eed1947232131681cb406d0a32ac217c6

Avoid publishing test build

view details

push time in 22 days

push eventjakearchibald/idb

Alexey Raspopov

commit sha 31a16fb02e62d1a05ec8a83c3897c10226256477

Reduce NPM package size (#155) * move @rollup/plugin-commonjs to devDependencies * define a list of allowed files in npm package

view details

push time in 22 days

PR merged jakearchibald/idb

Reduce NPM package size

This pull request includes several small tweaks to package.json that reduces NPM package size and its installation time.

Moved @rollup/plugin-commonjs to devDependencies after I found a lot of warnings like

warning "idb > @rollup/plugin-commonjs@11.0.1" has unmet peer dependency "rollup@^1.20.0".
warning "idb > @rollup/plugin-commonjs > @rollup/pluginutils@3.0.6" has unmet peer dependency "rollup@^1.20.0".

Defined a list of allowed files using package.json#files so that no unnecessary files are being installed. Below you can see the difference

<details> <summary>Before (72 files, 298.4 kB)</summary>

~/workspace/idb λ npm publish --dry-run
npm notice
npm notice 📦  idb@5.0.0
npm notice === Tarball Contents ===
npm notice 776B   LICENSE
npm notice 154B   test/index.html
npm notice 2.1kB  build/cjs/async-iterators.js
npm notice 2.1kB  build/esm/async-iterators.js
npm notice 3.1kB  build/iife/index-min.js
npm notice 3.0kB  build/cjs/index.js
npm notice 2.9kB  build/esm/index.js
npm notice 1.9kB  rollup.config.js
npm notice 3.6kB  lib/simple-ts.js
npm notice 93B    with-async-ittr-cjs.js
npm notice 3.7kB  build/iife/with-async-ittr-min.js
npm notice 79B    with-async-ittr.js
npm notice 7.6kB  build/cjs/wrap-idb-value.js
npm notice 7.5kB  build/esm/wrap-idb-value.js
npm notice 52B    .prettierrc.json
npm notice 373B   generic-tsconfig.json
npm notice 926B   package.json
npm notice 101B   src/tsconfig.json
npm notice 170B   test/tsconfig.json
npm notice 329B   tsconfig.json
npm notice 127B   build/cjs/async-iterators.d.ts.map
npm notice 127B   build/esm/async-iterators.d.ts.map
npm notice 2.2kB  build/cjs/async-iterators.js.map
npm notice 2.2kB  build/esm/async-iterators.js.map
npm notice 127B   build/cjs/database-extras.d.ts.map
npm notice 127B   build/esm/database-extras.d.ts.map
npm notice 1.9kB  build/cjs/database-extras.js.map
npm notice 1.9kB  build/esm/database-extras.js.map
npm notice 17.2kB build/cjs/entry.d.ts.map
npm notice 17.2kB build/esm/entry.d.ts.map
npm notice 1.3kB  build/cjs/entry.js.map
npm notice 1.3kB  build/esm/entry.js.map
npm notice 149B   build/cjs/index.d.ts.map
npm notice 149B   build/esm/index.d.ts.map
npm notice 147B   build/cjs/index.js.map
npm notice 147B   build/esm/index.js.map
npm notice 270B   build/cjs/util.d.ts.map
npm notice 270B   build/esm/util.d.ts.map
npm notice 235B   build/cjs/util.js.map
npm notice 235B   build/esm/util.js.map
npm notice 1.5kB  build/cjs/wrap-idb-value.d.ts.map
npm notice 1.5kB  build/esm/wrap-idb-value.d.ts.map
npm notice 5.4kB  build/cjs/wrap-idb-value.js.map
npm notice 5.4kB  build/esm/wrap-idb-value.js.map
npm notice 2.7kB  changes.md
npm notice 14.4kB README.md
npm notice 1.2kB  lib/size-report.mjs
npm notice 56B    build/cjs/async-iterators.d.ts
npm notice 56B    build/esm/async-iterators.d.ts
npm notice 2.5kB  src/async-iterators.ts
npm notice 56B    build/cjs/database-extras.d.ts
npm notice 56B    build/esm/database-extras.d.ts
npm notice 1.8kB  src/database-extras.ts
npm notice 29.4kB build/cjs/entry.d.ts
npm notice 29.4kB build/esm/entry.d.ts
npm notice 30.3kB src/entry.ts
npm notice 88B    build/cjs/index.d.ts
npm notice 88B    build/esm/index.d.ts
npm notice 53B    src/index.ts
npm notice 874B   test/index.ts
npm notice 8.6kB  test/iterate.ts
npm notice 55.3kB test/main.ts
npm notice 5.2kB  test/open.ts
npm notice 240B   build/cjs/util.d.ts
npm notice 240B   build/esm/util.d.ts
npm notice 236B   src/util.ts
npm notice 2.1kB  test/utils.ts
npm notice 40B    with-async-ittr-cjs.d.ts
npm notice 40B    with-async-ittr.d.ts
npm notice 1.6kB  build/cjs/wrap-idb-value.d.ts
npm notice 1.6kB  build/esm/wrap-idb-value.d.ts
npm notice 8.8kB  src/wrap-idb-value.ts
npm notice === Tarball Details ===
npm notice name:          idb
npm notice version:       5.0.0
npm notice package size:  40.3 kB
npm notice unpacked size: 298.4 kB
npm notice shasum:        0f43f4b797fde4d5731135fa14a558763be5d693
npm notice integrity:     sha512-Vfd/1rI8Qb5T2[...]lHpnXB6YCV18w==
npm notice total files:   72
npm notice
+ idb@5.0.0

</details>

<details> <summary>After (52 files, 174.9 kB)</summary>

~/workspace/idb λ npm publish --dry-run
npm notice
npm notice 📦  idb@5.0.0
npm notice === Tarball Contents ===
npm notice 776B   LICENSE
npm notice 2.1kB  build/cjs/async-iterators.js
npm notice 2.1kB  build/esm/async-iterators.js
npm notice 3.1kB  build/iife/index-min.js
npm notice 3.0kB  build/cjs/index.js
npm notice 2.9kB  build/esm/index.js
npm notice 93B    with-async-ittr-cjs.js
npm notice 3.7kB  build/iife/with-async-ittr-min.js
npm notice 79B    with-async-ittr.js
npm notice 7.6kB  build/cjs/wrap-idb-value.js
npm notice 7.5kB  build/esm/wrap-idb-value.js
npm notice 973B   package.json
npm notice 127B   build/cjs/async-iterators.d.ts.map
npm notice 127B   build/esm/async-iterators.d.ts.map
npm notice 2.2kB  build/cjs/async-iterators.js.map
npm notice 2.2kB  build/esm/async-iterators.js.map
npm notice 127B   build/cjs/database-extras.d.ts.map
npm notice 127B   build/esm/database-extras.d.ts.map
npm notice 1.9kB  build/cjs/database-extras.js.map
npm notice 1.9kB  build/esm/database-extras.js.map
npm notice 17.2kB build/cjs/entry.d.ts.map
npm notice 17.2kB build/esm/entry.d.ts.map
npm notice 1.3kB  build/cjs/entry.js.map
npm notice 1.3kB  build/esm/entry.js.map
npm notice 149B   build/cjs/index.d.ts.map
npm notice 149B   build/esm/index.d.ts.map
npm notice 147B   build/cjs/index.js.map
npm notice 147B   build/esm/index.js.map
npm notice 270B   build/cjs/util.d.ts.map
npm notice 270B   build/esm/util.d.ts.map
npm notice 235B   build/cjs/util.js.map
npm notice 235B   build/esm/util.js.map
npm notice 1.5kB  build/cjs/wrap-idb-value.d.ts.map
npm notice 1.5kB  build/esm/wrap-idb-value.d.ts.map
npm notice 5.4kB  build/cjs/wrap-idb-value.js.map
npm notice 5.4kB  build/esm/wrap-idb-value.js.map
npm notice 2.7kB  changes.md
npm notice 14.4kB README.md
npm notice 56B    build/cjs/async-iterators.d.ts
npm notice 56B    build/esm/async-iterators.d.ts
npm notice 56B    build/cjs/database-extras.d.ts
npm notice 56B    build/esm/database-extras.d.ts
npm notice 29.4kB build/cjs/entry.d.ts
npm notice 29.4kB build/esm/entry.d.ts
npm notice 88B    build/cjs/index.d.ts
npm notice 88B    build/esm/index.d.ts
npm notice 240B   build/cjs/util.d.ts
npm notice 240B   build/esm/util.d.ts
npm notice 40B    with-async-ittr-cjs.d.ts
npm notice 40B    with-async-ittr.d.ts
npm notice 1.6kB  build/cjs/wrap-idb-value.d.ts
npm notice 1.6kB  build/esm/wrap-idb-value.d.ts
npm notice === Tarball Details ===
npm notice name:          idb
npm notice version:       5.0.0
npm notice package size:  23.4 kB
npm notice unpacked size: 174.9 kB
npm notice shasum:        0a8f716626164f7cdb319404ceb12aa6993d02a7
npm notice integrity:     sha512-vymvDIoMJAni3[...]UF/uNaqg+iuAg==
npm notice total files:   52
npm notice
+ idb@5.0.0

</details>

+5 -3

0 comment

1 changed file

alexeyraspopov

pr closed time in 22 days

issue commentjakearchibald/idb

Not able to get it working with Angular 5

@Sankey28

Here's the result of npm run start:

> my-angular-project@0.0.0 start /Users/jakearchibald/dev/tmp/angular5-idb
> ng serve

Cannot read property 'config' of null
TypeError: Cannot read property 'config' of null
    at Class.run (/Users/jakearchibald/dev/tmp/angular5-idb/node_modules/@angular/cli/tasks/serve.js:51:63)
    at /Users/jakearchibald/dev/tmp/angular5-idb/node_modules/@angular/cli/commands/serve.js:123:26
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-angular-project@0.0.0 start: `ng serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-angular-project@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jakearchibald/.npm/_logs/2020-01-29T10_29_48_488Z-debug.log

Here's the result of npm run build:

> my-angular-project@0.0.0 build /Users/jakearchibald/dev/tmp/angular5-idb
> ng build --prod

Unable to find any apps in `.angular-cli.json`.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-angular-project@0.0.0 build: `ng build --prod`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-angular-project@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jakearchibald/.npm/_logs/2020-01-29T10_31_16_742Z-debug.log

Neither of these errors seem to be related to idb. Am I holding it wrong? If so, can you provide accurate steps to recreate the error you're seeing?

Sankey28

comment created time in 22 days

issue commentjakearchibald/idb

Not able to get it working with Angular 5

@Sankey28 did you forget the link to the project?

Sankey28

comment created time in 22 days

issue commentjakearchibald/idb

Not able to get it working with Angular 5

I'm not familiar with Angular. Can you create a minimal reproduction of the issue?

Sankey28

comment created time in 23 days

push eventjakearchibald/google-album-downloader

Jake Archibald

commit sha aa33cf9f699d34fd15d6144c3e1f84108d20862a

As far as I can get without CORS on images

view details

push time in 23 days

issue commentWICG/native-file-system

TypeScript types

Yeah, you could alias types like that. I didn't do that above since TypeScript doesn't do it for web APIs, and it wouldn't prevent you providing floats.

jakearchibald

comment created time in 24 days

issue openedWICG/native-file-system

TypeScript types

Here are TypeScript types for the current spec (aside from the system directory stuff). Feel free to close if this isn't useful, but it might save someone else time if they're looking for it.

type ChooseFileSystemEntriesType = 'open-file' | 'save-file' | 'open-directory';

interface ChooseFileSystemEntriesOptionsAccepts {
  description?: string;
  mimeTypes?: string[];
  extensions?: string[];
}

interface ChooseFileSystemEntriesOptions {
  type?: ChooseFileSystemEntriesType;
  multiple?: boolean;
  accepts?: ChooseFileSystemEntriesOptionsAccepts[];
  excludeAcceptAllOption?: boolean;
}

interface ChooseFileSystemEntriesOptionsMultiple
  extends ChooseFileSystemEntriesOptions {
  multiple: true;
}

interface FileSystemHandlePermissionDescriptor {
  writable?: boolean;
}

interface FileSystemHandle {
  readonly isFile: boolean;
  readonly isDirectory: boolean;
  readonly name: string;

  queryPermission(
    descriptor?: FileSystemHandlePermissionDescriptor,
  ): Promise<PermissionState>;
  requestPermission(
    descriptor?: FileSystemHandlePermissionDescriptor,
  ): Promise<PermissionState>;
}

interface FileSystemCreateWriterOptions {
  keepExistingData?: boolean;
}

interface FileSystemFileHandle extends FileSystemHandle {
  getFile(): File;
  createWriter(
    options?: FileSystemCreateWriterOptions,
  ): Promise<FileSystemWriter>;
}

interface FileSystemGetFileOptions {
  create?: boolean;
}

interface FileSystemGetDirectoryOptions {
  create?: boolean;
}

interface FileSystemRemoveOptions {
  recursive?: boolean;
}

interface FileSystemDirectoryHandle extends FileSystemHandle {
  getFile(
    name: string,
    options?: FileSystemGetFileOptions,
  ): Promise<FileSystemFileHandle>;
  getDirectory(
    name: string,
    options?: FileSystemGetDirectoryOptions,
  ): Promise<FileSystemDirectoryHandle>;
  getEntries(): AsyncIterable<FileSystemDirectoryHandle | FileSystemFileHandle>;
  removeEntry(name: string, options?: FileSystemRemoveOptions): Promise<void>;
}

interface FileSystemWriter {
  write(position: number, data: BufferSource | Blob | string): Promise<void>;
  truncate(size: number): Promise<void>;
  close(): Promise<void>;
}

declare function chooseFileSystemEntries(
  options?: ChooseFileSystemEntriesOptionsMultiple,
): Promise<Array<FileSystemDirectoryHandle | FileSystemFileHandle>>;
declare function chooseFileSystemEntries(
  options?: ChooseFileSystemEntriesOptions,
): Promise<Array<FileSystemDirectoryHandle | FileSystemFileHandle>>;

created time in 24 days

issue commentw3c/ServiceWorker

Size limits with synchronous WebAssembly functions

If > 4k is bad for the main thread, it's probably bad for service worker startup & a fetch event too. I'm leaning towards adding the same restrictions on these APIs.

Pauan

comment created time in 24 days

issue commentw3c/ServiceWorker

Top-level await integration for ServiceWorkers running modules

The intent here is to prevent footguns. We aren't blocking while (true), but we are blocking await since its performance impact isn't always clear at dev time.

they have a 4 KB limit on the main thread. So will they also have a 4 KB limit in service workers, or is that limit removed?

That's definitely worth discussing! Could you file an issue?

littledan

comment created time in 24 days

issue commentw3c/ServiceWorker

Top-level await integration for ServiceWorkers running modules

XMLHttpRequest is already unavailable in a service worker.

There are no plans to remove those web assembly modules. If you think things should change here, can you explain why?

littledan

comment created time in 24 days

issue commentWICG/portals

Default click behaviour of portals

This forces all portal usage that wants to do animation to call preventDefault(). I don't think we should design an api where the failure case makes the normal case more difficult.

The difficulty here is one line that developers are pretty used to writing with links and forms. As burdens go, it doesn't seem like much. On the other hand we see a lot of sites failing because their JS failed, and a thing that should have been a link was a button.

If you want to prioritize failure cases you can use inline javascript: <portal onclick="this.activate()"> ...

CSP would prevent that from working.

jakearchibald

comment created time in a month

issue commentWICG/portals

Portals should load and retain state even when they're not in the document

There's a third option: A detached portal could be treated like a bf cache page entry. As in, it goes through the whole unload, pageHide stuff. At this point, it can be discarded whenever. Once it's reattached, it will either pageShow or reload if it was discarded.

But, if we don't care too much about the third use-case, extending lifetime by a task would solve the first two use-cases.

jakearchibald

comment created time in a month

issue openedWICG/portals

Leaning on bfcache and history traversal

Portal activation and how I imagine the back button might work seems to have a lot in common with bfcache. I wonder if we can lean on it and avoid spec'ing a whole new kind of navigation.

Activating a portal

Instead of step 4 of 'activate a portal browsing context', call update the session history with the new page, with the following changes according to a "isPortalActivation" flag:

  • Step 1: Unsure whether we should unload at this point (see below).
  • Step 2: "If the navigation was initiated with a URL that equals the browsing context's active document's URL" needs an additional "and isPortalActivation is false" clause. This is handling fragment changes, which don't apply here.
  • Step 4: "Try to scroll to the fragment for the Document." - The linked steps seem really hand-wavey, so it's probably fine to do this. For example, if the activating portal is changing viewport size as part of activation, we might want to correct scrolling.

The HTML steps here talk about a "new entry" which is really hand-waved. For portals, we should create an entry that has a fromPortal flag, which would be a new field of a session history entry.

The above steps involve traversing the history, but I don't see anything that would need to change.

Unloading

It feels like we have two options: perform the closing steps before switching the documents, or do it afterwards. In terms of closing before switching documents:

Pros:

  • beforeload can present UI.
  • Follows the behaviour of bf cache, so… consistency??

Cons:

  • We'd probably have to respect a document's salvageability, meaning the activated portal would not be able to adopt the previous page if had beforeunload or unload listeners.

Now I've written it down, it feels better to continue to do what the spec is currently doing, and only run the close steps once the adopted portal is closed.

Traversing history

This would automatically use traverse the history by a delta:

  • After steps 5: Let allowAdoption be true if the specified entry holds a Document, and one of the following is true:
    • Delta is 1, and the specified entry's fromPortal flag is set.
    • Delta is -1, and or -1, and the joint session history's fromPortal flag is set.
  • Step 6.2.2: The substeps will not run if allowAdoption is true.
  • After step 6.3: If allowAdoption is true, fire some kind of event that allows the new page to adopt the previous one (if the page isn't adopted, it should be closed).

Traversals that aren't 1 or -1 should just work, as the session entry's document would be promoted as if it were a bf cached page.

I haven't thought much about the event names yet.

created time in a month

issue commentWICG/portals

Default click behaviour of portals

but I would expect that in the majority of cases you do want an animation because suddenly cutting to another web page seems jarring to me

Sure, but cutting to another page (which is how pretty much all navigations happen on the web today) seems better than 'nothing happens', and that's the choice in the failure case.

You also need to run script if you want to handle the activation result (reasonably likely)

Which page is running this script, and what is it likely to do? Surely in an error-throwing/no-listener case, this isn't going to happen anyway.

modify/remove the portal element after activation completes

What would break if it isn't removed? In terms of breakage we need to compare to 'nothing happens'.

jakearchibald

comment created time in a month

issue commentWICG/portals

Default click behaviour of portals

Right, exactly, the question is are developers going to be adding animations most of the time or are they just going to call activate()? If the former then "does nothing" is the way to go.

I don't think so. Consider this:

  1. User clicks portal.
  2. Developer's click listener fires.
  3. Developer looks at the state of the portal.
  4. Developer calls preventDefault.
  5. Developer transitions that portal in a particular way, depending on that state, and waits for the transition to complete.
  6. Developer calls activate().
  7. Portal activates.

If step 2 fails due to a lack of listener (JS fails to load, or an error is thrown before the listener is attacked), or an error is thrown in step 3, what would be a better result: Nothing happens, or portal activates.

Given that "Portal activates" is the eventual goal, I'd say that was the better fallback behaviour.

The cases we need to think about is the ones where the pattern isn't: Portal clicked . . . . . . . portal activates.

jakearchibald

comment created time in a month

issue commentw3c/csswg-drafts

[css-fonts-4] font-display: optional without relayout

+1. Also, it'd be nice if the solution also prevented layout instability when loading an inlined base64-encoded font.

jakearchibald

comment created time in a month

issue commentWICG/portals

Default click behaviour of portals

Hmm would preventDefault() work if the site's javascript throws an error/fails to load (going back to the inital premise here)?

Only if it's called before the JS throws.

Also I think if portals exist to enable seamless navigation (which differentiates them from links), we should have defaults that encourage authors to think about the transition, and not give a default behaviour that is abrupt.

A link, or a button in a form, has a default action. Sometimes the default action isn't the best action, but the developer can prevent the default and do something different. But in both cases, the default is usually better than nothing happening.

I guess this comes down to how often "clicking leads to activation" is absolutely not what the developer would want. If it's often, then click-to-activate is a bad default and click-does-nothing is better.

jakearchibald

comment created time in a month

issue commentWICG/portals

Default click behaviour of portals

Right, but preventDefault() can be used to stop the default behaviour (just like they are with links). The question is about which is the better failure case.

jakearchibald

comment created time in a month

issue commentWICG/portals

Default click behaviour of portals

There are usually DOM changes/animations that need to be carried out before activation which would be skipped if we directly called activate on click.

"Need to" or "should"? Is 'nothing happens' a better failure case than 'portal activates'?

jakearchibald

comment created time in a month

issue openedWICG/portals

Default click behaviour of portals

It feels like we have an opportunity to make these things useful even without JavaScript.

We could make their default click behaviour to activate. This means if the user clicks on a portal, and the site's JavaScript fails to call activate (eg, it throws an error, fails to load, or hasn't loaded yet), they still get to the site they clicked on.

This makes them behave kinda like links by default.


This also gives us an opportunity to provide defaults to shift+click, middle click etc. The complicating factor here is: What happens to a portal if it's opened in a new window?

I guess starting a fresh navigation in a new window is least destructive, but doesn't make use of the pre-loaded page.

Alternatively, we could activate the portal in the new window, and do 'something' with the portal in the page. I'm just not sure what.

created time in a month

issue openedWICG/portals

Use canvas-like width & height

With canvas, the 'viewport' size is specified by the width/height attributes, whereas the size specified by CSS is the rendered size. Is that a more useful model for portals? Would it mean developers wouldn't need to mess around with scaling so much?

Eg:

<portal src="…" width="1920" height="1080" style="width: 100%; height: auto">

This portal would display the src rendered at 1920x1080, but its layout on the page would be the width of the parent element, and the height would be widthOfParent/(1920/1080) (maintaining aspect ratio).

The rendering of the element would be scaled to fit, according to object-fit and object-position.

created time in a month

issue commentWICG/portals

Click/input jacking and treatment of X-Frame-Options/CSP frame-ancestors

It would be good to agree on something like X-Portal-Options.

  • X-Portal-Options: deny - This page may not appear in a portal.
  • X-Portal-Options: sameorigin - This page may appear in a portal if all ancestors are same-origin.
  • X-Portal-Options: allow-from https://example.com - This page may appear in a portal if all ancestors are origin https://example.com.

X-Portal-Options would override anything in X-Frame-Options. As in, if X-Portal-Options is absent, X-Frame-Options is used.

dvoytenko

comment created time in a month

issue openedWICG/portals

Portals should load and retain state even when they're not in the document

Iframes reload if they're moved around the DOM, but I don't think the same should happen with portals.

Use-cases:


Imagine a list of article previews, where some/all contain portals to the article. On click, the portal animates to fill the viewport, then it's activated.

Doing this in-place is impossible if any ancestor element has overflow: hidden. This is likely since overflow: hidden is used for things like padding/float containment. This CSS will prevent the element filling the viewport.

The way this is typically achieved, is to move the element to <body>, and absolutely position it in its previous place, then it can be animated freely.

With an iframe, this would incur a reload, which is undesirable.


Imagine a list of article previews, where some/all contain portals to the article. On click, the portal activates. However, what if the user indicates they want the article to open in a new tab/window?

We already have window.open, but if the page is already loaded in a portal, we should avoid having to reload it. In this case the developer could open an about:blank window, move the portal to it, and activate it there.

Again, iframe-style reloading wouldn't work here.


Imagine a list of article previews, where the first is most-likely to be clicked, so should be preloaded.

Right now, the developer would have to add the portal to the page, position absolute, opacity 0, pointer-events none etc etc just so it actually loads. This feels like a hack.

The portal should load as soon as its src is set, so this sort of preloading doesn't require it being appended to the body.

created time in a month

issue commentWICG/portals

Should portal elements have scrollbars?

Another option is to render them in a disabled state.

oliverdunk

comment created time in a month

issue commentjakearchibald/idb

Support polyfilling getAll with one tiny change

Meh, it's difficult to judge these things by npm stats.

Fwiw, version 3 of this library did polyfill getAll https://github.com/jakearchibald/idb/blob/e1c7c44dbba38415745afc782b8e247da8c833f2/lib/idb.mjs#L259, but I dropped it in a rewrite. I think you're the first to create an issue about it, so yeah, maybe it isn't a big deal.

On the other hand, it would be pretty easy to add the polyfill back as an optional extra.

dumbmatter

comment created time in a month

push eventwhatwg/dom

Jake Archibald

commit sha ee795e40b12598cd9504c35f7667e3f0430fcab9

Update dom.bs Co-Authored-By: Anne van Kesteren <annevk@annevk.nl>

view details

push time in a month

issue closedjakearchibald/idb-keyval

DataError: Failed to write blobs.

We are getting this error when writing from some of our users (all Chrome). Resetting their DB fixes it, but that isn't a great solution. Restarting the browser etc doesn't work, it is permanently broken.

The only reference I can find to this error is here: https://github.com/localForage/localForage/issues/788

And indeed we switched to using idb-keyval based on the recommendation in that github issue, but it happens with idb-keyval as well.

I don't think this is an issue with idb-keyval, but I am hoping someone might have some insight into where this comes from.

closed time in a month

mcorner

issue commentjakearchibald/idb-keyval

DataError: Failed to write blobs.

This seems like a browser bug rather than anything to do with this library. Please file it with the browser's tracker, which is crbug.com in the case of Chrome.

mcorner

comment created time in a month

push eventwhatwg/dom

Jake Archibald

commit sha 0c1ac6196deb566859fe8e8627137693aeffb66f

Avoiding RFC2119 in note.

view details

push time in a month

pull request commentwhatwg/dom

Replacing 'context object' with 'this'

Fwiw, I asked for a way to do deprecations in bikeshed https://github.com/tabatkins/bikeshed/issues/1597.

jakearchibald

comment created time in a month

more