-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
refactor(ui): improve modularity, lifecycle, and types #1007
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Introduce a service dependency container for better management (#1006). - Replace original `services` definitions with `provide` and `inject` methods. - Recommend calling `inject` at the beginning of `ArtalkPlugin` to explicitly inject required dependencies. - Replace `load` with `mount` for improved lifecycle handling. - Track local config. - Fix potential language setting not working issue. (Fixes #973) - Refine Type definitions for clarity and maintainability. - See [TypeDoc](https://artalk.js.org/typedoc/) for updates. - Enhance config logic with `ConfigManager`. - Deprecate `ctx.conf` and `ctx.$root`; use `getConf()` and `getEl()` instead. - Update client default config settings. (Fixes #1001) - Improve event handling with `EventManager` refactor. - Update plugin and editor architecture for greater flexibility. - Further eliminate global variables and avoid directly passing the `Context` interface as a function parameter. Instead, use more explicit and specific types and parameters. - Remove deprecated and redundant code for a cleaner structure. BREAKING CHANGE: This update changes the UI client's export Types. Although we aim to maintain backward compatibility, it may still affect downstream UI programs. Please refer to the [TypeDoc](https://artalk.js.org/typedoc/).
qwqcode
added a commit
that referenced
this pull request
Oct 18, 2024
Since the client program already prioritizes local configuration over remote configuration by default, there's no need to use the `remoteConfModifier` magic function to alter the configuration priority. The dependency injection function has changed from `get` to `inject`, or call a more specific method from the `Context` interface. (The prerequisite PR is #1007)
qwqcode
added a commit
that referenced
this pull request
Oct 18, 2024
- Bump to new Artalk client export types - Add `AuthContext` type definition for improved clarity - Replace `ContextApi` with `AuthContext` for reducing the scope of variables - Bump version to 0.0.2 for release (The prerequisite PR is #1007)
qwqcode
added a commit
that referenced
this pull request
Oct 18, 2024
- Bump to new Artalk client export types - Add `AuthContext` type definition for improved clarity - Replace `ContextApi` with `AuthContext` for reducing the scope of variables - Bump version to 0.0.2 for release (The prerequisite PR is #1007)
qwqcode
added a commit
that referenced
this pull request
Oct 18, 2024
Add `preferRemoteConf` option (disabled by default). Local config now takes priority, addressing the issue where remote config previously overrode local settings. (Closes #1000) Updated config merging logic in `mount.ts`. Deprecated `useBackendConf` in favor of `preferRemoteConf`. (The prerequisite PR is #1007) BREAKING CHANGE: The UI client now prioritizes local config in the latest version, whereas previously, the remote config would override it.
qwqcode
added a commit
that referenced
this pull request
Oct 18, 2024
Add `preferRemoteConf` option (disabled by default). Local config now takes priority, addressing the issue where remote config previously overrode local settings. (Closes #1000) Updated config merging logic in `mount.ts`. Deprecated `useBackendConf` in favor of `preferRemoteConf`. (The prerequisite PR is #1007) BREAKING CHANGE: UI client now prioritizes local config in the latest version, whereas previously, the remote config would override it. (See #1011)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
services
definitions withprovide
andinject
methods.inject
at the beginning ofArtalkPlugin
to explicitly inject required dependencies.load
withmount
for improved lifecycle handling.ConfigManager
.ctx.conf
andctx.$root
; usegetConf()
andgetEl()
instead.EventManager
refactor.Context
interface as a function parameter. Instead, use more explicit and specific types and parameters.BREAKING CHANGE: This update changes the UI client's export Types. Although we aim to maintain backward compatibility, it may still affect downstream UI programs. Please refer to the TypeDoc.