-
-
Notifications
You must be signed in to change notification settings - Fork 969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Riot next - roadmap to v4 #2283
Comments
some more points to consider
<div data-is="my-tag" bgcolor="red" mytitle="this is my name" productprice="30"></div> <my-tag>
<div style="background-color:{= opts.bgcolor =}">
<h2>Page title: {= opts.mytitle =}</h2>
<p>Product Price (Including VAT): {= (opts.productprice * CONST_VAT_PERCENT).toFixed(2) =}</p>
</div>
</my-tag> It is obvious that a lot of re-computation could be avoided, resulting in much faster overall experience see also #2144 |
I believe we should avoid the |
I would like to see some rudimentary support for transitions/animation, in the form of deferrable/async (Promise based) control of Something along these lines, perhaps:
|
@fabien could you elaborate on this a little more? |
@papas-source I'll try ... is this more clear (at the expensive of being a bit contrived)? function fetchData() {
// Code to fetch data asynchrously
return promise
}
function performTransition(transitionName) {
// Promise is resolved once transition completes
return promise
}
willMount() { // called after the root is mounted, but before the mount event is fired
return fetchData().then(function(data) {
this.data = data
this.update()
}).then(function() {
return performTransition('fadeIn')
})
}
willUnmount() {
return performTransition('fadeOut')
}
willUpdate() { // called after shouldUpdate, but before update event fires
return performTransition('slideOut') // hide before update
}
didUpdate() { // called after update (but before updated event is fired - will wait)
return performTransition('slideIn') // show once fully updated & rendered
} |
I like all the ideas and upcoming features Gianluca. Please do not forget that many of us choose Riot over Vue due to size-first approach. The day Riot grows over 14KB my dreams will be crushed. Thank you in advance for staying committed to minimalism! |
@jakubrpawlowski actually my idea is to drop the size of the lib down to 3kb again but we will see I just need time to work on it stay tuned |
And something else, that is actually on the @tipiirai list of new features, and is a must have. Actually, I believe that it will make Riot a trully magnificent tool for creating reusable components.
|
I think that Shadow DOM is the optimal answer for component based UI. It is like this: |
Hi! Riot is shaping up great. We've been using Riot or a long time in our In addition, having multiple sources of streaming data, ajax requests, or waiting for I'm wondering if anyone has thoughts one way or another about adding the |
Please add custom directive/attribute. |
@davidtai I am not sure about all your performance concerns since you are using riot@2 in your components. Have you tried upgrading? Riot@3 is about 5x faster than the previous releases |
how's about "requiretags" ? something like requirejs ? Ex:
We can have
|
it's already there: riot.compile()
or multiple urls
|
Not everyone is on Gitter so I will just repost here a link that @richardtallent mentioned: |
@jakubrpawlowski it is allready in the todo list, see the first post by @GianlucaGuarini ;) |
Everything sounds good, with one exception -- dropping IE11 support. I use Riot on an intranet application, and while all of my users have Chrome available, IE11 is their default browser, so I can't drop support for it. I'd hate to get left behind on v4. In corporate environments, Windows 7 and 8 are still common and likely won't go away until 2020 and Edge is only available on Windows 10, so IE11 is as high as those environments can support. If the concern is IE11's lack of ES6 features, please keep in mind that over 50% of mobile browsers are still Android Browser 4/5 and iOS 9, which also have minimal ES6 compatibility. I do all of my tag compilation server-side, so feeding the output of gulp-riot to babel isn't a problem as long as the resulting javascript runs in IE11. |
I hear you, but punishing users of modern browsers (especially the ones on mobile) isn't fair either. Best solution imo would be optional pluggable polyfill for projects that need to support fetchless browsers as seen here (tip 8): https://hackernoon.com/10-things-i-learned-making-the-fastest-site-in-the-world-18a0e1cdf4a7#.19shthvx4 |
Will the yield / slot scope be changing to the parent tag's scope? I see yield in point 2 on the list but it's not clear to me if the scope is determined an issue or not. :) |
@davidhewitt this is labeled, As you can see I made a comment about that :) Feel free to upvote for it - allthough there is no guaranties that upvoted comments will pass ;) EDIT: I linked to one other comment, the link is fixed now |
Ah cheers I did scan the thread but failed to read the quote in our post. Upvoted! |
Droppping IE11 support would be a big problem for me. I work for a big company which just dropped IE8 in favour of IE11 and FF, for internal applications. It was a big move, as there are hundreds of them. In fact it's not totally finished yet, and wont be before a few months. If Riot V4 does not offer any solution to support IE11, I won't be able to use it any more for my professional projects :( |
How about some inheritance between tags (events, methods, variables)?
|
@PascalLeMerrer of course there will be ways to support ie11 but not in the riot core. I would like to make riot4 completely web components compliant providing a simpler API with some utils web components don't provide yet. I guess the new riot compiler will output kind of Custom Elements scripts |
@PascalLeMerrer @GianlucaGuarini I'm good with a standards-compliant riot as long as there's a good, clear way to polyfill for ie11 (I'm in the exact same boat as you Pascal). What stuff would we need to bring ie11 up to snuff for riot4? |
I decided that the foundation for the new riot major release will be the compiler and I am working a new draft release https://github.com/riot/compiler/tree/next |
+1 for dropping IE 9/10/11 support, |
Our company already gave up on IE 9 and below. |
@StarpTech discussing about browsers support when we don't have released either a pre pre pre alpha release of our new rewrite is worthless. Please let's wait until we will have something concrete to test ;) |
Hi, I'm just a bystander in the JS frameworks arena since I haven't coded front end JS in a while, but here some thoughts regarding mostly aesthetics I guess. I think this is how a v4 tag is going to look like
This is how a JS first approach might look like. And if you use ${} as delimiters, you get auto IDE integration (syntax highlight is easy to get, some IDEs have language injections by default)
And here it is in markojs (components are auto discovered, no import required)
|
FYI it appears one of the big limitations of HyperHTML is reordering. I don't trust browsers to do competent diffing on huge lists if you change the order of the items. This is one area that riot v4 would need to handle in a custom way. I could be wrong, but I don't think HyperHTML does "smart" diffing of lists (as it's focused on pushing template literals to the DOM and lets the browser handle it). edit: Or not! It seems Also: @GianlucaGuarini @aMarCruz This might be interesting: https://github.com/joshgillies/hypercomponent |
@nodefish I was actually going to ask what the issue was you were seeing with reordering. But it seems like you've uncovered the secret sauce since originally posting the above! Hint: Fact is if you manage your wires correctly you get node reuse for free, so as far as I'm concerned reordering becomes a non-issue. With regard to |
ES6TL are excellent for a generic use, but they are very limitated for things like <div attr={ a > 1 ? `foo${a}` : 'bar' }/> The riot parser is the base that can handle this and is (almost) already done. I'm now working on a "render" builder and a fork of hyperHTML v0.15.2 (ported to TypeScript) that will allow to emit HTML based in markers (like All this will be part of a completely new codebase with a simpler API and more oriented towards the compilation (lighter runtime) which should give us a much better performance. Regarding the low-level engine for the rendering I don't now... maybe I'll experiment with Inferno or snabbdom or some other framework yet, but the idea is performance w/ security and stability, keeping the riot syntax as much as possible. This is a lot of work and time (we are all volunteers :)), but we are already on the way. |
@aMarCruz You can do nested template literals with render`<div attr=${ a > 1 ? `foo${a}` : 'bar' } />` Of course that's different from the |
@nodefish actually, the code emitted for the previous fragment with my working "compiler" is something like this: render: function (state) {
riot.__$render(
[
['<div attr="', '"></div>'],
riot.__$toStr( state.a > 1 ? 'foo' + state.a : 'bar' )
]
)
} where riot is a small runtime for tests, So yes, it is possible to use ES6 TL, but I think the new parser is more convenient. |
nope, nopity nope. If I read that correctly, Following the ABC behind let previous;
function tag(chunks) {
if (!previous) previous = chunks;
console.log(previous === chunks);
}
tag`<div attr=${1}></div>`; // true
tag`<div attr=${2}></div>`; // true |
Moreover, in render`<div attr="${ a > 1 ? `foo${a}` : 'bar' }"></div>`; Not a single issue, you just need to follow the 2.5 rules of |
@WebReflection thanks for your excelent work and support. Regarding the above rules the riot compiler will emit what is necessary for hyperHTML to work as intended given the riot own rules (quoting unquoted attributes values, expanding selfclosing tags, and so on). In riot 3, all expressions generate raw text or values, not HTML. In v4 the expressions will generate text (textContent) or HTML (maybe other custom tag instances identified by the So, to allow expressions as text as unique content of an element, the compiler will append an space to the static part: For expressions generating HTML a prefix is required (ex: Maybe I'm wrong on some concepts, I'm very new to hyperHTML and the compiler is WIP. Right now I'm focused on the JS part and I have not started the complete tests, but would be very happy to have your support in the implementation of the engine (maybe by email or slack). |
I'd be happy to help but it looks like you're implementing a JSX transformer ...or something similar. @kentaromiura already worked on something similar, maybe he can help too. |
@WebReflection yep, we can see the riot compiler as something like that :) Thanks. |
I'm the first guy out there to say IE sucks. But IE11 is like 12% global market share as it was shipped with Windows 10. |
@babakness , |
In my experience, companies that have IE11-enabled systems are those open about which browser their employees use. Most of the issues remain in IE8/WinXP/Vista/7 from companies who are stuck in time (which make a big chunk of corporative market, sadly). |
You can use the :scope pseudoclass
|
OK, now I feel stupid. I wasn't aware of that. Thanks! |
@nodefish, no worries!!! It happens to me every day! |
I'd like to propose lazy/asynchronous component loading and mounting. E.g. I have a tag called I'd like a system where, upon the first instance of |
This is not true with viper-news as example, which is the fastest HNPWA these days, does that. Those |
Definitely agree with florian registering animation and retain events on dom update is only thing missing for me right now. I would love seeing that kind of animation stuff being done in riot without heavy use of .unmount() or creating custom tags. Just by adding some custom events to a dom node : <random-number-list>
<div class="app">
<div class="block" animation={ myAnimationHandler } each={ num in numbers }>
{ num }
</div>
</div>
<script>
var self = this,
count = 6;
this.numbers = [];
// using a string to get a default css-driven animation with conventions based animations (like react/vue/angular/...)
// .animated-number.animated-number-enter/.animated-number-leave/.animated-number-update
this.myAnimationHandler = "animated-number";
// using a function to manage dom node lifecycle with animation
this.myAnimationHandler = function () {
return {
onMount: () => true,
onUpdate: () => true,
onBeforeRemove: () => new Promise()
};
};
function setState() {
var i, number;
for (i = 0; i < count; i++) {
if (Math.random() < 0.5) {
number = Math.ceil(Math.random() * 12);
if (number > 9) number = null;
self.numbers[i] = number;
self.update();
}
}
setTimeout(setState, Math.random() * 250 + 250);
};
this.on('mount', setState);
</script>
</random-number-list> It's clearly something impossible to achieve in a simple way or with any mixin in the current versions. |
How about importing styles? <my-tag>
<h1> ... </h1>
<script>
import marked from 'marked';
</script>
<style>
import 'my-tag.css';
</style>
</my-tag> Or alternatively Maybe even assume To keep things separate for when a component's style becomes too large. This would be amazing with postcss. |
CSS imports already work. See proper syntax at MDN |
@bcartmell Sure but will Riot import this and parse it through its CSS parser? How would standard css |
@damusix Yes, Riot will parse it if provided a pre-processor (less is supported by default). The <style> tag in your tag file needs to specify type. Why can't you depend on a fixed path for your files? You should know where your src and dist files are. You should review the documentation at http://riotjs.com/api/compiler/ and start a new question if you still need help, but let's move this out of the 'roadmap to v4' thread. |
i'd like to kindly ask what is the up to date roadmap - features and timelines - of this wonderful library. i got lost among all these posts :-) |
closing this issue in favor of #2515 thanks anyone for the great feedback |
Roadmap proposal for the future riot major release:
(this list just a draft and it's going to grow)
<slot>
deprecating the<yield>
riot-observable
optionalthis.tags
from the tags instances in favor ofref
Unifythis.tags
functionality #2360riot.mount
method:root
selector instead of:scope
riot.csp
in favor of a simpler solutiones6
classes and functions instancesshouldUpdate
method in favor of a smarter DOM updates strategyeach={ items }
in favor ofeach={ item in items }
We will track the progress here
✌️
The text was updated successfully, but these errors were encountered: