Auto-tidying
perltidy since 2019, buuuuut I am terrible at remembering to manually do it, so! I threw together a quick'n'dirty way of automatically running tidy on commit. It's based on this example from the Prettier docs (Prettier is like perltidy but for CSS/JS/HTML).Here's the perl variant of the script:
#!/bin/sh FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g') [ -z "$FILES" ] && exit 0 # Prettify all selected files echo "$FILES" | xargs tidyall # Add back the modified/prettified files to staging echo "$FILES" | xargs git add exit 0
This also has the bonus that it only tidies files you added to your commit, so you don't end up with rogue changes in files you didn't touch because someone else forgot to tidy before a branch got merged!
EDIT:
.git/hooks/pre-commit, and that file needs to be executable, which you can do on the commandline by running chmod +x .git/hooks/pre-commitcode push happening sometime this week
We're not sure yet exactly when, but sometime in the next few days, we'll do a code push!
You can see what's new in the code tour that was posted earlier today, but here are the highlights:
- Google Analytics v4 support
- adding the legacy RTE to the beta Create Entries page
- adding draft autosave to the beta Create Entries page
- more UI improvements for the beta Inbox
- some more aggressive measures for discouraging SEO spam accounts
- miscellaneous modernization updates for various journal styles
- many newly added sites for profile links, content embeds, and username styling
- new color picker for the journal style customization page
- new CSS wrappers to allow styling of entry cut links
alierak just pushed these changes to the canary server if you want to get a head start on checking out what's new! Feel free to leave a comment here if anything looks weird, or chat with us on our Discord server.
Code Tour (2023-03-04 to 2023-06-25)
It is time for a code tour again, and I'm the fool that volunteered to do it! (I'm pretty sure the devs would almost prefer I didn't, because I have to ask so many questions, but it's kind of fun anyway. Part of the time, I even learn things!)
Our amazing devs have been hard at work to make things better for everyone, here are some of the recent/upcoming changes for your perusal!
( so many fixes! )
58 total issues resolved
Contributors:
And warmest of welcomes to new contributor
Current Code Contributors: June 2023
In general, one commit on Github equals one point in the "Changes" column, but fractional points are awarded for collaborative efforts — the most common example being a new S2 theme, where usually half credit is awarded to the theme author and the other half to the person who converts the theme into a code patch. Due to the nature of development, some changes are massive contributions of new code, and others are tiny tweaks; there is no correlation with the amount of effort involved. We are grateful to everyone who helps to improve Dreamwidth, in ways large or small.
I last compiled this list in January of 2023. Since that time, we have welcomed
# User Changes Latest 1. momijizukamori 340.16 Tue May 30 22:46:02 2023 UTC 2. kareila 1582.5 Wed May 17 02:26:13 2023 UTC 3. mark 806.5 Thu Apr 06 05:51:43 2023 UTC 4. vivtek 1 Mon Feb 13 18:48:36 2023 UTC 5. alierak 51.5 Tue Nov 22 17:06:04 2022 UTC 6. alansill 2 Tue Nov 22 15:47:35 2022 UTC 7. chebegeek 3 Wed Oct 26 01:30:42 2022 UTC 8. rmholsen 1 Fri Jun 17 19:28:18 2022 UTC 9. batrachian 19 Mon Jan 17 19:44:30 2022 UTC 10. martindemello 4 Thu Aug 12 04:59:14 2021 UTC 11. roadrunnertwice 416 Sun Feb 28 04:09:21 2021 UTC 12. pinterface 18 Sat Jul 11 03:07:04 2020 UTC 13. alexwlchan 5 Sun May 26 04:56:47 2019 UTC 14. allen 64 Mon Apr 29 17:10:26 2019 UTC 15. srukle 13 Wed Dec 19 03:35:50 2018 UTC 16. darael 10 Sun Dec 09 01:41:18 2018 UTC 17. swaldman 86 Sat Jul 21 04:13:07 2018 UTC 18. kaberett 56.5 Sun Jun 17 18:46:15 2018 UTC 19. chrisboyle 18 Sun Jun 17 18:11:05 2018 UTC 20. pauamma 150 Sat Jan 20 17:42:28 2018 UTC( The rest of the list... (168 total) )
Question thread #122
The rules:
- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer and in this comment thread.
Question thread #121
The rules:
- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer and in this comment thread.
CSS Facelift
I'm not sure if this is the right place to post and/or inquire about this, so feel free to correct me if I'm straying where I do not belong.
I was wondering, are there any plans for a visual "uplift" (so to speak) with the site's CSS and mobile compatibility?
I have made the decision to leave LiveJournal, but I am admittedly a bit sad that I had to leave that slick-looking interface over there behind. Not bashing at all, I'm vastly more appreciative of DreamWidth and everything it stands for. And I also realize there are way more important issues that must be worked on. Just wanted to see if anything is in the works. TIA!
Question thread #120
The rules:
- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer and in this comment thread.
A wild code tour appears (for 2022-10-22 to 2023-03-04)
A lot, actually! Some old hands and some new people have been very busy about making things better! Soon (hopefully) all of this will go live and things will be even better around here!
( bug fixes, code machete, site improvemets and cruft banishing below )
32 total issues resolved
Contributors:
To the people who actually do the work, if I got anything wrong after all the help, please let me know and I'll edit!
Question thread #119
The rules:
- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer and in this comment thread.
Question thread #118
The rules:
- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer and in this comment thread.
Current Code Contributors: January 2023
In general, one commit on Github equals one point in the "Changes" column, but fractional points are awarded for collaborative efforts — the most common example being a new S2 theme, where usually half credit is awarded to the theme author and the other half to the person who converts the theme into a code patch. Due to the nature of development, some changes are massive contributions of new code, and others are tiny tweaks; there is no correlation with the amount of effort involved. We are grateful to everyone who helps to improve Dreamwidth, in ways large or small.
I last compiled this list in September of 2022. Since that time, we have welcomed
# User Changes Latest 1. mark 804.5 Tue Nov 22 17:16:58 2022 UTC 2. kareila 1579.5 Tue Nov 22 17:08:52 2022 UTC 3. alierak 51.5 Tue Nov 22 17:06:04 2022 UTC 4. alansill 2 Tue Nov 22 15:47:35 2022 UTC 5. momijizukamori 332.16 Fri Nov 18 23:38:23 2022 UTC 6. chebegeek 3 Wed Oct 26 01:30:42 2022 UTC 7. rmholsen 1 Fri Jun 17 19:28:18 2022 UTC 8. batrachian 19 Mon Jan 17 19:44:30 2022 UTC 9. martindemello 4 Thu Aug 12 04:59:14 2021 UTC 10. roadrunnertwice 416 Sun Feb 28 04:09:21 2021 UTC 11. pinterface 18 Sat Jul 11 03:07:04 2020 UTC 12. alexwlchan 5 Sun May 26 04:56:47 2019 UTC 13. allen 64 Mon Apr 29 17:10:26 2019 UTC 14. srukle 13 Wed Dec 19 03:35:50 2018 UTC 15. darael 10 Sun Dec 09 01:41:18 2018 UTC 16. swaldman 86 Sat Jul 21 04:13:07 2018 UTC 17. kaberett 56.5 Sun Jun 17 18:46:15 2018 UTC 18. chrisboyle 18 Sun Jun 17 18:11:05 2018 UTC 19. pauamma 150 Sat Jan 20 17:42:28 2018 UTC 20. hotlevel4 54 Mon Jan 01 23:33:48 2018 UTC( The rest of the list... (167 total) )
Question thread #117
The rules:
- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer and in this comment thread.
Question thread #116
The rules:
- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer and in this comment thread.
Question thread #115
The rules:
- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer and in this comment thread.
new canary server
Right now, the people who can deploy to canary are (I believe) the same people who can merge code changes - so me,
Right now the only way to be notified when a canary deploy happens is to monitor the #commits channel on our Discord server. I'll try to remember to post here if a canary deploy happens that looks like it will take a while to migrate to the stable server. At the moment, canary and stable are identical.
If you have any questions or comments about how the canary impacts our development workflow, please share them here!
If you have any questions or comments about how turning on the canary impacts your use of the site, please share those on the
Cool? Cool.
just sit right back and you'll hear a code tour (2022-10-09 to 2022-10-22)
( Read more... )
21 total issues resolved
Contributors:
GitHub repository rename and updates
Hi all!
As of today, I've made a few fairly broad changes to the way our repositories are set up. You will need to likely make some changes to your development workflow. But! They should be simple.
First, the changes:
The
dw-freerepository has been renamed todreamwidth-- because,The
dw-nonfreerepository is no more, it has been merged into thedw-freeunder the pathext/dw-nonfree/.Finally, the
masterbranch has been renamed tomain.
These two changes mean that no more do we have to track and coordinate changes across two repositories, they can be done atomically in one place. Since we don't really support or test running Dreamwidth on its own (without the branding) this will also allow us to simplify development by ultimately collapsing the code, too.
To update your checkout of Dreamwidth, you will need to do two separate things. First, go to Github and to your existing dw-free repository, go to the settings and:
Rename the repository to
dreamwidthGo to branches and rename the
masterbranch tomain
Once that's done, you need to update your local checkout like this:
cd $LJHOME
# WARNING: Only do this if you have no code here that you care about!
rm -rf ext/dw-nonfree
# Update the repository root (for your "origin" remote, **set your username here**)
git remote set-url origin git@github.com:YOUR_GITHUB_USERNAME/dreamwidth.git
# Update the repository root (for your "upstream" remote, please change as needed)
git remote set-url upstream git@github.com:dreamwidth/dreamwidth.git
# Fetch only to get the new main branch
git fetch
# Switch over to it
git checkout main
# Get rid of local master
git branch -d master
# Redirect HEAD
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
That's it; you should be good to go now. I'll work on updating the Dreamhack scripts shortly, but wanted to get these instructions out. Please let me know if you have any questions/comments/issues.
Code Tour (2022-05-07 to 2022-10-08)
Issue 145: Add site scheme name as a body tag class (pull request) (nonfree pull request)
Category: Fun Browser Tricks, Accessibility, User scripts
Patch by:
Description: This makes it easier for folks who like to modify their browser's display of websites to make site-skinned Dreamwidth pages do interesting and/or accessibility-customized stuff.
Issue 686: Add 'Indexed' style by wiring
Category: Closed but not done, Tidying Extremely Old Issues
Patch by: n/a
Description: This style was withdrawn (maker was still working on it, may have submitted it through another ticket when finished)
Issue 689: Add 'Suit Yourself' style by flamingchemist
Category: Closed but not done, Tidying Extremely Old Issues
Patch by: n/a
Description: Momiji was going through and found that some crucial components to add this just weren't there.
Issue 1856: CSS in Tabula Rasa overrides height attribute in IMG tag
Category: Rendered Obsolete, Tidying Extremely Old Issues
Patch by: n/a
Description: Momiji says: "We've updated the code handling image resizing in entries and comments, so I'm going to close this as any current issues are most likely something exciting and new."
Issue 1890: issues with various site elements on Windows phone
Category: Rendered Obsolete, Seven Years Is Basically Dead in Electronics Years, Tidying Extremely Old Issues
Patch by: n/a
Description: When someone with a Windows phone has a problem with this again, these issues can be revisited.
Allowing Embeds:
Peertube on stopthatimp.net: domain no longer hosting
Allowed: Blogtalk, Podomatic, Streamable, getyarn.io, Smugmug, MSNBC, Reddit
( 8 Embed tickets )
Issue 2711: update Github user profile icon to HTTPS (pull request)
Category: HTTPS everywhere
Patch by:
Description: The SSL proxy will now do the right thing with Github's little site icon.
Issue 2887: allow <details> and <summary> elements in comments (pull request)
Category: Spoiler handling, HTML5 my beloved, Overenthusiastic HTML cleaner
Patch by:
Description:
HOLY WOW THIS WORKS IN COMMENTS NOW
The DW/LJ/spoiler cut has been amazing for entries since it came out on LJ, and HTML5 only<details>
<summary>Spoiler warning</summary>
Spoiler details go here! Go wild!!!! IT'S LIVE NOW!!!!!!
</details>
Issue 2902: the password length in the "change email" form needs to be larger
Category: Making things make sense, 72 is bigger than 50
Patch by:
Description: Dreamwidth allows quite a bit of annoyance to anyone who might want to crack your passwords. (Usually the value to a hacker of any random person's online presence is your good search engine reputation, and they can sell your login to spammers who dearly want search engines to pick up their bad links.) It would also be good to be able to change your stale or potentially compromised password to something of an equally obnoxious length, but prior to the new year's code push, the maximum the form allowed was 50 characters, instead of 72 like it ought to have been. Please look into using a password manager, which will remember unique and random character passwords for all of your logins, in a way that storing them in your brain maybe won't.
Issue 2949: convert /manage/banusers to TT (pull request)
Category: The Great Template Toolkit Conversion, Resisting the urge for a complete rewrite
Patch by:
Description: Yet another page converted away from Brad's Markup Language. Momiji says: "Part of the ongoing crusade eliminate BML from the codebase! One page down, many more to go..."
It's not that we hate it as such, but sometimes things move or look different and generally that's no fun even when it's attached to necessary fixes.
Issue 2951: Fix send-email working on dreamhacks (pull request)
Category: Developers need love too, A Strongly Worded Letter to Cloudflare
Patch by:
Description: Momiji says: "When we moved email notifications to AWS, we accidentally broke email sending from DreamHacks, because the AWS mailer uses some options sendmail on the hack box does not. This now checks if those options are set before trying to use them, and skipping them if not."
Issue 2952: Add a link for Discord to contrib docs (pull request)
Category: The Wheel of Time turns, Discord, dev communications
Patch by:
Description: Momiji says: "We moved to using Discord for dev communication rather than IRC, but this was not linked anywhere helpful in the repo itself. This has now been fixed!"
One of the hard problems in online communication is moderation and platform management. IRC in particular is hard to keep as open to new people looking for a little help with development, while still keeping out the people who would prefer to fill it with rude appendages and worse. It also helps to have a platform that people are comfortable using. And these days the sweet spot seems to be Discord.
Issue 2953: Convert /tools pages to TT (pull request)
Category: The Great Template Toolkit Conversion
Patch by:
Description: See a BML page, fix a BML page.
Issue 2958: <details>/<summary> tags have no styling in sitescheme
Category: CSS hijinks, HTML5 my beloved
Patch by:
Description: The little sideways triangle that accompanies a cut tag also accompanies the <details> tag, except the CSS was taking that away on site themed pages. Momiji: "Which is very silly in this case, and once I'm sure it won't make other bits of the site layout go haywire I'm gonna see about fixing that."
Issue 2959: Restore ability to apply user CSS to siteschemes (pull request)
Category: Accessibility, Fun Browser Tricks, Technically it's "site skin" but it was site scheme on LJ soooooo...
Patch by:
Description: Adds a class to body tags for Tropospherical Red & Purple, on Foundation pages. Or, if you were trying to use a userscript and it was failing on some pages for no good reason, try again?
Issue 2964: Don't override browser display for details and summary (pull request)
Category: #2958, Browser hijinks, HTML5 my beloved
Patch by:
Description: Momiji says: "The
details HTML element is basically a nice little native expand/collapse that allows you to hide and unhide blocks of text. By default, browsers usually style it with a little arrow at the side to indicate that it can be expanded and collapsed. We, however, had some CSS fixes for old browsers (IE and very old versions of Firefox) that didn't support this newer element - which were probably added when those browsers weren't super old and it was actually a good idea - that caused the arrow to vanish entirely for all browsers. Very silly. Now that we are in the future, those workarounds can be removed!"Issue 2965: Protected foundation (pull request)
Category: The Great De-BML-ening, Foundation
Patch by:
Description: Momiji says: "More dragging of pages into the 21st century! Note: this does move OpenID login one click away on the page - this choice was made to better match the regular login modal, to make the design more visually balanced, and because the standalone OpenID page has a better explanation of what OpenID is and how to use it."
Issue 2970: Add Beta flag for new inbox redesign (pull request)
Category: Beta Testing, Inbox Update
Patch by:
Description: Momiji says: "After we accidentally pushed the inbox update live without planning to, and got a bunch of feedback, we realized we uhhhh should probably make it a beta, until we get all the bugs ironed out, as it's a pretty major rewrite of the code."
Here's the
Beta features page
Issue 2978: Tweaks to the new inbox design (pull request)
Category: Beta Testing, Inbox Update
Patch by:
Description: Round one of tweaks to the new inbox design, based on user feedback!
- Unread items are now expanded by default
- Fixed bad word-wrapping settings
- Added a touch of margin to timestamps so they don't run up right against subject lines
- Added the 'unsent' filter view back in.
- Add controls back to the bottom of the message list
26 total issues resolved
Contributors: