GithubHelp home page GithubHelp logo

lpalmes / pure Goto Github PK

View Code? Open in Web Editor NEW
137.0 11.0 3.0 4.72 MB

React in pure Reason that targets native platforms.

OCaml 72.63% C++ 0.09% HTML 0.21% Makefile 0.95% Shell 2.57% C 23.55%
reasonml react react-native reason-react

pure's Introduction

Pure

Pure stands for Pure Reason

The idea of this project is to have cross-platform Reason code for web, desktop, mobile, that's why Pure was named as i wanted to write pure reason code (thanks to cherta for the name).

This is an experiment on some ideas i have, i will write some more in the future, but for now this can be seen as a cross platform ui library using each native platform and always providing a great developer experience like instant and consistent hot code reloading.

Why this exists?

Electron is a successful case of cross platform code between three platforms: MacOS, Linux, Windows and the Web. But such benefits bring costs as high resource usage and most of the time core rewrites in c++ (or another language) to avoid those issues. I believe that React Native has solved this problem by using the platform (iOS and Android for now), and the desktop environments could benefit from this as well. Hence this project, which is an experiment of doing a cross platform ui library to satisfy electron use cases for an lighter alternative using native platform.

Project structure

  • pure: this is the bare bones definiton of pure, similar like the react package is agnostic of the renderer and compiles to all platforms
  • reconciler: this is the fiber-esque reconciler
  • pure-dom: the dom/web render using the reconciler above (not working now, work in progress in using bucklescript + esy, any help is appreciated :) )
  • pure-macos: the native render using the reconciler and flex to layout the views. This has a MacOS render for now, but a Linux and Windows is in the works.
  • pure-noop: a no op reconciler to play around, nothing too important
  • cocoa-ml: cocoa (macos) bindings, silly name but well, naming is definitely the hardest problem in computer sience
  • pure-ppx: a ppx that should work like reason react ppx, but nothing working for now
  • specs: ideas and mechanics of multiple aspects of this project, more than welcome to discuss

Take it for a spin

Before running it

You should have esy installed, and then run esy install, first time installing it might take a while if you haven't played around with esy.

Native

esy x main
or
esy dune exec main

Browser

broken for now :(

If you want to help you are more than welcome to do so. This is an experiment that i hope it turns into a viable route, i believe we deserve a better alternative for the desktop.

Credit and inspirations

pure's People

Contributors

danieljharvey avatar lpalmes 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pure's Issues

Pure CLI

Do you want to request a feature or report a bug?

Feature

Feature Objective:

  • Help onboarding newcomers.
  • Improve developer experience

Feature Suggestion:

  • Create a CLI à-la react-native to create a new cross-platform (MacOS, Windows, Linus, Web) project. - This CLI would usually be installed once globally and use the latest version of Pure skeleton.
  • This could also help linking | unlinking custom components to native code

npm run build:native crashes

  1 │ module Impl = (T: {type t;}) => {
  2 │   external asEventTarget : T.t => Dom.eventTarget = "%identity";
  3 │ 
  4 │   [@bs.send.pipe : T.t] external addEventListener : (string, Dom.event 
      => unit) => unit = "";

The module or file Dom can't be found.

Thoughts on ReactMini?

This project seems super cool and actually aligns with an idea I had back in Oct.

What are your thoughts on ReactMini? I was thinking about using that as the reconciler (if I'm using that term correctly), but it seems like your have implemented your own?

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.