Giter Site home page Giter Site logo

lickability / observableconverter Goto Github PK

View Code? Open in Web Editor NEW
86.0 3.0 1.0 53 KB

A SwiftPM command plugin to convert SwiftUI code to Observable

Home Page: https://lickability.com/blog/introducing-observableconverter/

License: MIT License

Swift 100.00%
command-plugin swift swiftpm swiftui tooling xcode ios ios-swift swift-package swift-packages

observableconverter's People

Contributors

bcapps avatar samhenrigold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mastermikk

observableconverter's Issues

Optionally Add `@ObservationIgnored` to `ObservableObject` Lazy Properties

Feature Proposal

Add a flag to the command to mark any lazy property in an ObservableObject as @ObservationIgnored, as otherwise lazy properties will cause build errors now. Decide whether it should be enabled or disabled by default.

Acceptance Criteria

  • A flag for this exists on ObservableConverterCommand and can be sent to Arguments when running
  • The flag does the conversion to mark every lazy property in an ObservableObject as @ObservationIgnored

Handle Combine Usage within `ObservableObject`

Feature Proposal

Handle Combine usage such as assign(to published:) and internal @Published property observation.

Acceptance Criteria

  • The conversion should convert to assign(to:) to another supported call, and should handle fallbacks for @Published property observation such as either keeping those @published or adding CurrentValueSubject properties that are updated on didSet instead.

Apply @Bindable Where Necessary

Feature Proposal

When referencing EnvironmentObject or @ObservedObject properties as bindings, we should make use of @Bindable or the Bindable initializer to prevent a build error.

Acceptance Criteria

  • Binding references to environment objects should no longer trigger errors after conversion

Convert `onReceive` Usage for `@Published` Properties on `ObservableObject`

Feature Proposal

Convert onReceive references in SwiftUI views to use another view modifier instead now that properties will no longer be publishers. Something like onChange could work instead.

Acceptance Criteria

  • Any onReceive that references a formerly @Published property on an ObservableObject should now be a different view modifier that preserves the same functionality

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.