Git Product home page Git Product logo

Comments (17)

sagebind avatar sagebind commented on May 18, 2024

That sounds cleaner to me. Reminds me of the old way of *.load files.

from oh-my-fish.

scorphus avatar scorphus commented on May 18, 2024

Absolutely, I was going to suggest this! It totally makes sense!

from oh-my-fish.

Gaelan avatar Gaelan commented on May 18, 2024

👍

from oh-my-fish.

bobthecow avatar bobthecow commented on May 18, 2024

if we're going this route, should't we move 'em to /functions/*.fish in the package directory?

from oh-my-fish.

bpinto avatar bpinto commented on May 18, 2024

@CoderStephen
Indeed it is, but changing the extension from .load to .fish. 👍

@bobthecow
My initial thought was backwards compatibility, but it's doable.
Later I thought about most plugins that only have one function, and we would now have an extra directory for a single function.

Well, I think it's going to be well structured if we go this route. So, let's do it. The init.fish and uninstall.fish should not go into the functions dir, right?

from oh-my-fish.

derekstavis avatar derekstavis commented on May 18, 2024

Later I thought about most plugins that only have one function, and we would now have an extra directory for a single function.

I also think that we would like to implement a package description file (or function), where plugins can declare dependencies. This extra function directory isn't a problem, it's the solution for separating concerns on plugin structure and loading just what the user will use.

from oh-my-fish.

derekstavis avatar derekstavis commented on May 18, 2024

Syntesizing what @bpinto is proposing + package.fish idea, a sample plugin directory structure would look like:

- plugin-foobar
  * init.fish
  * uninstall.fish
  * package.fish
  - functions
    * foo.fish
    * bar.fish

By only adding functions directory to autoloading paths we avoid loading unnecessary functions that are only used on load/init/uninstall.

from oh-my-fish.

bpinto avatar bpinto commented on May 18, 2024

That's it @derekstavis 👍

err... update, not really. :D

- plugin-foobar
  * init.fish
  * uninstall.fish
  - functions
    * foobar.fish
    * foo.fish
    * bar.fish

from oh-my-fish.

derekstavis avatar derekstavis commented on May 18, 2024

Hm, looks like it's identical, apart from just one file in functions

from oh-my-fish.

bpinto avatar bpinto commented on May 18, 2024

No package.fish file.

from oh-my-fish.

derekstavis avatar derekstavis commented on May 18, 2024

Reviving this discussion, what about this?

- plugin-foobar
  * init.fish
  * uninstall.fish
  * bundle
  - completions
    * foobar.fish
  - functions
    * foobar.fish
    * foo.fish
    * bar.fish

bundle can be used for declaring dependencies, like package.json.

from oh-my-fish.

bobthecow avatar bobthecow commented on May 18, 2024

if we leave $PACKAGENAME.fish support in, plugins will work whether they've updated or not.

from oh-my-fish.

bpinto avatar bpinto commented on May 18, 2024

I think adding support for $PACKAGENAME.fish is a temporary solution, but we should migrate them to improve loading time.

from oh-my-fish.

bobthecow avatar bobthecow commented on May 18, 2024

from oh-my-fish.

sagebind avatar sagebind commented on May 18, 2024

Nice. 👍

from oh-my-fish.

bpinto avatar bpinto commented on May 18, 2024

Time to migrate yours @CoderStephen ? 👍

from oh-my-fish.

sagebind avatar sagebind commented on May 18, 2024

Indeed. In the next few days.

from oh-my-fish.

Related Issues (20)

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.