Added several updates to the SteemMakers test site

in #utopian-io6 years ago (edited)

The solid base starts to pay off

It required quite some work and learning to switch the site's development path to a single page application. From researching if it would be a good path to follow, to learning, to setting up a development environment, to implementing and debugging. Finally I'm starting to get a hang of it. Makers don't always make things because the need them, or because the can make them. More often they make things because of the fun along the road.

Moving more to the SPA

Bit by bit all functionality gets moved to the SPA. I struggled quite a bit to get the footer integrated. Mainly because the footer needs to be at the bottom of the page, not at the bottom of the screen (or viewport as it is called technically). On the current site there was even an issue with the implementation. On smaller screens the text moved outside of the colored band:

old.png

This has now been fixed.

Capture.PNG

Moving the footer implementation to the application was an important step. Having it outside required some code outside of the application that shouldn't really be there. The result was that this common code was required twice. Once inside and once outside of the app, a maintenance nightmare and not very good for performance. It proved to be not so trivial as it looks at first sight. The biggest issue was that the vue.js template only allows for one outer element while almost every online example uses more. After a lot of digging and trial and error I finally got it working thanks to this flexbox article. I managed to copy the idea of this solution and got it working.

Curated articles

Another step in the development has been to further componentize the application. The article preview is a piece that can be reused in the blog overview, but also for the curated articles etc. Once that component was finished I started trying it out on the curated articles and started consuming the initial JSON api. The most difficult part was the asynchronous loading of the articles. For the blog this is not an issue because the steem api offers all content in one response. But for the curated articles overview every article needs to be loaded separately. Loading them one after another has a performance cost so I tried to do it asynchronously. I got this working quite fast but the view was not updating. After some digging in the vue.js documentation I found that there are some caveats with arrays. Instead of updating the array directly using:

vm.items[indexOfItem] = newValue 

I had to use a special vue function like this:

Vue.set(vm.items, indexOfItem, newValue)

Once I made this little change the eureka moment came. If you take a careful look at the recording below you can see that not all articles are loaded at the same time, and not in a sequential order. Performance at it's best.

testje.gif

Footers by @podanrj

A big warm thank you to @podanrj for making footers for us. If you'd like your personal one feel free to make a request in our discord channel #request-footer.

Live preview of the test site

Go to steemmakers.com/test.php. Please report any issues you encounter. Thank you!

What will come next?

Now that the curated articles view is working I'm thinking about further componentization. Maybe a 'preview list' component would prove interesting to be used for the curated articles as well as the blog. Another feature that needs to be added is pagination.

Help us out

Anyone interested is free to join and help out, all work is available on Github. More information can be found on our website www.steemmakers.com, have a look and join us on Discord!

Proof of Work Done

Repository: https://github.com/JefPatat/SteemMakers/tree/master/website

My github account: https://github.com/JefPatat

Relevant commits: several commits from May 13th to May 15th: https://github.com/JefPatat/SteemMakers/commits/master

footer.png

Sort:  

Just reminder. For maintainability, consider using Vue mixins for subfeature.
For example, you want to add markdown feature on Blog.vue and Comment.vue. You can structure your project by:

.src/ts
├── components
│   ├── Blog.vue
│   └── Comment.vue
│
└── mixins
    └── markdown.ts

then if you want to add markdown feature on some component you just

import markdown from '@mixins/markdown'
export default Vue.extend({
  mixins: [markdown]
})

bonus some bug on busy.org comment markdown
bug-busy.gif

Thanks. I'm learning as I go, so I value your feedback. I'll look into it. Still restructuring the code.

website is looking good - thank you for all your hard work in making steemit grow in a positive way! esp for us DIYers. And thank you for posting my article on your curated page :D

You'r most welcome. If you make other nice articles that fit our content do not hesitate to drop a link in our discord.

Thank you for your contribution. It's great that you are learning while developing the application, it's a great way to learn. Its better to comment your findings too inside the code which will be helpful for you as well as people who are reading your code.

Also, the feature added in this contribution is not much but will love to see the application with more features.

Your contribution has been evaluated according to Utopian rules and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post,Click here


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Hey @jefpatat
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Contributing on Utopian
Learn how to contribute on our website or by watching this tutorial on Youtube.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Loading...

Coin Marketplace

STEEM 0.31
TRX 0.11
JST 0.034
BTC 66765.98
ETH 3234.00
USDT 1.00
SBD 4.23