-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7.0.0 Beta #2290
Comments
I really liked the overall architecture of the project. This project had been my inspiration for a very long time. PS: I'm just gonna copy the whole browser folder for my new project 😄. |
@nmanumr thanks, that's awesome to hear! It can be hard to structure reactive projects when you're not using the idioms of an existing framework like React or Vue, but since we're doing progressive enhancement, we have to do some things differently. I'm very happy how things turned out switching to RxJS a year ago and with the recent refactoring, the project is now in much better shape. Feel free to steal anything you like, it's Open Source after all 😊 |
Maybe it would be useful if Material reported its own version number via JS, so plugins could react to this and provide switches (v7 vs. <v7). |
@wilhelmer Material always includes its own version + MkDocs version number! Grab it like this: document.querySelector("meta[name=generator]").content.split(", ") |
Two small errors in your initial post:
|
@wilhelmer thanks, I corrected it. |
Released mkdocs-localsearch 0.8.0 which should be compatible with Material v7. |
@wilhelmer why do you want to keep downward compatibility? I'd say if you want to use it with Material v5-6, just install |
Hmm true, that's also what I did for Material v4. But the code really isn't that complicated and avoids a breaking change for 99.9% of the current user base. Maybe I'll switch when a release candidate of v7 is out of the door. |
7.0.0 was just released! Please create new issues if you experience any problems. |
Exactly one year has passed since we switched to RxJS in v5 (#1465). This gave us the opportunity to make all parts of the theme observable to third-party JavaScript and eased maintenance because we can now rely on a well-tested library for all the plumbing. However, as I wasn't very experienced with RxJS, I made some rather bad design decisions, which made theme extension and adding of features cumbersome. For this reason, I decided to overhaul the architecture and move it to a simpler and more maintainable approach. This is what v7 is all about. After we get v7 out the door, we can iterate on new features even faster. Also, the code is much more readable and idiomatic now.
When the next funding goal is hit, the new features will be released as part of v7. This is expected to happen in the next 1-2 weeks. If you run across any issues, please open a new issue and prefix it with [v7]! Thanks for taking the time to test!
Installation
Migration
If you use Material for MkDocs without overrides, you can switch to v7 without any further ado.
Configuration
None.
Templates
The following adjustments need to be made to the partials:
Show template diff
JavaScript
The following adjustments need to be made to custom JavaScript:
Configuration
As can be seen in the template diff, configuration of the JavaScript is now done as part of a
script
tag with the typeapplication/json
. Search customization (transform
+index
) must be renamed and extend the config block:Before:
Now:
Flattened exports
The application will now export all observables into the
window
scope (and not theapp
variable as it was before):Before:
Now:
The following observables are exported:
document$
: Document changes (instant loading)location$
: Location changes (instant loading)target$
: Target changes, i.e. anchor link clickskeyboard$
: Keyboard eventsviewport$
: Viewport events (offset + size)tablet$
: Tablet breakpointscreen$
: Tablet breakpointprint$
: Print modecomponent$
: Component events (merged into a single stream)Deprecations
The
DOMContentSwitch
event is deprecated, as it is non-standard and was a bad idea overall. Use thedocument$
observable, to achieve the same thing.Before:
Now:
The text was updated successfully, but these errors were encountered: