question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

My 5 cent after 5 minutes: no rendering for incomplete models?

See original GitHub issue

This post is from someone who spent 5 minutes with the framework, while using Angular.JS for every day work…

The very first (Hello World!) example takes us to this jsFiddle example: https://jsfiddle.net/chrisvfritz/50wL7mdz/

The very first thing I did, I extended the template to be: {{message}} = {{extended}}. And the view came up empty. Why is it empty, if I’m just extending a template that has some properties already defined in it?

It was only after I added property extended into the model that I was able to see the proper view.

How come the entire model is ignored/skipped unless it is fully defined? This doesn’t make sense. Any complex view/template design starts by introducing elements one by one, many of which may be optional, and we cannot even see anything unless everythign has been defined.

This looks like the wrong approach.

Please don’t be too judgmental, I just wanted to share my impression after 5 minutes of playing with it, which I think still matters because this is how many newcomers are likely to percieve this framework.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:22 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
yyx990803commented, Dec 1, 2016

Yes this is different from Angular, and it is intentional. It is required to explicitly declare all root-level reactive properties upfront. This has a few benefits:

  1. Your data serves as the schema of your component state. When maintaining it later, by looking at your component definition you are able to instantly see what properties are available. If you simply dynamically add new properties at random places, it would be a maintenance nightmare, like maintaining a database without a schema.

  2. This results in more predictable behavior, in particular when paired with type-checking systems.

  3. It avoids excessive re-render that might be caused by adding root-level properties.

Finally, as a developer you should be able to choose what browser to develop in. If Chrome 44 is the only browser you can use at your job, that seems like a terrible decision on your companies part. Do all customers of your company use Chrome 44? Probably not.

3reactions
LinusBorgcommented, Dec 1, 2016

Well, the reasoning can be explained as follows:

  • We cannot reproduce this behaviour with currently supported browsers in their latestest (auto-updated) versions.
  • We have limited time and resources to reproduce problems on all possible system and browser compbiantions.
  • Chrome Version 44, the version you seem to have this problem with (and maybe it’s a combination of v44 and some extension?), currently has a market share of 0.08%.
  • The error you experience is not a bug from using Vue as intended, it only happens when you use Vue in a way you should explicitly not, and if your error does not appear, a dev warning would appear in its place. So there’s no danger of it making its way into production.

If we take all of this into account, it seems to me that it’s not worth our limited resources to try and hunt down a bug that is not reproducible for us, but may happen for 0.08% of users if someone pushed this wrong code to production.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ALGEBRA I (Common Core)
Explain why you chose this model. Score 1: The student gave an incomplete explanation.
Read more >
Study: Most Job Seekers Abandon Online Job Applications
The problem of job candidates abandoning online applications continues to plague the recruiting industry. According to CareerBuilder, 60 ...
Read more >
State of the Art on Neural Rendering - arXiv
We focus on approaches that combine classic computer graphics techniques with deep generative models to obtain controllable and photo- realistic ...
Read more >
Recommended minimum requirements for plumbing - GovInfo
head of water or a 5-pound pressure of air. Under any test the water or air pressure shall remain constant for not less...
Read more >
80% SINGLE STAGE GAS FURNACES
Heat motor speed is de-energized after 5 second delay. NOTE 1) Furnace de-energizes the fan during the heat exchanger warm-up period on a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found