Giter Club home page Giter Club logo

lanternloadexamples's Introduction

Lantern Load Examples

A collection of example datapacks on how to use the Lantern Load convention.

1. Basic datapack with a load score

Athena

All the datapack does is include the load core and set its own load status score. This score can then be detected by other datapacks. It doesn't support versioning and doesn't have dependencies.

This is a good pick if your datapack doesn't have any dependencies and only one version will ever be loaded at once.

2. Basic datapack that depends on another datapack

Odysseus

This datapack depends on Athena, and thus it needs to check if the athena load.status score is set. But secondly, it also needs to make sure that Athena loads before Odysseus, otherwise the score won't be set even though the datapack is loaded.

This is a good pick if your datapack has one or more dependencies, but itself isn't a datapack that will need versioning.

3. Datapack that supports multiple versions

Leto

This datapack introduces the concept of including the version in its implementation function. This allows future changes to be made, and if multiple versions are loaded, only the latest version will actually run its implementation.

This is a good pick if your datapack is expected to change in the future, and other datapacks will include this bundled.

4. Datapack with a major and minor version

Hera

This datapack is very similar to Leto, except that it has two version numbers. The major version would be incremented when breaking changes are made requiring dependents to make changes. The minor version would only be incremented when a change is made that is compatible.

5. Versioned datapack that depends on another versioned datapack

Demeter

This datapack itself is versioned, and it has Hera as a dependency. Here you have the choice how you check the major and minor version. In most cases you want to check that the major version is equal, and the minor version can be equal or higher.

6. Versioned datapack with a public API

Zeus

Just like Hera, this has a major and minor version. On top of that, it provides a public API in the form of a function tag. This function tag only includes the major version, so dependents don't need to change when there is a minor version bump.

6. Updating a versioned datapack with a public API

Zeus v1.3

This is a copy of Zeus, but with the version updated to v1.3. It changes the implementation of the API, however, no breaking changes were made and the public API remains the same.

Exactly for this reason it's important only the latest version of a library is enabled and running. Otherwise the API tag would be called twice.

7. Versioned datapack using another public API

Chronus

Just like Demeter, this is a versioned datapack that depends on another versioned datapack. In this case it uses the public API of Zeus. This datapack doesn't care whether v1.2 is present or v1.3 is preset. It only requires a major version of 1 and a minor version at least 2.

lanternloadexamples's People

Contributors

misode avatar

Stargazers

Valentin Berlier avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.