discourse/app/assets/javascripts
Isaac Janzen 21f23cc032
DEV: Convert header to glimmer (#25214)
Here is a breakdown of the changes that will be implemented in this PR.

# Widgets -> Glimmer

Obviously, the intention of the todo here is to convert the header from widgets to glimmer. This PR splits the respective widgets as so:

### widgets/site-header.js
```mermaid height=200
flowchart TB
    A[widgets/site-header.js] 
    A-->B[components/glimmer-site-header.gjs]
```

### widgets/header.js and children
```mermaid height=200
flowchart TB
    A[widgets/header.js] 
    A-->B[components/glimmer-header.gjs]
    B-->C[glimmer-header/contents.gjs]
    C-->D[./auth-buttons.gjs]
    C-->E[./icons.gjs]
    C-->F[./user-menu-wrapper.gjs]
    C-->G[./hamburger-dropdown-wrapper.gjs]
    C-->H[./user-menu-wrapper.gjs]
    C-->I[./sidebar-toggle.gjs]
    C-->J[./topic/info.gjs]
```

There are additional components rendered within the `glimmer-header/*` components, but I will leave those out for now. From this view you can see that we split apart the logic of `widgets/header.js` into 10+ components. Breaking apart these mega files has many benefits (readability, etc).

# Services

I have introduced a [header](cdb42caa04/app/assets/javascripts/discourse/app/services/header.js) service. This simplifies how we pass around data in the header, as well as fixes a bug we have with "swiping" menu panels.


# Modifiers
Added a [close-on-click-outside](cdb42caa04/app/assets/javascripts/discourse/app/modifiers/close-on-click-outside.js) modifier that is built upon the [close-on-click-outside modifier](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/float-kit/addon/modifiers/close-on-click-outside.js) that @jjaffeux built for float-kit. I think we could replace float-kit's implementation with mine and have it in a centralized location as they are extremely similar.

# Tests
Rewrote the existing header tests ([1](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/tests/integration/components/widgets/header-test.js), [2](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/tests/integration/components/site-header-test.js)) as system tests. 

# Other
- Converted `widgets/user-status-bubble.js` to a gjs component
- Converted `widgets/sidebar-toggle.js` to a gjs component
- Converted `topicFeaturedLinkNode()` to a gjs component
- Deprecated the [docking mixin](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/mixins/docking.js)
2024-02-23 11:08:15 -07:00
..
admin Build(deps-dev): Bump @ember/optional-features from 2.0.0 to 2.1.0 in /app/assets/javascripts (#25799) 2024-02-21 23:17:02 +01:00
bootstrap-json FEATURE: Add experimental option for strict-dynamic CSP (#25664) 2024-02-16 11:16:54 +00:00
deprecation-silencer DEV: Unsilence link-to deprecation for ember-cli build (#25197) 2024-01-10 11:01:57 +00:00
dialog-holder Build(deps-dev): Bump webpack from 5.90.2 to 5.90.3 in /app/assets/javascripts (#25746) 2024-02-19 23:13:34 +01:00
discourse DEV: Convert header to glimmer (#25214) 2024-02-23 11:08:15 -07:00
discourse-common Build(deps-dev): Bump @ember/optional-features from 2.0.0 to 2.1.0 in /app/assets/javascripts (#25799) 2024-02-21 23:17:02 +01:00
discourse-hbr Build(deps-dev): Bump @ember/optional-features from 2.0.0 to 2.1.0 in /app/assets/javascripts (#25799) 2024-02-21 23:17:02 +01:00
discourse-i18n Build(deps): Bump the embroider group (#24391) 2023-11-16 12:31:25 +01:00
discourse-markdown-it FEATURE: Auto generate and display video preview image (#25633) 2024-02-14 13:43:53 -07:00
discourse-plugins Build(deps-dev): Bump webpack from 5.90.2 to 5.90.3 in /app/assets/javascripts (#25746) 2024-02-19 23:13:34 +01:00
discourse-widget-hbs Build(deps-dev): Bump @ember/optional-features from 2.0.0 to 2.1.0 in /app/assets/javascripts (#25799) 2024-02-21 23:17:02 +01:00
docs
ember-addons
ember-cli-progress-ci
ember-production-deprecations DEV: Add production-mode shim for Em deprecation (#25109) 2024-01-03 10:39:59 +00:00
float-kit Build(deps-dev): Bump @ember/optional-features from 2.0.0 to 2.1.0 in /app/assets/javascripts (#25799) 2024-02-21 23:17:02 +01:00
locales DEV: convert I18n pseudo package into real package (discourse-i18n) (#23867) 2023-10-12 14:44:01 +01:00
patches DEV: Bump content-tag to 2.0.1 (#25541) 2024-02-02 13:33:29 +01:00
pretty-text Build(deps-dev): Bump @ember/optional-features from 2.0.0 to 2.1.0 in /app/assets/javascripts (#25799) 2024-02-21 23:17:02 +01:00
select-kit Revert "FIX: Show Uncategorized in category-chooser (#25794)" (#25843) 2024-02-23 12:21:44 -05:00
theme-transpiler Build(deps): Bump terser from 5.27.1 to 5.27.2 in /app/assets/javascripts (#25748) 2024-02-19 23:14:15 +01:00
truth-helpers Build(deps-dev): Bump @ember/optional-features from 2.0.0 to 2.1.0 in /app/assets/javascripts (#25799) 2024-02-21 23:17:02 +01:00
.licensee.json DEV: Use webpack to load table-builder dependencies (#25018) 2024-01-02 10:47:47 +00:00
.npmrc
handlebars-shim.js
package-ember3.json DEV: Use ember 5 in package.json files by default (#25207) 2024-01-10 18:30:50 +01:00
package-ember5.json DEV: Use ember 5 in package.json files by default (#25207) 2024-01-10 18:30:50 +01:00
package.json DEV: Switch default Ember version to 5 (#25203) 2024-01-10 12:12:36 +00:00
polyfills.js
run-patch-package DEV: Automatically retry patch-package on failure (#23583) 2023-09-14 12:25:06 +01:00
service-worker.js.erb FIX: Service worker push notifications when cache disabled (#25610) 2024-02-08 11:55:32 +00:00
yarn-ember3.lock Build(deps-dev): Bump @ember/optional-features from 2.0.0 to 2.1.0 in /app/assets/javascripts (#25799) 2024-02-21 23:17:02 +01:00
yarn-ember5.lock Build(deps-dev): Bump @ember/optional-features from 2.0.0 to 2.1.0 in /app/assets/javascripts (#25799) 2024-02-21 23:17:02 +01:00
yarn.lock DEV: Switch default Ember version to 5 (#25203) 2024-01-10 12:12:36 +00:00