DEV Community

Cover image for dev.to Repo Recap from the Past Week
Andy Zhao (he/him) for The DEV Team

Posted on

dev.to Repo Recap from the Past Week

Welcome to the first edition recapping this year! We'll be covering from December 30 to January 5.

Features

No new features from the main repo! Although all improvements are features, right?

Bug Fixes / Other Contributions

@nickytonline laid the groundwork for getting Storybook to deploy when we build. Thanks, Nick!

@rhymes cleaned up a lot of issues from our rubocop_todo.yml file, a file that gathers all the linter errors from Rubocop. Check out the PRs below. Thanks, @rhymes!

@link2twenty is continuing to add CSS variables for dark mode. Thanks, Andrew!

@tensai updated our footer and a profile placeholder from 2018 to 2019. Thanks, @tensai!

@joeventures made the hardcoded 2019 dynamic. Thanks, @joeventures!

@arun refactored several small bits of code. Check out the PRs below. Thanks, @arun!

@jess made some additions to our internal tooling, which will help us manage user roles better.

@maestromac fixed a small bug where lists were not rendering for tag widgets.

@abraham removed a line that was used for debugging. Thanks, Abraham!

@ben removed an unnecessary private keyword.

New Issues

@antogarand suggested a Stack Overflow Liquid tag. Thanks, Antony!

Suggestion: Stack Overflow liquid tag #1419

Is your feature request related to a problem? Please describe. I just noticed we don't have a liquid tag for stack overflow questions or answers while trying to embed one of these on my post.
It could be a nice addition considering the developer-focused website.

Describe the solution you'd like Using {{ SO stackoverflow-url }} or a similar syntax to embed a stackoverflow question or answer into the post.

Additional context One thing to consider while doing this feature is all of the different subdomains on the stackexchange website.
Here is a website listing most of the different domains / communities there are: https://stackexchange.com/sites

From a quick glance, it seems the following domains are valid:

The last two are subdomains: Any stackexchange subdomain, and apparently few language-specific stackoverflow subdomains.

The variety of domains means we can't only use {{ so [post-id] }} as syntax, as we won't know where to fetch the ID from.
Perhaps we could use a simplified syntax of {{ so [id] [Opt: Q or A] [Opt: Domain] }}
Where the default mode would be Question and Stackoverflow.com, but they can be overwritten by the user-specified values.

Here are few sample valid URL formats for:

Questions https://math.stackexchange.com/q/12186 https://math.stackexchange.com/questions/12186 https://math.stackexchange.com/questions/12186/arc-length-of-b%c3%a9zier-curves https://math.stackexchange.com/q/12186/anything

Answers https://math.stackexchange.com/a/64769 https://math.stackexchange.com/a/64769/anything

@hardy613 reported that ES6 string literals don't work. Thanks, Scott!

Runkit - ES6 Template Literals do not work on dev.to #1431

Describe the bug When writing the markup for a dev.to post using runkit for code examples template literals (backticks `) are stripped out.

To Reproduce Steps to reproduce the behavior:

  1. Go to dev.to
  2. Click on write a post
  3. add
const test = 'test everything everywhere'
const str = `this is a ${test}`
console.log(str)
Enter fullscreen mode Exit fullscreen mode
  1. Click on preview to see error (image attched) _error-1

Expected behavior template literals used in dev.to's runkit embedded environment to be supported Here is an example from runkits demo page screen shot 2018-12-31 at 11 46 33 am

Screenshots Markdown: _error-2

Result: _error-1

Expected: screen shot 2018-12-31 at 11 46 33 am

  • OS: MAC
  • Browser: Chrome
  • Version: Version 71.0.3578.98 (Official Build) (64-bit)

Additional context The bug was discovered while updating a post as a request PR here: https://github.com/shardy613/es6-notes/pull/13

@raymondcamden reported that he sometimes is notified that he has a new notification, and then checking the notifications page shows no notifications. Let us know if you are experiencing this as well in the issue. Thanks, Raymond!

Notifications are blank #1438

Describe the bug The first time I hit the site in a day, I'll see a notifications count. I click to load them, and I always get a blank page (to be clear, page UI is there, just no content). Example:

image

If I get a notification while browsing the site though, it works correctly.

To Reproduce Steps to reproduce the behavior:

  1. Notice you have notifications waiting.
  2. Click on the bell icon

Expected behavior A list of notifications.

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows 10
  • Browser Firefox
  • Version 64

@raymondcamden also reported that sometimes the RSS feed takes too long to pull in an article.

RSS feed no longer working for new articles #1439

Describe the bug I have dev.to setup to suck new articles in from my feed (https://www.raymondcamden.com/feed_full.xml). At some point this stopped working and no longer picks up new articles. I also tried editing my settings and saving to force a refresh, but it didn't help.

@bnb raised the feature of having a decent embed for DEV posts to be used for outside of dev.to. Thanks, Tierney!

HTML Embeds for Dev.to posts #1445

bnb avatar
bnb posted on

Describe the solution you'd like: I'd like to see HTML embeds in addition to social sharing, along the lines of how you can embed Tweets or YouTube videos with simple HTML (plus a script or iframe, respectively).

Describe alternatives you've considered:

  • Adding oembed, Embedly, etc.
    • Isn't viable for every site, especially not ones that I contribute to but don't own.
  • Hand coding a pretty embed
    • Not enough of a reason on the user end to do this.

Additional context: Would love to include a pretty dev.to embed in a blog post that is being posted in a couple days but unfortunately it doesn't currently exist.

@abraham reported a bug where code blocks have an extra line break when headers are used after a code block. Thanks, Abraham!

Code blocks get breaks added between each line #1446

Describe the bug Code blocks sometimes get breaks <br> added between each line. You can see it in the one codeblock on A month of Flutter: a look back. It appears to be related to having headers following the code blocks.

To Reproduce

Go to create a new post enter the following markdown and hit "preview".

~~~
function hello() {
  console.log('hello');
}
~~~

~~~
function goodbye() {
  console.log('goodbye');
}
~~~

# header

Expected behavior

The code blocks should not have any blank lines between each line of code.

Screenshots

Correct display when # header is not included:

screenshot from 2019-01-02 14-17-11

Incorrect display when # header is included:

screenshot from 2019-01-02 14-17-00

Desktop (please complete the following information):

  • OS: Ubuntu 18.10
  • Browsers:
    • Chrome 72.0.3626.28
    • Firefox 64.0

Additional context

The broken display only appears to happen when a header follows the code blocks. If I move it between or before the code blocks the breaks don't happen. I'm using v2 of the editor and have not tested with v1.

@abraham also requested a "post linter," which could help check for duplicate titles, images without alt text, and other goodies.

Post linter #1449

Is your feature request related to a problem? Please describe.

Sometimes posts have simple mistakes like no syntax highlighting.

Describe the solution you'd like

It would be nice if there was some markdown linting happening in the post editor that would suggest improvements to your post. A few issues that it might be useful to highlight with a linter:

  • Code blocks without language tags
  • Duplicate title of an existing post
  • Missing tags
  • Images tags with relative paths
  • Images without alt text
  • The same image alt text used multiple times
  • Things that could be liquid tags like GitHub/Twitter links

@artemix reported an endless loading issue. Ben commented it's most likely because of a Pusher script staying open.

Infinite load #1458

I tried on a fresh and clean guest Firefox profile

Describe the bug

When I hard-refresh the page sometimes (needed due to my dead-slow internet), the page is kept in "loading" state, most likely a keptalive request that's forcing the tab state to "loading".

To Reproduce

I sincerely can't find any reproduction context, but the situation I'm in when this happens is the following:

  • slow internet (<200kBps)
  • dev.to as pinned tab
  • hard-refresh (cache clean/etc)

Expected behavior

Should load base assets and done.

Screenshots

Screenshot showing tab in loading state while the website looks and feels ready.

Desktop (please complete the following information):

  • OS: Reproduced on Windows 7, 10, Manjaro 17, ArchLinux
  • Browser: Firefox
  • Version: 62 to 64

DEV-related Liquid tags sometimes render improperly.

DEV-related Liquid tags improperly render text sometimes #1459

Bug Report

user, tag, and link Liquid tags, when used in certain contexts, do not render text properly.

For example, with these two Markdown examples:

Isn't {% tag discuss %} about that?
# or 
Isn't {% tag discuss %}
about that?
Enter fullscreen mode Exit fullscreen mode

Will render something like:

image

The issue is that the about that? is not being wrapped with a <p> tag, but has a line break <br> immediately after the Liquid tag <div>.

I tested this with the CodePen tag and that worked out okay.

A temporary fix is to add an additional line after using the DEV-related Liquid tag:

Isn't {% tag discuss %}

about that?
Enter fullscreen mode Exit fullscreen mode

@bgadrian requested a feature where you can allow anyone to message you via Connect. Thanks, Adrian!

Feature request: Open connect/inbox #1460

Is your feature request related to a problem? Please describe.

I cannot be contacted using Dev.to Connect private messages.

Describe the solution you'd like

I would like a checkbox to allow anyone from the community to contact me, similar with the open DM on twitter.

Describe alternatives you've considered

Larger emphasis on my email address on the profile page.

@rhymes requested a feature to export your comments. Thanks, @rhymes!

Export comments #1461

Is your feature request related to a problem? Please describe.

Now that dev.to has the option to export posts I think it's time to think about adding comments to the zip file.

I'm opening this issue to see if comments should be added and if so, how and with which attributes

Describe the solution you'd like

Comments have their own attributes but they're also part of a tree structure. Should the notion of the parent be part of the export? In which way?

It should also be decided which attributes are part of the exported JSON.

These are the attributes of the comment:

  create_table "comments", id: :serial, force: :cascade do |t|
    t.string "ancestry"
    t.text "body_html"
    t.text "body_markdown"
    t.integer "commentable_id"
    t.string "commentable_type"
    t.datetime "created_at", null: false
    t.boolean "deleted", default: false
    t.boolean "edited", default: false
    t.datetime "edited_at"
    t.string "id_code"
    t.integer "markdown_character_count"
    t.integer "positive_reactions_count", default: 0, null: false
    t.text "processed_html"
    t.integer "reactions_count", default: 0, null: false
    t.boolean "receive_notifications", default: true
    t.integer "score", default: 0
    t.integer "spaminess_rating", default: 0
    t.datetime "updated_at", null: false
    t.integer "user_id"
    t.index ["ancestry"], name: "index_comments_on_ancestry"
  end
Enter fullscreen mode Exit fullscreen mode

DEV-iOS Summary

The iOS repo wasn't covered for a while, so here is a summary of the contributions from November 19 to Jan 5:

@ceri_anneblog refactored the decidePolicyForNavigationAction function. Thanks, @cerianne_blog!

@ben added universal link functionality.

@striderHND also made several PRs. Thanks, Erick!

And one issue by @striderHND. Feel free to chime in!

Behavior-driven development Automated Test Proposal #113

Hello,

As for looking into the future of the project for the iOS development of the dev.to app, I really like to bring to the table what direction we should take as far as case testing for new functionality or the current code base for the app.

There is XCTests, Xcode native Case Testing Tool its pretty great but it takes some time to learn if you are new to native iOS development.

And there is Quick this is more friendly to those are more related to javascript development it's pretty similar to (JEST / Chai) and have pretty nice features that would make to make testing more easy. here is the installation guide if you wanna make some tests

I would really like to discuss what coverage percent should be acceptable (I would like to propose that 90% it's a good threshold, 100% is desired)

And any other rules should be applied how the test should be wrote and structured.

Any other proposals are welcome!

Thanks for reading!

Top comments (4)

Collapse
 
andy profile image
Andy Zhao (he/him)
Collapse
 
itsasine profile image
ItsASine (Kayla)

@maestromac fixed a small bug where lists were not rendering for tag widgets.

I KNEW IT!

I'm pretty particular about Markdown formatting, but it was bugging me that I couldn't get bullets to work on the sidebar. I assumed it was just me messing up, though. I even whined in Tag Mods chat about it!

Mac's my new hero. Now I have to go pay attention to my tags again :P

Collapse
 
andy profile image
Andy Zhao (he/him)

@maestromac you are now a hero!

Collapse
 
maestromac profile image
Mac Siri

This comment made my day.