Skip to content

Releases: Julien-R44/verrou

[email protected]

20 Sep 15:08
Compare
Choose a tag to compare

Commits

  • refactor: use specific submodule path when importing things from poppinss (bd37717)
  • chore: update dependencies (b816b67)
  • fix(memory): update mutex owner when releasing then acquiring again (0eb38d2)
  • Update README.md (#9) (d5ca7c1)
  • fix(docs): a couple of things (#8) (258963c)
  • chore: add sponsors (542f6ab)
  • docs: fix LockFactory instructions (fbb5e60)
  • chore: update lockfile (4c3ca28)
  • docs: add adonisjs integration page (442d7d4)

Fix published files

19 Mar 16:00
Compare
Choose a tag to compare
  • chore: fix published files (1a9a5f6)
  • chore: update LockStore jsdoc (fc01e23)
  • doc: update doc accordingly (0e430cf)

Don't throw when lock isn't acquired

14 Mar 12:02
Compare
Choose a tag to compare

Breaking changes

These breaking changes are important and radically alter the way Verrou works, so make sure to read it

  • run, runImmediately, acquire, acquireImmediately do not throw anymore when lock hasn't been acquired. See this PR that document it. You should now check explicitly the return value of acquire to see if lock was acquired or not
  • run and runImmediately methods will return a tuple with the first value being a boolean indicating if the lock was acquired or not. Also see this PR

API should now be stable and we don't expect further breaking changes

Commits

  • doc: update doc accordingly (1281cb5)
  • refactor!: do not throw anymore when can't acquire lock (94ce278)
  • chore: add japa/expect-type (14a529a)

Full Changelog: https://github.com/Julien-R44/verrou/compare/[email protected]@0.4.0

Acquire Immediately

13 Mar 20:12
Compare
Choose a tag to compare

Breaking Changes

another small breaking change. we are approaching a stable API

  • The tryAcquire function is now called acquireImmediately. tryAcquire was too confusing.

Changes

Commits

  • chore: fix doc about lock factory API (a651ff9)
  • feat!: rename tryAcquire to acquireImmediately + add runImmediately method (41bfae1)

Full Changelog: https://github.com/Julien-R44/verrou/compare/[email protected]@0.3.0

Database Adapter + Kysely

12 Mar 19:57
Compare
Choose a tag to compare

Breaking Changes

Auto-create instance

All stores now accept only the instance of the underlying driver. Verrou no longer creates client instances for you. Take the redis driver, for example. Before, you could do this:

const verrou = new Verrou({
  logger,
  default: 'redis',
  stores: {
    memory: { driver: memoryStore() },
    redis: { driver: redisStore({ connection: { host: '127.0.0.1', port: 6379 }) },
  },
})

From now on, you'll need to create your instance beforehand and pass it to Verrou :

const ioredis = new Redis({ host: 'localhost', port: 6379 }) // create the client
const verrou = new Verrou({
  logger,
  default: 'redis',
  stores: {
    memory: { driver: memoryStore() },
    redis: { driver: redisStore({ connection: ioredis }) }, // pass it to verrou
  },
})

Disconnecting

Any notion of disconnecting has been removed from Verrou. You'll have to manage the disconnection of your drivers yourself. The disconnect and disconnectAll methods have been removed.

Since you instantiate your client yourself, managing disconnection is simple:

const ioredis = new Redis({ host: 'localhost', port: 6379 })
const verrou = new Verrou({
  logger,
  default: 'redis',
  stores: {
    memory: { driver: memoryStore() },
    redis: { driver: redisStore({ connection: ioredis }) },
  },
})

// do some things

await ioredis.quit()

DatabaseStore

  • the databaseStore is now called the knexStore and can be imported from @verrou/core/drivers/knex.

Changes

  • We now have an adapter system for the databaseStore, which makes it easy to change knex for something else in case you're using another ORM and just want to have a connection to your DB from your application.
  • Added an adapter + store kyselyStore importable from @verrou/core/drivers/kysely. See documentation
  • Added autoCreateTable property for database driver.

Commits

  • chore: update readme (428d0ae)
  • doc: update documentation about drivers usage (257971b)
  • refactor: update playground (d34b727)
  • refactor: drivers only accept instance instead of creating it (9808fc6)
  • refactor: remove all disconnect features (c96d91e)
  • style: lint files (6e6ff05)
  • feat: add DatabaseStore + adapter system (c3a5691)
  • chore: fix typos (d905df0)
  • style: lint (31c5bf7)
  • feat: add kysely adapter (7b4d0c8)
  • chore: add dynamodb as optional peer dep (d5142f1)
  • style: lint (12da6e9)
  • feat: add autoCreateTable options for database driver (2d980cf)
  • chore: update documentation (b7cf5ce)
  • chore: update dependencies (e8c93e3)
  • Update quick_setup.md (1a3e5d5)
  • chore(docs): add algolia search (16c80c3)
  • feat: add more logging (5e26853)
  • chore: add pino to playground (6d461c4)
  • docs: fix typo (fcea658)
  • docs: fix install command (874eacb)
  • chore: add og image (43f6dff)
  • docs: fix wrong example (a159504)
  • docs: add pretty banner (513cc39)
  • Update README.md (0e6947d)
  • docs: note about documentation (61087f8)

[email protected]

05 Jan 00:31
Compare
Choose a tag to compare
  • chore: add release-it config (2be9330)
  • chore: add publishConfig (1028a05)
  • chore: add release-it (62ffeda)
  • test: fix latest wrong commit (584ad0f)
  • test: fix flakky test (c94a5ca)
  • docs: update wrong imports (5f0ae58)
  • chore: add export to test_suite (697ec54)
  • docs: minor (71859a0)
  • feat: add a tryAcquire method (773e3bf)
  • docs: notes (c3cfae2)
  • docs: notes (4326c90)
  • feat: support Duration values and lock.acquire options (1b62d85)
  • test: fix incorrect test (0339e2e)
  • refactor: minor driver refactor (3a80015)
  • refactor: move to E_LOCK_NOT_OWNED (e1b2bb1)
  • refactor: refactorLock new api (0669a29)
  • feat: add isExpired and getRemainingTime methods (b94065c)
  • docs: add example with string duration (26b712f)
  • test: fix flakky tests (030c2bf)
  • docs: update introduction (0922e61)
  • docs: update drivers examples with both apis (d4b65e3)
  • test: fix flakky test (a4c7f38)
  • style: lint (cb9432e)
  • feat: add extend method (4570195)
  • feat: add logger system (1377001)
  • feat: add forceRelease method (364d1fc)
  • docs: add api docs (f73d5e8)
  • docs: wip docs (0d9b80e)
  • chore: docs wip (349a920)
  • docs: first step docs (0e6b7e2)
  • refactor: minor refactor (46d3581)
  • chore: remove useless fields (1f927c5)
  • fix: minor fixes (6f219b3)
  • feat: add lock timeout (f4942b7)
  • chore: add c8 config (5ce4ea2)
  • feat: add restoreLock and getOwner (d208c1a)
  • docs: update colors (6486b28)
  • chore: rollback (b065940)
  • refactor: rename null store file (bcbea13)
  • chore: enable type aware rules (61198ea)
  • feat: disconnect method (e0fe429)
  • chore: add playground (7a2857f)
  • chore: cleanup (fb4079f)
  • ci: add missing var (522442e)
  • refactor: move database test to its own (c2233a5)
  • feat: add dynamodb driver (9262bea)
  • chore: add dynamo env (8f8492a)
  • chore: add dynamodb peer dep (5b792ef)
  • feat: verrou (3cce374)
  • feat: wip (1e88e50)