lightningcss
MSEdgeExplainers
lightningcss | MSEdgeExplainers | |
---|---|---|
11 | 18 | |
5,966 | 1,255 | |
2.0% | 1.1% | |
8.7 | 8.1 | |
6 days ago | 1 day ago | |
Rust | HTML | |
Mozilla Public License 2.0 | Creative Commons Attribution 4.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
lightningcss
-
I'm fed up with it, so I'm writing a browser
Would you consider using some libraries in your project? There are lots of good ones in the Rust ecosystem, and many of them are not part of any existing browsers.
For example:
- https://github.com/servo/html5ever (HTML parsing - note: this is used in Servo)
- https://github.com/parcel-bundler/lightningcss (CSS parsing)
- https://github.com/DioxusLabs/taffy (web layout)
- https://github.com/pop-os/cosmic-text (text layout and rendering)
Obviously you should be free to work on whatever you like, but just as a benchmark on the scope of your project: I spent ~6 months implementing just the CSS Grid algorithm in Taffy last year. An entire browser from literal scratch is probably a 10 year project for one person.
- LightningCSS Benchmark
-
We're building a browser when it's supposed to be impossible
Libraries for a lot of this stuff exist (albeit in many cases not very mature yet):
- https://github.com/pop-os/cosmic-text does text layout (which Taffy explicitly considers out of scope)
- https://github.com/AccessKit/accesskit does accessibility
- https://github.com/servo/rust-cssparser does value-agnostic CSS parsing (it will parse the general syntax but leaves value parsing up to the user, meaning you can easily add support for whatever properties you what). Libraries like https://github.com/parcel-bundler/lightningcss implement parsing for the standard css properties.
- There are crates like https://github.com/BurntSushi/bstr and https://docs.rs/wtf8/latest/wtf8/ for working with non-unicode text
We are planning to add a C API to Taffy, but tbh I feel like C is not very good for this kind of modularised approach. You really want to be able to expose complex APIs with enforced type safety and this isn't possible with C.
-
Help with "returns a value referencing data owned by the current function"
Background: I encountered this problem using lightningcss.
-
On Using Rust in Parcel and Vitest
You can do it - that's actually exactly what my project is doing. I have a single repository with a Rust project, that builds the .wasm file (+ .d.ts + .js) using wasm-pack, and a Node.js project, that uses this .wasm file. There's no problem in packing that and exposing as a npm package. See parcel-bundler/lightningcss for a full blown example (it's not using wasm-pack but builds the Rust project directly).
- An fast CSS parser, transformer, bundler, and minifier written in Rust
- Parcel-Css - A CSS parser, transformer, and minifier written in Rust.
- ParcelCSS – A CSS parser, transformer, and minifier written in Rust
-
Parcel CSS: A new CSS parser, compiler, and minifier
Initial commit, 9 Oct 2021. That is pretty new.
MSEdgeExplainers
- Microsoft Edge Side Panel API
-
Tether elements to each other with CSS anchor positioning
The spec is a W3C CSS working group draft: https://drafts.csswg.org/css-anchor-position-1/
It looks like less of a Chrome thing and more of an Edge thing? The Intent to Prototype [1] links to an Edge explainer [2] with Microsoft authors. It doesn't look like anyone has asked Mozilla for a position yet [3] but I expect if they get positive signals from web developers (us!) that will be soon.
[1] https://groups.google.com/a/chromium.org/g/blink-dev/c/vsPdd...
[2] https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/...
[3] https://github.com/mozilla/standards-positions/issues?q=anch...
- Make your design compatible with foldable device
-
HTML document subtitles?
Read the explainer here
- More than “Just a web app”
-
What's New In Microsoft Edge Devtools?
You can learn more about Focus Mode in this Edge explainer document.
-
Parcel CSS: A new CSS parser, compiler, and minifier
For a spec about a browser feature, "getting it" can mean a few different things.
1. Understanding the purpose of the feature ("why/when would I use this?")
2. Understanding how to implement the feature
3. Understanding how to use the feature
4. Understanding the feature's "corner cases" (surprising implications, cases where it doesn't do what you'd expect, etc.)
5. Understanding why the feature works the way it does (instead of some other way)
Most of the web specs really only explain how to implement a feature, and even then, they're not great at that, because they do such a poor job at explaining the purpose of the feature.
Assuming that you, like most of us, aren't working on implementing a browser, that means that web specs are mostly unhelpful to you. It's almost completely beyond the purpose of a spec to teach you how to use a feature, what its corner cases would be (which are often unknown at the time a spec was written), and why the specification says what it says.
This is an area where the web spec community has made some improvements in recent years. Nowadays, it's understood that new proposed specifications shouldn't just provide a specification, but also a separate "explainer" document, whose purpose is to communicate #1 (the purpose of the feature), and also persuade the other browser vendors to implement the feature. ("This will be really cool, and here's why…")
At a minimum, specs nowadays often include a non-normative "Motivation" section, as the CSS Nesting spec does. https://www.w3.org/TR/css-nesting-1/ I you'll find that you can "get" that spec much better than you can the CSS OM spec https://www.w3.org/TR/cssom-1/ which is old enough to buy alcohol and doesn't include a "Motivation" section.
You can often find explainer docs linked off of https://chromestatus.com/ e.g. https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/... I think you'll find that explainers are 10000% better for learning features than specs are. (They typically even discuss #3, #4, and #5, as they typically discuss alternative rejected approaches.)
-
Introducing transparent ads in Microsoft Edge Preview
Transparent ads are enabled through ad providers joining the Transparent Ads Provider program. More info on the program and the requirements for providers here - https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/TransparentAds/Program-Overview.md
-
The strangely difficult problem of drawing a box around text
Not necessarily for a Swift project, but your experience makes me wonder about the current web API for highlighting spans of text.
https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/...
Complicated...
What are some alternatives?
PostCSS - Transforming styles with JS plugins
dropcss - An exceptionally fast, thorough and tiny unused-CSS cleaner
swc - Rust-based platform for the Web
ngx-foldable - Angular library to help your build dual-screen experiences for foldable or dual-screen devices
rust-cssparser - Rust implementation of CSS Syntax Level 3
react-foldable - A set of components to help you work with foldable screens
parse5 - HTML parsing/serialization toolset for Node.js. WHATWG HTML Living Standard (aka HTML5)-compliant.
Tailwind CSS - A utility-first CSS framework for rapid UI development.
x-ray - The next web scraper. See through the <html> noise.
surface-duo-photo-gallery - This repo is an Angular re-implementation of the Surface Duo Photo Gallery sample
excel-stream
hound - Lightning fast code searching made easy