Skip to content
This repository has been archived by the owner. It is now read-only.

Light JavaScript components #283

Open
fomkin opened this issue Jul 13, 2019 · 5 comments
Open

Light JavaScript components #283

fomkin opened this issue Jul 13, 2019 · 5 comments
Assignees
Labels

Comments

@fomkin
Copy link
Owner

fomkin commented Jul 13, 2019

Web Components fell short of expectations.

  1. Most of components are extremely heavy
  2. Low browsers support
  3. API is complicated

We should add an our own component API to empower JavaScript interoperability.

@fomkin
Copy link
Owner Author

fomkin commented Jul 14, 2019

Requirements:

  1. It should be lightweight. 1 Kb is top limit
  2. Allow to define custom elements
  3. Interop using DOM and events
  4. No additional Scala code to write

@s0kil
Copy link

s0kil commented Nov 23, 2019

@fomkin I wanted to mention Svelte for inspiration because it satisfies most of the requirements mentioned.

@fomkin
Copy link
Owner Author

fomkin commented Nov 23, 2019

@s0kil Interesting. I've know about Svelte and know the the project philosofy is close to Korolev but I thought it locked up inside. I mean it's not confirm third requirement about DOM interopability.

But now, after your comment I found this project https://github.com/gojutin/svelte-custom-element

The Svelte compiler provides the option to compile to a custom element (web component). This allows you to use most of the niceties of Svelte to create your custom elements, which can be a nice alternative to the general class-based approach.

Looks like I need to dig deeper. Maybe Svelte is a good solution.

@s0kil
Copy link

s0kil commented Nov 23, 2019

@fomkin This 'component API' that you have mentioned will it also be transported via WebSockets on demand? Or will it be compiled with the Korolev run-time JS bundle?

@fomkin
Copy link
Owner Author

fomkin commented Nov 23, 2019

@s0kil I do not know. There is no design of light components for now. Of course first option is better.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants