commit 1de4c18436ecaefdcb734a4c606b233650eff850 Author: Ed Guloien Date: Mon Aug 24 16:26:38 2026 -0400 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d42a9d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +firefox-webapi-with-crates.pdf +firefox-webapi-with-crates.pptx diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ddcffeb --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +# requires secondary firefox binary + +all: pdf pptx + +pptx: + npx marp --pptx firefox-webapi-with-crates.md --browser firefox --browser-path ~/software/firefox-154-release/firefox --allow-local-files + +pdf: + npx marp --pdf firefox-webapi-with-crates.md --browser firefox --browser-path ~/software/firefox-154-release/firefox --allow-local-files diff --git a/firefox-webapi-with-crates.md b/firefox-webapi-with-crates.md new file mode 100644 index 0000000..f1a0502 --- /dev/null +++ b/firefox-webapi-with-crates.md @@ -0,0 +1,164 @@ +--- +marp: true @marp-team/marp-cli v4.4.0 (w/ @marp-team/marp-core v4.3.0) +title: Firefox Web APIs with crates over FFI +author: Ed Guloien +date: Sept 2026 +paginate: true +footer: Sept 2026 +--- + + + +# Firefox Web APIs with Crates (over FFI) + +### Ed Guloien + + + + +--- + +## about://ed-guloien + +- Software Developer @ Quantum Bridge: + Distributed Symmetric Key Exchange +- Former Mozillian: Platform, Networking +- Interests: Privacy, Security, Systems +- ed.guloien@qubridge.io + + + +![bg right:40% width:350](images/headshot.jpeg) + +--- +## Interop 2025 + +![bg width:600px](images/interop-2025-2.png) +![bg width:600px](images/interop-2025-3.png) + +--- +## URLPattern Web API + +```rust +// JS +// build a pattern +const pattern = new URLPattern({ pathname: "/books/:id" }); + +// check for match +pattern.test("https://example.com/books/123"); + +// get match info by component +pattern.exec("https://example.com/books/123").pathname.groups +``` + +--- +## Denoland & Firefox + +![bg width:400px](images/denoland-urlpattern.png) + +![bg width:600px](images/urlpattern-fission.drawio.png) + +------- +## Web API Call Flow + +![bg center width:1000px](images/urlpattern-call-flow.drawio.png) + +----- +## Urlpattern Crate API + +![bg center width:850px](images/urlpattern-details-simple.drawio.png) + +---- +## Glue Crate + +``` +let pattern = quirks::parse::(input); +let results = quirks::process_match(pattern, input); + +// call it a day +``` + +----- +## Reality Sets In (Memory Concerns) + +``` +#[repr(transparent)] +pub struct UrlPatternGlue(pub *mut c_void); + + +if let Ok(pattern) = quirks::parse::(input, ...) { + unsafe { + *res = UrlPatternGlue(Box::into_raw(Box::new(pattern)) as *mut _); + } +} + + +glue::process_match(..., res: *mut MatchResults, other: MaybeString) + + +glue::doing_thing(..., res: &mut ThinVec<>); +``` + +---- +## Pattern Re-use; Marshaling + +![bg center width:1000px](images/urlpattern-pattern-reuse.drawio.png) + +------ +## 99.8% + +``` +regex::Regex != EcmaScript Regex +``` + +---- +## Spidermonkey Challenges (many) + +![bg center width:825px](images/urlpattern-spidermonkey-challenges.drawio.png) + + +----- +## Phew! + + +![width:900px](images/urlpattern-interop-2025-results.png) + + + +#### References +- http://qubridge.io +- https://wpt.fyi/interop-2025 +- https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API +- https://searchfox.org/firefox-main +- https://github.com/denoland/rust-urlpattern +- See also: https://manuelbucher.com/blog/rust-gecko/ diff --git a/fonts/Montserrat-Bold.woff2 b/fonts/Montserrat-Bold.woff2 new file mode 100644 index 0000000..a75e620 Binary files /dev/null and b/fonts/Montserrat-Bold.woff2 differ diff --git a/fonts/Montserrat-Regular.woff2 b/fonts/Montserrat-Regular.woff2 new file mode 100644 index 0000000..694d308 Binary files /dev/null and b/fonts/Montserrat-Regular.woff2 differ diff --git a/images/denoland-urlpattern.png b/images/denoland-urlpattern.png new file mode 100644 index 0000000..063cfa8 Binary files /dev/null and b/images/denoland-urlpattern.png differ diff --git a/images/headshot.jpeg b/images/headshot.jpeg new file mode 100644 index 0000000..0ae6207 Binary files /dev/null and b/images/headshot.jpeg differ diff --git a/images/interop-2025-1.png b/images/interop-2025-1.png new file mode 100644 index 0000000..c49b5a8 Binary files /dev/null and b/images/interop-2025-1.png differ diff --git a/images/interop-2025-2.png b/images/interop-2025-2.png new file mode 100644 index 0000000..cd9941f Binary files /dev/null and b/images/interop-2025-2.png differ diff --git a/images/interop-2025-3.png b/images/interop-2025-3.png new file mode 100644 index 0000000..dedb38a Binary files /dev/null and b/images/interop-2025-3.png differ diff --git a/images/qb-logo-mark.png b/images/qb-logo-mark.png new file mode 100644 index 0000000..76353d2 Binary files /dev/null and b/images/qb-logo-mark.png differ diff --git a/images/qb-logo-text.png b/images/qb-logo-text.png new file mode 100644 index 0000000..9663a2f Binary files /dev/null and b/images/qb-logo-text.png differ diff --git a/images/urlpattern-call-flow.drawio.png b/images/urlpattern-call-flow.drawio.png new file mode 100644 index 0000000..0df0e6c Binary files /dev/null and b/images/urlpattern-call-flow.drawio.png differ diff --git a/images/urlpattern-details-simple.drawio.png b/images/urlpattern-details-simple.drawio.png new file mode 100644 index 0000000..9f8b78f Binary files /dev/null and b/images/urlpattern-details-simple.drawio.png differ diff --git a/images/urlpattern-fission.drawio.png b/images/urlpattern-fission.drawio.png new file mode 100644 index 0000000..aa72f6b Binary files /dev/null and b/images/urlpattern-fission.drawio.png differ diff --git a/images/urlpattern-interop-2025-results.png b/images/urlpattern-interop-2025-results.png new file mode 100644 index 0000000..c6c5f53 Binary files /dev/null and b/images/urlpattern-interop-2025-results.png differ diff --git a/images/urlpattern-pattern-reuse.drawio.png b/images/urlpattern-pattern-reuse.drawio.png new file mode 100644 index 0000000..31a6001 Binary files /dev/null and b/images/urlpattern-pattern-reuse.drawio.png differ diff --git a/images/urlpattern-spidermonkey-challenges.drawio.png b/images/urlpattern-spidermonkey-challenges.drawio.png new file mode 100644 index 0000000..fbd838b Binary files /dev/null and b/images/urlpattern-spidermonkey-challenges.drawio.png differ