Git Product home page Git Product logo

server-components's Issues

Example with ES6 imports

I was wondering if there is a way to create a component in ES6 syntax and import it into another components. Would it be possible for you to modify the attached examples in the README file?

Event Handling on Server-Components doesnt work

I tried to run the following code

var DemoComponent = components.newElement();
DemoComponent.createdCallback = function (document) {
    this.style.color = 'blue';
    this.addEventListener('click', ()=> {
        console.log('hello');
        this.style.color = 'red';
    });
    this.innerHTML = "Hello";
};
components.registerElement("demo-component", { prototype: DemoComponent });

It did show me the Hello text in blue color, but it failed to trigger the event.

Convert to Custom Elements spec V1

Since this area of development is greenfield, it would be good to future-proof from the start. I'm currently working on a V1 conversion based on polymer's polyfill.

The main issue I've run into so far is that there is no more createdCallback. Instead, a constructor is defined. The spect dictates that this constructor "must not gain any attributes or children". Currently server-components relies on createdCallback returning a promise if it needs to block rendering.

The spec suggests that "work should be deferred to connectedCallback as much as possible—especially work involving fetching resources or rendering." Do you think this would be an acceptable replacement to createdCallback? i.e. server-components relying on that callback to return a promise, if needed?

template support

I notice your examples make a component in .js.
But spec allows for html template, in dom/markup - so it is easier for designers.

Is that supported or needs to be added?

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.