Giter VIP home page Giter VIP logo

Comments (4)

yysun avatar yysun commented on June 4, 2024

You can make custom element/web components.

import SimpleComponent from './Simple.js';

app.webComponent('my-component', SimpleComponent);

const state = 'Hello';
const view = state => {
  return `<div>
    <h1>${state}</h1>
    <my-component />
  </div>`;
};
app.start('my-app', state, view);

from apprun.

tvardy avatar tvardy commented on June 4, 2024

It didn't want to work at the beginning. Then I prepared a repl.it demo to demonstrate the issue and... it worked well. It appears that AppRun didn't like to work with ESbuild. But I managed to configure ESbuild to use JSX with AppRun

from apprun.

yysun avatar yysun commented on June 4, 2024

I have an example of esbuild: https://repl.it/@yysun/apprun-esbuild

You can also try:

npx apprun --init --spa --esbuild

from apprun.

tvardy avatar tvardy commented on June 4, 2024

Yes... And it uses the JSX syntax, which I was trying to avoid at the beginning. That's why I asked about the way to use the tagged templates... 'cause I couldn't make it running myself...
For a moment It worked this way that if I'd put 2 components:

<my-component />
<my-component />

then the second one worked and displayed.

I'm not sure yet, but I think it might be related with a wrong handling of the "self closing tag" syntax. But I'm not sure yet. If I find some time to investigate, I certainly will and then... after maybe some more findings I'll file a bug ticket here.

Thank you very much for the help so far.

from apprun.

Related Issues (20)

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.