Coder Social home page Coder Social logo

Comments (2)

domtra avatar domtra commented on September 25, 2024

hi @pierreberchtold ,

regarding your questions:

  1. in flynt 1 we used browsersync. this meant, that we proxied the entire wordpress server on a specific port. in order to get live reload, etc. you had to visit this port either with localhost:3000, for example, or with LOCAL_IP:3000. vite works a bit different. in dev mode, files are not written to the disk but served from memory through a separate dev server. this is why we have to include the asset files from the dev server and cannot just use a file on disk through wordpress' web server.
    as a result, the regular domain you set up for wordpress now automatically includes live reload, etc. but this also means that we not take care of exposing you wordpress installation in the local network. now you have to take care of this yourself. that means, if you run wordpress on a port on localhost, for example with wp-env and also bind that to you local ip, you will be able to access that ip from a different device in your network. i hope that makes sense.
    you might additionally need to bind the vite dev server to 0.0.0.0 or ::1 instead of localhost in order to access the compiled assets from the local network as well. let me know if i can support you in that.
  2. if you local wordpress instance runs on http, you do not need any certificates and can just use vite dev server without any extra config. if, however, you server wordpress with https, the vite dev server should also run in secure mode, otherwise most browsers will reject the loading of the assets or the websocket connection. this is why we advice you provide a trusted ssl certificate and key through the environment variables. for development, we use mkcert and can use the same certificates as we use for our wordpress server. here you can find more info and also a link to a vite plugin for an alternative way to get a certificate. this will cause warnings in the browser though.

in general, the setup is not a bit different and requires different strategies than before. however, the development experience does improve a lot with vite, it generates more modern bundles and compiles a lot faster that anything we did before.

hope this helps and you can find the best setup for you. let me know if you need anything else.

from flynt.

pierreberchtold avatar pierreberchtold commented on September 25, 2024

Hi @domtra ! Thank you very much for your detailed answer.
Using vite is for sure a nice update. I guess we will define our own best practices for our team concerning testing localy on a mobile device.

from flynt.

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.