$ show GeekyAnts/vue-native-core
Vue Native Core is a deprecated fork of Vue.js 2.x that compiles Vue component templates into render functions compatible with React Native (iOS/Android) and React Web. It provides a full reactive state management system (Vue's observer pattern), virtual DOM diffing, and a template compiler pipeline that transforms .vue single-file components into JavaScript modules usable by React Native's Metro bundler. The architecture mirrors Vue 2: core reactivity (Dep, Watcher, Scheduler), virtual DOM (createElement, patch), and a multi-stage compiler (parser → AST → code generator) with platform-specific backends for native and web. It also offers runtime helpers to emulate Vue directives (v-if, v-for, events) and component lifecycle in React. However, the project is explicitly deprecated, depends on outdated versions (Babel 6, React 16.8, React Native 0.45–0.59+), and uses deprecated React lifecycle methods (UNSAFE_componentWillMount). The codebase shows heavy modification of core Vue files, making it difficult to merge upstream updates, and its build system is complex and fragile. Despite these issues, the reactive state wrapper (Vue.observer) and the template-to-render compilers demonstrate non-trivial adaptation of Vue to React ecosystem.
The LLM identified 3 files worth highlighting for reuse:
Exports Vue.observer function that wraps a React component with Vue's reactive system. Allows React components to reactively react to Vue state changes. This pattern is isolable and reusable for integrating Vue reactivity into any React-based UI framework.
Implements a custom Metro bundler transformer for .vue single-file components. It hooks into the React Native build pipeline to compile .vue files into JavaScript modules. Demonstrates a clean plugin architecture and integration point, though it depends on internal compilation modules.
Base class for render generators that walks the compiled AST and generates render function code for both native and web platforms. Uses visitor methods for different node types (v-if, v-for, slots, directives). Demonstrates a well-structured code generation pattern that could be adapted for other template-to-code transformations.