Git Product home page Git Product logo

Comments (4)

michielvandergeest avatar michielvandergeest commented on August 22, 2024

The CLI only watches the src and static folder and settings.json. If you use external libraries in your app, I suggest you put them in src/libs.

Watching the node modules folder doesn't sound like a good idea for performance reasons.

from lightning-cli.

 avatar commented on August 22, 2024

Thanks for the support.

I want to share my idea:
Share class definitions between node server and Lightining Front End.

So my classes, for example Player may have the responsability of communicate with his REST API (CRUD his self).

So a Player should be instancieted or received by a Component (ex the PlayerPosition), shared between components but also manipulated by the server and even saved in a database.

I'm not thinking about external libraries but my custom business logic definition.

You think that a Front End project not have to contain custom classes but only Components?

Even for Utils functions (for example the function that find the winner) should be good if It should be shared with the server and so mantained in one place only.

I'm looking for a way to share these classes in order to be DRY...

It's reasonable?

The best thing I think is to release those definitions as modules and then import them as dependecies in both server and client projects.

Now they are in a shared folder and I'm restarting both server and lng processes mannually every time is needed.

Best regards
Mattia

from lightning-cli.

michielvandergeest avatar michielvandergeest commented on August 22, 2024

In general it seems like a good idea to share generic code between the front-end and the backend yes.

As for the CLI rebuilding your front-end project when any of these shared class definitions change, you have the following options:

  • place the files inside your front-end’s src/shared folder (easiest, but not very semantic)
  • keep the files outside of the front-end and create a symlink into your App’s src folder - that should also trigger a change in the watcher I believe
  • restart the watch / build commands manually whenever a generic file changes

from lightning-cli.

 avatar commented on August 22, 2024

Thanks for the support.
I recognise that is not a CLI issue so it is closable for me.
Best regards
Mattia

from lightning-cli.

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.