Rexios

joined 1 year ago
MODERATOR OF
 

Hello! I'm the maintainer of Hive Community Edition.

I am proposing to introduce a new annotaiton called @GenerateAdapters. This allows you to generate TypeAdapters for types without explicitly annotating any types or fields. This is much easier to maintian and also allows generating adapters for types outside the current package.

For example:

@GenerateAdapters([
  AdapterSpec<ClassSpec1>(),
  AdapterSpec<ClassSpec2>(),
  AdapterSpec<EnumSpec>(),
])
void _() {}

This will generate type adapters for all the types specified. The main difference between using @GenerateAdapters and explicit annotations is that type IDs and field indexes are determined automatically. This information is then stored in a hive_schema.yaml file which informs future generations which type IDs and field indexes are in use.

My main concern is introducing this feature in a way that allows any future changes to be non-breaking. I believe I have eliminated most of the risk by basing the annotation off of mockito. At the moment there aren't actually any fields in the AdapterSpec class, but adding any in the future will not be a breaking change.

I would really appreciate any feedback the Hive community has on this. If you want to try out the @GenerateAdapters annotation to see how it works in your project, add the following to your pubspec:

dependency_overrides:
  hive_ce:
    git:
      url: https://github.com/IO-Design-Team/hive_ce
      ref: ec6e8d7dfc81a4adb3a9ae9eca0e78bc104116d8
      path: hive
  hive_ce_generator:
    git:
      url: https://github.com/IO-Design-Team/hive_ce
      ref: ec6e8d7dfc81a4adb3a9ae9eca0e78bc104116d8
      path: hive_generator

See the new documentation here

Note that this is a breaking change for the generator, as hive_registrar.g.dart has moved to hive/hive_registrar.g.dart to not clutter the lib folder. I have created a migration guide here

[–] Rexios@lemm.ee 1 points 1 week ago

If there was a Lemmy account setting to automatically bypass the proxy on failure then it might not require any front end work, but the manual bypass button would definitely need to be implemented in each client

[–] Rexios@lemm.ee 7 points 1 week ago (3 children)

Have you thought about solving this issue in the front end? The client I’m using (Mlem) implemented a feature to directly access the image if the proxy fails. This feature can either be triggered automatically or by pressing a button on the failed image. This allows users the benefit of the proxy while also having the option to give up their IP if they want to see a broken image.

[–] Rexios@lemm.ee 1 points 1 week ago* (last edited 1 week ago)

You need physical access to one of your devices to approve web access. If someone had that they could also just turn on the toggle.

[–] Rexios@lemm.ee 2 points 1 week ago (2 children)

Are you saying enabling the setting to allow web access is downgrading your security? I think the security risk is super minimal. You need physical access to one of your devices to approve access every time.

[–] Rexios@lemm.ee 2 points 1 week ago (4 children)

Do you? I thought you just had to authorize from an Apple device every time.

[–] Rexios@lemm.ee 3 points 1 month ago

It really doesn’t. I’ve seen bolts that have been at chargers for over 2 hours and still aren’t at 100%

[–] Rexios@lemm.ee 9 points 1 month ago (3 children)

The only thing wrong with this picture is a Bolt at a DCFC. They charge so ungodly slow they might as well be ICEing the stall they’re at.

[–] Rexios@lemm.ee 3 points 1 month ago (1 children)

What are you talking about? Even before this new “invisible cryptography” you set it up once per device and never have to think about it again.

[–] Rexios@lemm.ee 4 points 1 month ago (1 children)

Clicking an external link exposes your IP address to the server. All someone has to do is send a link that looks like something you want but actually just logs your ip address and you’re doxxed.

[–] Rexios@lemm.ee 3 points 1 month ago* (last edited 1 month ago)

The old feastables was actually good. The new stuff tastes like rebranded Hersheys.

[–] Rexios@lemm.ee 12 points 2 months ago (1 children)

It depends on how you’re streaming it, but if you use some service that streams a torrent directly and then throws it away afterwards you took the torrent data without contributing anything back to the swarm

[–] Rexios@lemm.ee 9 points 2 months ago (7 children)

This kills the torrent

 

I just released firebase_js_interop which allows you to compose Firebase Cloud Functions in the Dart language. Along with my firebase_rules package it is now possible to create an entire Firebase project with only type-safe Dart code! There are a lot of components missing, but writing the interop code is tedious, not hard. With third-party contributions we should be able to get close to full interop quickly.

 

The pubstats.dev page keeps track of historical pub.dev data. I just made it so that it can also show the rank of a package on pub.dev based on its popularity score. For example dio is rank 20 right now.

If you haven't seen pubstats.dev before here are some other features:

  • Like count and popularity score tracked over time for all packages on pub.dev
  • Historical tracking of a lot of package metadata such as version and dependents
  • Compare like count and popularity graphs across multiple packages (ex https://beta.pubstats.dev/#/packages/dio,http)
  • If you sign in you can set up alerts for package info changes. Very useful for making sure you have maximum pub points! There are only Discord webhook alerts for now since that's what I use personally, but if you'd like to see more options feel free to contribute on GitHub.

As an added bonus, https://beta.pubstats.dev uses the new WASM renderer. Thanks to the Flutter team for helping me make that possible! There is some weirdness with Google OAuth still with WASM (see this issue), but everything else works. If you want to set up Discord notifications you might want to use the stable https://pubstats.dev for now.

 

I posted about this package before and just got made fun of for the name, but this is a useful update for developers that work on large mono-repos on a daily basis. The puby link command used to require pubspec.lock files to be checked into version control in order to know which dependencies to grab, which most open source mono-repos do not allow. Notably, I work on the flutter/packages repo a lot and dealing with dependency resolution is a pain, but I just released an update to puby to fix this. This involves reusing the dependency resolution code directly from the pub command in order to catalog dependencies rather than relying on lock files. What this means in practice is you can have an empty pub cache, make a clean clone of the flutter/packages repo, and have all dependencies resolved in less than 30 seconds. The puby link command is now almost twice as fast as melos bootstrap and requires zero setup whereas melos likes to complain about your repository structure.

 

Does anyone else think that auto regen is kind of useless? If I want the car to handle itself, I'll just use adaptive cruise. If I want control of the car, I'll just use IPEDAL. Auto just seems needlessly complex.

view more: next ›