Capacitor Native Decorator
Description
@native decorator for Capacitor that revolutionizes the way we write and call plugins
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
capacitor-native-decorator [](https://badge.fury.io/js/@aparajita%2Fcapacitor-native-decorator)
❗️This package is now deprecated. Please read below if you are using Capacitor 4.
After spending many hours tracing through and reading through the Capacitor 4 source code and doing some experimentation with different coding conventions, I have come to the conclusion that this package is no longer needed.
Issues this package was originally designed to solve
This package was originally created to solve several issues:
- The need to manually maintain the
Plugin.mfile for iOS. - The inability to use non-native methods in a class on native platforms.
- The necessity to unwrap single return values from an object.
#1 was a convenient side-effect of solving #2 and #3. In reality, it isn’t that important, as the API for a plugin doesn’t change that much.
#2 is no longer a problem with Capacitor 4. You can call any method on a plugin object, even if it’s not native.
#3 is easily solved by using object deconstruction.
Issues created by this package
There are three issues this package created:
- It was relying on private API within Capacitor that could change in the future, thus preventing users of this package from upgrading to the latest version of Capacitor.
- It was circumventing the Capacitor plugin method calling mechanism entirely, which eventually could lead to unexpected behavior in future versions of Capacitor.
- It did not support lazy loading of plugins, which is now the recommended way.
Using standard Capacitor mechanisms instead of this package solves all of these issues.
**Note:** When plugins are lazy loaded, **all** of the methods in the plugin class must be async and return a Promise.
The remaining Capacitor issue
There is one problem with Capacitor 4 that needs to be solved if you want to get the mo
Related Skills
Awesome Go
A curated list of awesome Go frameworks, libraries and software
Development next.js
| The React Framework | 138360 | 1503 | 1 |
Development sharing-skills
skill for guidance.
Development root-cause-tracing
Use when errors occur deep in execution and you need to trace back to find the original trigger.
Development Template Skill
Minimal skeleton for a new skill project structure.
Development Third-party Notices
THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THI
Development