Skip to content
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

fix!: remove super_clipboard from flutter_quill_extensions and move it to quill_super_clipboard #2322

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

EchoEllet
Copy link
Collaborator

@EchoEllet EchoEllet commented Oct 17, 2024

Description

Moving super_clipboard dependency from flutter_quill_extensions to quill_super_clipboard.

Minor breaking change

Unfortunately, this is a breaking change, while it doesn't require changes in Dart code, it requires removing the following from AndroidManifest.xml if was configured to launch the app:

<manifest>
    <application>
        ...
        <provider
            android:name="com.superlist.super_native_extensions.DataProvider"
            android:authorities="<your-package-name>.SuperClipboardDataProvider"
            android:exported="true"
            android:grantUriPermissions="true" >
        </provider>
        ...
    </application>
</manifest>

The new default implementation (#2230) uses quill_native_bridge which supports all the features that are used by flutter_quill and was made to avoid introducing a breaking change (changing the previous behavior), though I have missed that the required provider in AndroidManifest.xml is in super_native_extensions, removing super_clipboard also removes super_native_extensions and that plugin has the class com.superlist.super_native_extensions.DataProvider which doesn't exist anymore, you will be unable to run the app.

Migration

Remove the following if used:

FlutterQuillExtensions.useSuperClipboardPlugin();

A. Using the new default implementation

The android configuration of super_clipboard is no longer required.

The following snippet should be removed otherwise you will be unable to launch the app:

<provider
            android:name="com.superlist.super_native_extensions.DataProvider"
            android:authorities="<your-package-name>.SuperClipboardDataProvider"
            android:exported="true"
            android:grantUriPermissions="true" >
        </provider>
The error will be encountered when not removing this

FATAL EXCEPTION: main
                                                                                                    Process: com.example.example, PID: 7599
                                                                                                    java.lang.RuntimeException: Unable to get provider com.superlist.super_native_extensions.DataProvider: java.lang.ClassNotFoundException: Didn't find class "com.superlist.super_native_extensions.DataProvider" on path: DexPathList[[zip file "/data/app/~~Yk9JiyN7v_IE-XPUxHRzoQ==/com.example.example-2lizZbVWfYqolC9W579Crg==/base.apk"],nativeLibraryDirectories=[/data/app/~~Yk9JiyN7v_IE-XPUxHRzoQ==/com.example.example-2lizZbVWfYqolC9W579Crg==/lib/arm64, /data/app/~~Yk9JiyN7v_IE-XPUxHRzoQ==/com.example.example-2lizZbVWfYqolC9W579Crg==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
                                                                                                    	at android.app.ActivityThread.installProvider(ActivityThread.java:7770)
                                                                                                    	at android.app.ActivityThread.installContentProviders(ActivityThread.java:7276)
                                                                                                    	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6983)
                                                                                                    	at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2236)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:205)
                                                                                                    	at android.os.Looper.loop(Looper.java:294)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8177)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
                                                                                                    Caused by: java.lang.ClassNotFoundException: Didn't find class "com.superlist.super_native_extensions.DataProvider" on path: DexPathList[[zip file "/data/app/~~Yk9JiyN7v_IE-XPUxHRzoQ==/com.example.example-2lizZbVWfYqolC9W579Crg==/base.apk"],nativeLibraryDirectories=[/data/app/~~Yk9JiyN7v_IE-XPUxHRzoQ==/com.example.example-2lizZbVWfYqolC9W579Crg==/lib/arm64, /data/app/~~Yk9JiyN7v_IE-XPUxHRzoQ==/com.example.example-2lizZbVWfYqolC9W579Crg==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
                                                                                                    	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
                                                                                                    	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
                                                                                                    	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
                                                                                                    	at android.app.AppComponentFactory.instantiateProvider(AppComponentFactory.java:147)
                                                                                                    	at androidx.core.app.CoreComponentFactory.instantiateProvider(CoreComponentFactory.java:66)
                                                                                                    	at android.app.ActivityThread.installProvider(ActivityThread.java:7754)
                                                                                                    	at android.app.ActivityThread.installContentProviders(ActivityThread.java:7276) 
                                                                                                    	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6983) 
                                                                                                    	at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0) 
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2236) 
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106) 
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:205) 
                                                                                                    	at android.os.Looper.loop(Looper.java:294) 
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8177) 
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) 
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) 

See the quill_native_bridge platform configuration (optional for copying images on Android).

Other Optional changes

  • Use the Flutter default minSdkVersion:
android {
  defaultConfig {
   minSdk = flutter.minSdkVersion
 }
}
  • Use the Flutter default ndkVersion:
android {
  ndkVersion = flutter.ndkVersion
}

B. Continue using the super_clipboard implementation

Use the new default implementation or if you want to continue using super_clipboard, use the package quill_super_clipboard (support might be discontinued in future releases).

Related Issues

Type of Change

  • New feature: Adds new functionality without breaking existing features.
  • 🛠️ Bug fix: Resolves an issue without altering current behavior.
  • 🧹 Code refactor: Code restructuring that does not affect behavior.
  • Breaking change: Alters existing functionality and requires updates.
  • 🧪 Tests: Adds new tests or modifies existing tests.
  • 📝 Documentation: Updates or additions to documentation.
  • 🗑️ Chore: Routine tasks, or maintenance.
  • Build configuration change: Changes to build or deploy processes.

@EchoEllet EchoEllet requested a review from singerdmx October 17, 2024 02:08
@EchoEllet EchoEllet changed the title fix: remove super_clipboard from flutter_quill_extensions and move it to quill_super_clipboard fix!: remove super_clipboard from flutter_quill_extensions and move it to quill_super_clipboard Oct 17, 2024
@EchoEllet
Copy link
Collaborator Author

I'm uncertain if we should not merge this, if we keep super_clipboard non-optional we will have other issues that prevent developers from using the library or continue using it. Bumping the major version just to solve this issue is not very ideal, we need to introduce more changes so the migration guide will be all at once and packages that depend on flutter_quill continue to work without an update.

Updating the DefaultClipboardService to not use quill_native_bridge by default would require us to introduce a breaking change (that also breaks the current behavior) and would not allow removing super_clipboard without or with minimal changes.

@EchoEllet EchoEllet changed the base branch from master to release/v11 October 17, 2024 02:47
@EchoEllet
Copy link
Collaborator Author

Since this is a breaking change and it's necessary, I will have to publish it as a new major version 11.0.0. We should introduce more changes and cleanup before publishing version 11.0.0.

@EchoEllet EchoEllet marked this pull request as ready for review October 17, 2024 02:48
@EchoEllet EchoEllet merged commit 5f2058d into release/v11 Oct 17, 2024
2 checks passed
@EchoEllet EchoEllet deleted the fix/super-clipboard-optional branch October 17, 2024 02:51
EchoEllet added a commit that referenced this pull request Nov 9, 2024
* fix!: remove super_clipboard from flutter_quill_extensions and move it to quill_super_clipboard (#2322)

* chore!: remove the controller from the configuration class, remove the quill toolbar and editor provider widgets, and other minor breaking changes

* chore!: remove SimpleSpellCheckerService from flutter_quill_extensions

* chore!: remove experimental support for spell checking, remove the deprecated support for YouTube in flutter_quill_extensions, and other minor breaking changes

* chore(deps): remove equatable

* chore!: remove quill shared configuration and toolbar shared configuration

* chore!: remove QuillController.setContents()

* chore!: remove QuillController.editorFocusNode

* chore: remove outdated comments

* chore: always call setState() in _markNeedsBuild() in QuillRawEditorState even if dirty is already true (revert to old behavior)

* chore: extract code from _requestKeyboard() and add docs comment for _requireEditorCurrentState

* chore!: remove classes related to editor element options, minor docs updates in editor config, rename isOnTapOutsideEnabled to onTapOutsideEnabled

* chore!: rename 'Configurations' to 'Config'

* chore!: refactor build method of the embed block interface

* chore!: remove the experimental table support from flutter_quill_extensions

* chore!: remove old deprecated properties

* chore!: rename rawItemsMap to items for font family and font size options

* chore!: remove deprecated formula embed support from flutter_quill_extensions

* chore!: remove deprecated class SuperClipboardService, rename the directory models to config in flutter_quill_extensions

* chore: add commnet in imageProviderBuilder code docs comment in flutter_quill_extensions

* docs: fix typos in migration

* docs(readme): replace deprecated flutter_quill_internal.dart with internal.dart

* docs(readme): improve README

* docs(readme): add the GitHub flutter_quill code snippet back

* docs: add more details to the migration guide

* fix(ios): use the localized strings for 'open', 'copy', and 'remove'

* chore: rename the file quill_controller_configurations.dart to quill_controller_config.dart

* chore!: avoid storing quill editor config inside Document

* chore: restore search within embed objects feature (revert removal of editor config inside the QuillController)

* chore: add @experimental to some APIs

* docs: add emojis to the migration guide, add the migration guide link in README.md

* chore: removes quill controller web files, updates QuillControllerConfig.onClipboardPaste to allow overriding the default paste handling

* docs: fix typos in the migration guide

* chore: minor change in the migration guide

* docs: update link of QuillControllerConfig.onClipboardPaste in the migration guide

* chore: fix dart analysis issues

* chore: mark QuillEditorConfig.customLeadingBlockBuilder as experimental

* chore!: avoid exporting OptionalSize

* chore: rename _restoreToolbar to _restoreToolbarAfterMagnifier in text_selection.dart

* chore: annotate QuillEditorConfig.magnifierConfiguration as experimental

* chore: minor cleanup to magnifier feature

* chore: export missing class, fix #2333

* chore: fix dart analysis

* chore(release): temp changes to publish 11.0.0 (will revert changes of this commit)

* chore: add temp dependency_overrides to fix CI failure

* chore: temp changes to publish 11.0.0-dev.1

* ci(publish): temp change to fix CI failure

* chore: restore previous publish workflow (revert), update min version of flutter_quill in test and extensions packages, remove pubspec_overrides.yaml

* chore: revert CHANGELOG.md and publish.yml changes

* chore: revert a change in #2026 (see comment https://github.com/singerdmx/flutter-quill/pull/2026/files#r1679744497)

* chore: revert change of reverting the removal of _handles check introduced by #2026

* docs(migration): clarify the removal of the QuillToolbar widget

* docs(migration): improve removal of the QuillToolbar section

* docs: add the custom toolbar page link in: removal of the QuillToolbar

* docs: add important info at the top of the migration guide

* feat(toolbar): add the base button options feature back, supports flutter_quill_extensions's buttons too.

* chore: fix analysis warnings

* docs: add more details in the migration guide in the breaking behavior with code snippets

* chore: minor change to the 'Breaking behavior' section

* chore(deps): improve dependencies constraints for compatibility

- Fix #2341
- Fix #2347

* docs(migration): explain that QuillToolbar is not a visual widget like QuillSimpleToolbar

* docs: minor changes to README.md and migration guide

* feat: clipboard paste callbacks, partial fix to #2350

* docs: update outdated link in the migration guide

* chore: rename deltaToPaste() to getDeltaToPaste()

* docs: improve CHANGELOG.md format and quality, fixing #2211

* ci: pass the GitHub token to an action

* docs: fix format of CHANGELOG.md

* ci: use cider for CHANGELOG.md format validation

* ci: add a TODO to improve CHANGELOG.md validation

* chore: remove flutter_quill_extensions from publishing

* chore: publish flutter_quill_extensions and add 'insertVideo' in quill_en.arb

* chore(release): prepare to publish 11.0.0-dev.3

* ci: increase _expectedTranslationKeysLength due to 'insertVideo'

* ci: use a GitHub action to update the release notes

* chore(release): publish flutter_quill_extensions 11.0.0-dev.3

* chore(release): prepare to publish 11.0.0-dev.4

* ci: remove the release notes file creation

* chore(example): delete the current example to recreate

* chore: recreate the example (fix #2249), minor changes to flutter_quill_extensions

* docs(readme): update the screenshots of the example app

* docs(readme): update sample page link, remove 'breaking changes' from table of contents only

* feat: add the option to disable rich text paste feature, partial fix to #2350

* chore(release): prepare to publish 11.0.0-dev.5

* chore: regenerate translations to reflect #2358

* chore: ignore deprecations

* docs: fix a minor issue in the Contributing guide

* chore(example): add file read access for macOS

* feat(l10n): localize "insert video" for Khmer language

Source: #2358 (comment)

* chore: simplify PR template

* docs: update development notes

* docs(readme): use images from GitHub repo instead of relative path to load on pub.dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SuperClipboard feature need to be disable in flutter_quill_extensions
1 participant