Coder Social home page Coder Social logo

ce-cycle's Introduction

Cycle.js with Custom Elements v1 experiments

WIP Experimental!

Demonstrating use of Custom Elements v1 with Cycle.js app using virtual-dom

Project was generated using cyc

TODO: Please upgrade to snabbdom

Original Hello World project

This project is based on Custom Elements v1 - "Hello World" demo as described in Custom Elements v1 vs JS frameworks blog post by Ferdy Christant.

Updated github repo for original blog post code can be found here

Key observations

Please run the code in Chrome Canary (Chrome 59 or above) for native Custom Elements v1 support.

If native support is not detected, a polyfill will be loaded to fill in the gaps (see /public/polyfill folder)

This demo demonstrates two different models:

Browser built in ES6 in public/ce.js and using Babel transpilation with the Cycle.js code, using the following Babel configuration using babel-plugin-transform-custom-element-classes

{
	"presets": ["stage-0", "es2015"],
	"plugins": [
		"transform-custom-element-classes",
		"transform-es2015-classes"
	]
}

Make sure to add the babel plugins to your devDependencies:

npm i -D babel-plugin-transform-custom-element-classes npm i -D babel-plugin-transform-es2015-classes

"devDependencies": {
    "babel-plugin-transform-custom-element-classes": "^0.1.0",
    "babel-plugin-transform-es2015-classes": "^6.23.0",
    ...
}

Issues

Currently having an issue getting the Babel transform to work properly!

Babel issue discussion

Other Attempts

Turns out the issues were simply caused by optimistically trying to upgrade the cyc base template to use later versions of Cycle etc.

It should work just fine on a fresh template start!

License

MIT Kristian Mandrup

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.