Code Monkey home page Code Monkey logo

Comments (8)

awolkers avatar awolkers commented on September 21, 2024

Agree on this one. I always add a media folder within src where I put all the non static assets like images and videos served as test content. This folder also contains .json and .html files used for async fetching of data. A watch task is added to make sure files are copied to the dist folder.

from frontend-boilerplate.

sanjaytwisk avatar sanjaytwisk commented on September 21, 2024

I would say that images, video's and json files belong in the /static folder. According to your comment I think we should add json and video tot src/static and implement the corresponding gulp tasks. I think the json task should only run in dev mode and the video task should run in both dev and dist.

from frontend-boilerplate.

awolkers avatar awolkers commented on September 21, 2024

All files used for mocking or content purpose should not be included within the /src/static folder. There is no need for them to be in a production environment. Adding a folder directly within /src would be a better place for these files. The name for this folder can be something like 'mock' or 'media'.

from frontend-boilerplate.

branneman avatar branneman commented on September 21, 2024

Great idea! 👍

Why not place your json mock files inside the components folder, together with the html, css and js? Since the front-end bootstrap is not an actual application itself, a json file isn't any different from a html file for example. All the HTML code we produce is implemented in a server-side application, not used by itself.

The front-end bootstrap environment is basically a static site generator. Sometimes the results are uploaded to a static site host, so a user would expect all the json mock files to be available, otherwise a demo would not function, thereby not having any value as a demo.

I always try to make my json test data component-specific. An example component folder could then be like:

src/
  components/
    nav/
      nav.html
      nav.css
      nav.js
      nav.json

If you don't want those json files to be automatically released to production, you should do just that: make the build (or backend developer) not simply copy/move those files into production when they shouldn't.

PS: As a side note, I disagree with the term 'media', which is defined as images/videos/etc, certainly not raw json data.

from frontend-boilerplate.

awolkers avatar awolkers commented on September 21, 2024

Sounds good to put the json files within the components folders but sometimes json are used on a higher scope.
It also leaves us with the problem of where to put the videos and images, etc.

from frontend-boilerplate.

branneman avatar branneman commented on September 21, 2024

This issue seems really about json mock data. For images we already have a folder, and videos are an exception I think.

from frontend-boilerplate.

peeke avatar peeke commented on September 21, 2024

Maybe we could rename media to assets to allow it to contain a broader range of contenttypes?

from frontend-boilerplate.

colin-aarts avatar colin-aarts commented on September 21, 2024

Closing, dupe of #9

from frontend-boilerplate.

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.