Threads for djm

  1. 13

    I’d go as far as saying black made the code review process enjoyable again. Gone are the distracting, futile conversations about whether a space was really necessary in that particular position, to be replaced by concentrating on the actual abstractions and patterns of code - which is what code review is great for alongside education.

    black actually saw through PEP8’s original goal in a much better way than PEP8 itself.

    As an aside, another advantage I haven’t frequently read about: having a known formatting style across the codebase also makes searching for specific syntax trivial. You can be assured that wherever this syntax occurred, it will look exactly like you predicted..super handy in refactoring.

    Congrats on “v1” 🎉

    1. -1

      For weeks I’ve been avoiding Twitter (and hence spending more time reading articles from Lobste.rs) because of the flood of Wordle garble that took over my timeline. Thank you, thank you for bringing that scourge here too. Now excuse my while I turn off the electricity and hide under a tinfoil blanket…

      1. 31

        If it’s bothering you, you should use the Twitter mute words feature to filter the words [wordl, wordle] from your timeline. It’s actually fairly competent at doing it given the sharing mechanic is identical for all.

        1. 27

          what’s wrong with wordle? It’s a tiny, free game made by one guy. It’s totally harmless.

          1. 5

            it’s noise

            1. 18

              No. The word was “wince.” Stop trying to spoil it for others. :)

              1. 29

                Of all the things advertised and hyped on the internet, please explain how a small web app with no ads, no accounts, which is straight-up fun and tickles your brain cells is “noise”?

                1. 3

                  If you have absolutely zero interest in it, yet seemingly everyone’s posting about it and it becomes unavoidable wherever you go online, it becomes noise.

                  1. 5

                    It must be very annoying to browse the web then, because by that definition almost everything is noise.

                    1. 1

                      Only when [something you have zero interest in, but also zero possibility of filter/blocking] gets posted in all your social places. Over and over again.

                  2. 3

                    The tweets are a bunch of gray/yellow/green squares. They are perhaps less annoying than ads, but if enough of the accounts you follow tweet about their wordle progress daily, it can overtake your timeline with meaningless squares. The game itself is harmless, but the social media trend can be irritating.

                    1. 5

                      Twitter is so much more enjoyable when you start blocking. In this case blocking the word “wordle” should suffice.

            1. 2

              Consider allowing searching via POST, so that the search string is not sent to sites via referrer URL.

              1. 3

                I disagree in this instance, only because a linkable result set is extremely helpful. These days we have the Referrer-Policy header to better control what is leaked.

                1. 2

                  i think the request is to allow it, not making default. you can receive GET and POST at the same address.

                2. 2

                  Is there a downside of using rel=noreferrer instead? https://html.spec.whatwg.org/multipage/links.html#link-type-noreferrer

                  Some pages that uses POST over GET make it very annoying to go backwards, prompting for a ‘do you want to submit the form again’ kind of alert.

                  1. 2

                    i think gp was talking about allowing it as an option, not making it default?

                1. 1

                  I don’t exactly get what 3.0 adds, since Channels and Daphne existed for a while, and were part of the Django project.

                  I wish they made the ORM fully async, but that would be too breaking of a change.

                  1. 5

                    If you meant in the sense that you were expecting more features from a major version bump then the version bump comes from their release cadence & deprecation policy (new since v2) which sees the major version bumped for the first version after every LTS release (which 2.2 was).

                    But if that wasn’t what you meant, then this talk by Andrew Godwin (PyconAU, Aug ‘19) gives a much deeper description of what’s going on under the hood to pave way for more exciting async features. v3 is laying the foundations.

                    1. 3

                      Personally, the two things I’m excited about in this release are:

                      • Exclusion constraints. So many things get easier to model and validate with them.
                      • The support for choice enums. This seems like a small thing, but it’s really a huge quality-of-life improvement.

                      Plus the end of the Python 2 compatibility shims, because that’s a reminder of how close I am to finally getting to write modern Python in the Django apps I distribute.

                      1. 1

                        Making the ORM fully async is also next to impossible without a herculean amount of work because all of the database libraries would have to be modified to support async as well.

                        There’s a really good talk (by the creator of Daphne) that was given at DjangoCon this year (https://www.youtube.com/watch?v=d9BAUBEyFgM) about the challenges of retrofitting async-await into django and plans to get there.

                        1. 5

                          Zzzeek (the creator of SQLAlchemy) wrote a very detailed blog post a few years ago about how everyone thinks they want async for their ORM, but it’s really not that great of an idea:

                          https://techspot.zzzeek.org/2015/02/15/asynchronous-python-and-databases/

                          1. 3

                            Making the ORM fully async is also next to impossible without a herculean amount of work because all of the database libraries would have to be modified to support async as well.

                            Also, I’m not too sure if a fully async ORM would be worth the effort. Sure, it might be an improvement, but if your database queries are taking so much time that they need to be async’d, maybe it’s time to optimize some queries.

                        1. 3

                          In this example, the assignment expression helps avoid calling len() twice:

                          if (n := len(a)) > 10:
                             print(f"List is too long ({n} elements, expected <= 10)")
                          

                          Um, no it doesnt?:

                          a1 = [10, 20, 30]
                          n1 = len(a1)
                          if n1 > 2:
                             print(f'{n1} is greater than two')
                          

                          https://docs.python.org/3/whatsnew/3.8.html

                          1. 2

                            But it helps you avoid calling len() twice with one less line! Readability ∝ 1 / source.count('\n').

                            With this change we’re one step closer to finally reaching Perl’s level.

                            1. 2

                              I guess it’s about the scope of the variable, as in Go:

                              if n := len(S); n > 0 {
                                fmt.Println(n, "characters long")  // n defined inside if statement
                              }
                              // n undefined here
                              
                              1. 2

                                Just for others reading this: it’s sadly not. n would still be defined after the conditional block. I assume it doesn’t work like that as Python doesn’t really have that level of scoping elsewhere (for loops leak too, etc).

                                1. 1

                                  Wow, I just tested it and you’re right.

                                  Then I guess it’s only about convenience, but isn’t “sparse better than dense” and “simple better than complex”?

                              2. 1

                                It’s a shame they didn’t put the code that it was compared to:

                                if len(a) > 10:
                                   print(f"List is too long ({len(a)} elements, expected <= 10)")
                                

                                Both are 2 lines; your 4-line alternative also leaves extra variables lying around.

                                1. 0

                                  Both are 2 lines; your 4-line alternative also leaves extra variables lying around.

                                  So? Do you really think less lines is always more readable? How about now?

                                  v1 = ((((n1 + n2) - n3) * n4) / n5)
                                  

                                  I would rather have something like this, even though its more lines and more variables:

                                  v1 = n1 + n2
                                  v2 = v1 - n3
                                  v3 = v2 * n4
                                  v4 = v3 / n5
                                  

                                  Sometimes readability is more important than lines or variables. Not everything is code golf.

                                  1. 4

                                    Okay, but you’ve introduced 3 additional variables here. I can imagine it’s possible to confuse v3 and n3 because the names are so similar. Also, you don’t need that many parenthesis.

                                    v1 = (n1 + n2 - n3) * n4 / n5
                                    

                                    because + and - have the same operator precedence, so they’re evaluated in the order of their use. Later, * and / also have the same precedence so another pair of parenthesis can be removed. I think this 1 line is more clear than 4 lines.

                                    But I understand your point, less lines not always is better than more lines.

                                    1. 2

                                      Do you really think less lines is always more readable?

                                      No, I’m just comparing like for like. The intent of the quoted

                                      the assignment expression helps avoid calling len() twice

                                      was, in my eyes, to make a comparison with the code snippet that I posted, and not with anything else.

                                      1. 0

                                        So?

                                        So scope matters, a lot. In a toy example it’s easy to dismiss this stuff, but scoping your variables as tightly as possible means simplifies all future modifications and refactorings in real-world code, because you’ve minimized the “world” that can be potentially impacted by any changes to the variable or its assignment.

                                        Scoping n to just the loop its intended to be used in is strictly preferable to having it visible (and available for misuse) in all code in the outer scope after the loop.

                                        1. 8

                                          The version with := leaks n too.

                                          >>> a = [1,2,3,4]
                                          >>> if (n := len(a)) > 10:
                                          ...     print(f"List is too long ({n} elements, expected <= 10)")
                                          ... 
                                          >>> n
                                          4
                                          
                                          1. 5

                                            Wow, that’s a disappointing choice

                                            1. 3

                                              Variables in for loops are scoped similarly:

                                              >>> for i in range(43):
                                              ...     pass
                                              >>> i
                                              42
                                              
                                  1. 1

                                    Nice work on the site, I’ve signed up and will tell some friends.

                                    The programmer in me has to ask: why the restrictions on symbol input for the password field?

                                    Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

                                    1. 2

                                      I’ve used the standard django auth module which puts these restrictions.

                                      It’s mainly to have some compliance in how usernames look. While it’s certainly technically possible to have white spaces or emojis in usernames, things will get weird when you want to attach other systems (e.g. an email address for each user etc.)

                                      1. 1

                                        Oh, it’s the help text for the username field! Yes, that makes perfect sense. The layout of the register form on mobile made me think it was referring to the password field (the input gets bumped up), that’s why I asked. Anyway, nice work.

                                        1. 1

                                          Thank you!

                                    1. 4

                                      I have been using this forever in SASS but I have heard criticisms about it. Are there any reasons this feature would be bad?

                                      1. 2

                                        The largest user-facing downside of nesting is over-nesting which is classed under “feature misuse”; it is best avoided by sticking to a BEM-like selector pattern and restricting yourself to sensible levels of nesting (1 or 2 levels) in most cases.

                                        This lets you avoid writing overly-specific CSS, which in turn means you avoid unnecessary CSS bloat. The bloat comes because of a few reasons: overly-specific CSS is hard to reuse, which leads to repetition; and, to a lesser extent, the lengths of selectors can get extremely long and cause a lot of unnecessary work for the browser – in extra time to download, extra parse time, and more complicated application.

                                        In terms of browser’s implementation of this, the most worrying seems to be the possibility of combinatorial explosion which is already being discussed.

                                        1. 1

                                          The reason that this being tested as an issue is largely based on the amount of tags generated at the time of post-processing.

                                          With native nesting, I’d be surprised if this will be as popular as it is today.

                                          I may be biased, though. I think that BEM is bad in that it seems like someone wanted to make things flat because they didn’t understand how to make specificity work for them instead of against them.

                                        2. 1

                                          Well, the nesting present in SASS is more ambiguous than this, so I believe there are cases that other people dislike that ambiguity, but with native nesting we’ll have a chance for it to be designed in a much better way.

                                          Common criticisms of selector nesting are:

                                          • it can make doing the wrong thing (building long, brittle selectors) much easier
                                          • it totally changes the way CSS is read and written (which is no longer true if nesting is native CSS)
                                          • many CSS-parsing tools will choke on code with nested selectors

                                          Having a big change like this to CSS is going to break/change a lot of tooling that wasn’t originally designed to CSS’s syntax, but was instead built with an idea of what CSS was based on what it used to look like.

                                          I’m not a personal fan of preprocessors or nesting, but having it come to CSS natively is a big change, and will totally change the way most people will write CSS. Exciting times!

                                          1. 7

                                            What a strange article. Author lists every common benefit of REST and just disagrees with each one while providing no new information. “No it isn’t… no it doesn’t… that’s not true… nope, not that either.”

                                            If you want to design an RPC API and stick all your semantics into POST bodies talking to a single “/do” endpoint, fine. Personally, I much prefer to interact with a well-designed REST API like Github’s with its RFC-compliant URL templates, header-driven paging, cache semantics, and more.

                                            1. 4

                                              Have you used Github’s GraphQL API yet? Personally, I’ve found using it to be a breath of fresh air in comparison to their REST API, which was easily one of the best REST APIs I’ve used and leagues ahead of most implementations. Give it a go, the RPC-like mutations are particularly wonderful.

                                              1. 1

                                                Compliant with which RFC, exactly?

                                                1. 1

                                                  5988 and 6570 were the two I had in mind.

                                              1. 4

                                                The post doesn’t mention any results from this approach, do you have any?

                                                1. 3

                                                  I can’t publish actual results for obvious reasons, but it does find a few servers in a short time (~15-30 minutes maybe, I wasn’t paying attention to the terminal)

                                                  1. 1

                                                    Cool, that’s all I meant really. Can you say how many IPs you had to hit before finding those few? Or the average IPs per second? Thanks.

                                                  2. 2

                                                    Scanning the internet randomly in that way is not gonna lead to a lot of results, at least not in any reasonable time frame. If you instead look at sites that crawl the internet for a living, you get 17.000 results. Not all are actually Redis nodes and not all Redis nodes are completely open.

                                                    Attack vectors on Redis to compromise the whole system are known for quite some time, and Redis now has better defaults and a protected-mode by default. But people tend to not update it. We still reguarly have users coming into the IRC channel asking for help with cleaned/exploited Redis node.

                                                    I keep reminding people to not open up each and every service to the whole wide internet.

                                                    1. 2

                                                      Yeah indeed, that’s exactly why I asked for the results - I’m curious to see if they found a single one with this technique.

                                                  1. 7

                                                    Is this truly what the world has come to?

                                                    Productivoty gains by writing Dockerfiles, config and shell scripts, when any sane framework and/or standard library gives you the tools to mock things.

                                                    Like why would a local developer want redis?

                                                    Leave the hall.

                                                    1. 3

                                                      The idea is to have a dev environment that closely resembles your production environment.

                                                      1. 3

                                                        I think you should use a virtual machine for this, though. For instance, in the project I’m working on, I’m on Linux and the other two developers are on Macs so my understanding is that Docker won’t help.

                                                        1. 3

                                                          This is exactly where docker helps.

                                                          1. 2

                                                            My understanding is that software packaged by Docker still uses the host operating system’s libraries/etc. under the hood. Is this correct? If so, then it doesn’t seem like a solution as we’d be still running on different operating systems.

                                                            1. 2

                                                              Not at all. You can run a different district. Everything is duplicated and you only have the exact versions specified.

                                                              1. 2

                                                                I’m sorry, I mentioned libraries but this is not what I really had in mind. (I also assume that autocorrect changed “distro” to “district” in your reply). I’m concerned about platform-specific issues like path lengths, characters allowed in file names, kernel APIs, low-level system stuff (e.g. OOM killer).

                                                                If the problem statement is: developers (and production) use different environments then the solution would be to make them use the same environment. I use VMs to achieve that and my impression is that virtualized environments are closer to “identical” than containers.

                                                                1. 3

                                                                  characters allowed in file names

                                                                  Funny you should mention that. I ran into exactly this sort of a problem last week, where Docker, (which uses the host’s FS) couldn’t differentiate between files that differ only by case on MacOS’s case-insensitive-by-default filesystem. As a result, the state of my system running on Docker was significantly different from that on an Ubuntu machine, even with everything else (libraries, etc.) being the exact same.

                                                                  That being said, I still find Docker very useful for quickly spinning up an instance of something on my Mac. But in the future, I’ll think more carefully about where the abstraction ends and the host starts mattering.

                                                                  1. 2

                                                                    #needsmorevagrant

                                                      2. 1

                                                        Simply put: if environments don’t match, mistakes get made.

                                                        I’ve seen it time and time again - to give some examples: local dev using a mocked out in memory cache, prod using memcached/redis; or local dev using SQLite and prod using Postgres. Mistakes get made due to overlooking the differences between implementations.

                                                        No mock is as perfect as the real thing and it’s much nicer finding issues in development than at deploy time.

                                                        1. 2

                                                          Fire the dev and hire someone who knows integration testing.

                                                          1. 1

                                                            local dev using SQLite and prod using Postgres

                                                            I was in a similar situation (but with MySQL instead of Postgres). We were getting failure in production that we couldn’t reproduce in development. It seemed as if the program was trying to insert data into a column of the wrong type. This is how I learnt that SQLite does dynamic typing which is code for “we don’t care about column types”.

                                                            1. 1

                                                              Yep, it’s the same for testing. There are plenty of companies out there use in-memory SQLite databases with their test suite “for speed”, without realising they’re basically throwing type safety out of the window and making their tests effectively useless.

                                                              1. 1

                                                                “Boss, I wrote a program that does the wrong thing but does it really fast!”

                                                          2. 1

                                                            redis is not only a good replacement of memcached, it is a great pub/sub server, a leaderboard and has a geoip api. I need redis in development because I use redis to implement features that use the apis that redis provide.

                                                            On the other side, even if am not a huge fan of docker, docker is useful in many cases. For example I use Void Linux and OpenBSD as my desktop operating systems. In one of our client we store data in riak. riak is not available in Void Linux, neither in OpenBSD. Thanks to docker I can easily run riak in docker.

                                                          1. 6

                                                            Heroku is fantastic. In a previous startup, we used to be hosted in Heroku but we moved to Rackspace because of the costs. The app ended up being about 10% faster and the hosting costs a little lower, however we rapidly found ourselves in a position where we basically needed a full time devops person. That decision was too premature and it slowed us down.

                                                            Right now, I work for another YC startup and we’ve been hosted in Heroku for over 2 years now. The possibility to focus in development instead of devops is truly liberating. Our business isn’t maintaining updated linux boxes, or dealing with firewalls, but building features for our customers.

                                                            They say Heroku is too expensive only if you don’t value your own time. Amen to that.

                                                            1. 7

                                                              we basically needed a full time devops person.

                                                              This is exactly it, and why they can charge so much - I very much doubt a Heroku bill for a typical small company would ever grow larger than the annual salary of a decent ops engineer - and if it does, you know full well it’s time to move away! It would however be nice to have a little more comparable competition in the PaaS space. Heroku is simply king at the moment.

                                                            1. 25

                                                              Tag suggestion posts are rare. There’s been a bunch in the past day or two, but I can’t imagine the pace continuing.

                                                              1. 12

                                                                On IRC, spinda rued the fact that there was no ‘party pooper’ downvote option for your comment. I however appreciate your answering this post straightforwardly.

                                                                1. 9

                                                                  I did mean that as a joke, just so we’re clear…

                                                                  1. 4

                                                                    Is that a lobste.rs-specific IRC channel that I’m unaware of, or a general comment that it happened on IRC?

                                                                    EDIT: Well I never, completely missed chat in the bottom right.

                                                                1. 1

                                                                  As far as I’m concerned GenericForeignKey should have been deprecated long ago; I’ve dealt with so many projects that have leant on them early on in their lifetime only to realise it was a terrible idea. They then have to struggle to migrate large swathes of data without the help of actual constraints keeping their sanity. Nightmare fuel.

                                                                  1. 2

                                                                    Lovely little product that I would pay for, the trackreddit interface is abysmal.

                                                                    Tech wise though - is the reason you don’t support searching the entirety of Reddit a scaling issue? I ask because the global comment firehose seems to be freely available, so I’m wondering if there is a reason you don’t use that over selecting specific subreddits. Thanks!

                                                                    1. 4

                                                                      Thanks for the feedback!

                                                                      I built F5Bot in only a couple hours, so I didn’t do a lot of research or planning. It appears that the ‘comment firehose’ you posted doesn’t even go back one second in time. Is that right? I’m not sure how I could realistically use that without hitting Reddit several times a second, and even then I would miss a lot when Reddit goes down (which is often, I now know). Also, when I posted to Hacker News, a couple commenters mentioned Reddit API limits.

                                                                      So I just took the lazy/easy way by monitoring only the few subreddits that I actually cared about anyway. In this case, I can check back every couple minutes, and if sometime goes wrong I can check back even later without missing anything.

                                                                      Would this be substantially more useful to you if it pulled all of Reddit, instead of the current subset?

                                                                      It’s nice of you to say I could charge money for this. I think I’ll leave the current feature-set up for free. Realistically, it only took me a couple hours to build, so I don’t think it makes sense to monetize that. In fact, I was thinking about going the opposite way and open-sourcing it. I might add premium features in the future, but I’m not sure yet.

                                                                      1. 5

                                                                        Hey, we’ve documented some API rules here.

                                                                        You should use a unique user-agent as mentioned in the previous link. Also using OAuth will increase the rate limit to 1 qps. If you’re using PRAW, it’ll automatically handle rate limiting for you. If you have any more questions, feel free to reply here, post on r/redditdev, or PM me.

                                                                        1. 2

                                                                          Would this be substantially more useful to you if it pulled all of Reddit, instead of the current subset?

                                                                          Yes. Social Media monitoring is quite a large market: Mention, Hootsuite, etc but they all come with complex UI, reporting and cost quite a bit. There are a few in the cheaper “just notify me” space but the ones I have used have been fairly awful UI wise.

                                                                          As to hitting reddit every second, I had made the assumption you’d be doing that anyway - but yes, it would be worth reading around to find out what they deem acceptable.

                                                                        2. 2

                                                                          Just checked out trackreddit. You weren’t kidding about the interface! I guess maybe they were thinking to make it more powerful, but man, they did not optimize for the common use case at all.

                                                                          1. 1

                                                                            It actually works, but the email notifications send you to their mobile feed which has an ever worse UI than the main app. Also when it came to cancel, you can’t within the app and they ignored my request for 2 months leaving me with no choice but to raise a PayPal complaint.

                                                                            Felt like a hobby project gone wrong.

                                                                        1. 2

                                                                          I felt this needed a new topic as it is time sensitive and would get missed in the comments of the existing thread but mods, please do as you see fit.

                                                                          Is this also your first time seeing something like this? They’re even doing a live Q&A.

                                                                          1. 2

                                                                            I’ve never seen anything like it; it’s fascinating.

                                                                            1. 1

                                                                              event is good for this sort of ephemeral thing. :)

                                                                              1. 1

                                                                                The deed is done.

                                                                            1. 2

                                                                              Seems quite useful for teams collaborating on Github although I’m not touching it with a 6 foot stick until someone knowledgable in security says this is a good idea.

                                                                              1. 4

                                                                                The implementation is fairly small; it effectively adds the Github user’s public keys to the box’s authorized_keys file on startup and removes the keys on program termination. It relies on the fact that all Github users public keys are publically available at github.com/<username>.keys (e.g mine).

                                                                                To use it you’d have to trust the individual, Github, your connection with Github and also that their key is theirs and theirs only.

                                                                                1. 1

                                                                                  That was my first thought, then I realised it’s no more dangerous than the rest of the unsigned binaries I install off the internet

                                                                                1. 1

                                                                                  From the comments:

                                                                                  Part of what we’re trying to do is get the benefits of AMP without publishers having to “give away all of the control” of their content by putting it under Google’s domain. AMP, if it only works on Google’s infrastructure, poses a challenge to an open Internet. If we can help ensure that it’s truly an open standard then it can help cleanup a lot of the mess that is the current state of the mobile web. We have a lot more to come on this front. Stay tuned.

                                                                                  I get the need, and I think it’s a noble effort but I still feel like AMP is slowly breaking the link-ability of the web, URL by URL. So we now have 2 silos instead of one, great, but we used to have many orders of magnitude more than that.

                                                                                  1. 10

                                                                                    Oh boy. “Phoenix on Elixir”. As much as I love Elixir/Erlang/BEAM, it seems inevitable for the language and ecosystem to get stampeded by hyped-up Rails/web developers who think of both as the same thing. Oh well, more users means more chances of getting an Elixir job.

                                                                                    The article never defined what a “modern app” is and how Phoenix makes it easier compared to Rails (which has web sockets). That said, Phoenix has the BEAM behind it and is not a majestic monolith—with umbrella applications, it can just act as your web server and have little to no business logic, so it can make large web applications easier to manage.

                                                                                    1. 4

                                                                                      This is valid criticism. My main focus was trying to find the parts in Rails that can be easily “translated” into Phoenix and explain those parts. I didn’t write much about BEAM and umbrella applications because there really isn’t an equivalent in Rails.

                                                                                      1. 7

                                                                                        Sorry if I was too hard on you—the rest of the article is excellent. It just happens that those two things really bug me :-) I definitely think umbrella applications deserve a mention, it’s a major advantage to Rails (or many other languages).

                                                                                        1. 5

                                                                                          No worries. I enjoy honest criticism, it helps me improve. This is my first blog post of this size, so I have plenty to learn still.

                                                                                          1. 2

                                                                                            For people that used both Elixir and Django: how do the Umbrella Projects relate to what django calls apps?

                                                                                            1. 6

                                                                                              Not really at all. I’m trying to think of any similarities but I’m currently failing; they’re closer to a package of packages. I’ll go through some reasoning:

                                                                                              • A Django app is a framework construct, Elixir Umbrella’s are more core to the language itself. Every build of Elixir ships with Mix, a build tool which is capable of creating new Elixir projects. An Umbrella project is simply a root level Elixir project that contains one or more Elixir projects “under its wings”. Each Elixir project keeps it’s own dependencies, version, docs, start-up list, build, test suite, etc. Basically it lets you have a de-coupled per-app isolated layout while keeping the advantages that a single repo can give. Each app within the umbrella is individually deployable.

                                                                                              • In Django, it’s quite awkward to create a 3rd-party package that runs alongside your actual project while you’re developing it. Sure it’s possible, but with Python Path and module importing issues - it tends not to happen and you end up syncing with some git remote. This problem is solved with Umbrella projects because you simply create a new Elixir project within your umbrella and list the new project as an “in umbrella” dependency to your existing project; this means that when you’re finished with development and ready to open source on Hex - all you have to do is publish it and change the dependency of your original application to point to Hex instead. And if you never finish it? It can just stay there running as it’s own self-contained app. It reduces the friction completely.

                                                                                              • A Django app tends to be tightly related to a set of models and specific Django patterns. An Umbrella project is not really constrained by anything other than the standard layout of an Elixir project - which is defined by the Mix tool in every project anyway. There is no linking it with a set of data and it doesn’t take on any special extras when used with say Phoenix - it’s just a Mix project at the end of day, and any Elixir project can be one.

                                                                                              To end with an example: a common pattern I take when using Phoenix is to start with an Elixir Umbrella app, and then immediately create 2 sub apps: one that contains my business logic and data stores, and the other that deals with interfacing with the web with Phoenix as a dependency. Having the separate apps helps me enforce the separation by providing a clear isolation line, and also means that I’m not glued to Phoenix. Also, while they do have separate things, if I run commands from the root Umbrella, they tend to get run on both - the integration is very nice there.

                                                                                              Edit: I deliberately stayed away from OTP because I think the acronym can be off putting to newcomers but for simplicities sake, 1 Elixir project == 1 OTP app.

                                                                                              1. 3

                                                                                                An “umbrella project” is just multiple OTP applications in one project. They are full OTP applications, so more like a generic python package.

                                                                                            2. 3

                                                                                              While not really used, internal Rails Engines are equivalent to umbrella applications.

                                                                                              1. 1

                                                                                                I haven’t used Rails Engines in a while so I completely forgot about them. I know they can be used for similar purposes but if I recall correctly they almost become a part of the Rails monolith instead of being treated as a separate application as in Elixir. I could be wrong though.

                                                                                            3. 1

                                                                                              I just noticed that the title kind of suggests that the name of the framework is “Phoenix on Elixir”, which was not the intention. Sorry about that.

                                                                                            1. 1

                                                                                              I just started a project using webpack 1.X, so I had a look around to find out if they are dropping development for the 1.X versions and just focusing on 2.X but I couldn’t see anything about this.

                                                                                              Anyone know what the roadmap/plan is? Only thing I could find was this but it doesn’t give much information regarding previous versions.

                                                                                              1. 1

                                                                                                I don’t know the answer to your actual question but I have tried migrating a v1 project to Webpack 2 the other week but the ecosystem surrounding it just wasn’t there yet - lots of the loaders and plugins I was using had odd quirks under Webpack 2 or simply didn’t work at all with the new loader configuration format. It’ll take time for the system surrounding Webpack to play catch up, hopefully the official release will step that up a gear.