Giter VIP home page Giter VIP logo

Comments (19)

falood avatar falood commented on June 20, 2024 1

sure, I'll fix it and bump a new version today, thank you!

from phoenix_live_reload.

superherointj avatar superherointj commented on June 20, 2024 1

file_system 0.2.0; phoenix_live_reload 1.1.0
Works just fine.
phoenix_live_reload version wasn't bumped.
Another day saved! A beautiful day indeed. :)

from phoenix_live_reload.

chrismccord avatar chrismccord commented on June 20, 2024

Please include your version of phoenix_live_reload from mix deps

from phoenix_live_reload.

josevalim avatar josevalim commented on June 20, 2024

Also, is anything logged when you run mix phx.server?

from phoenix_live_reload.

superherointj avatar superherointj commented on June 20, 2024

On changing files it is not logging anything to 'iex' on phoenix 1.3 but on phoenix 1.2 it shows log.
For phoenix 1.3, phoenix_live_reload version installed is 1.1.0.
For phoenix 1.2.4. phoenix_live_reload version installed is 1.0.8.
It was tested creating a new phoenix project from scratch using 'mix phx.new xxx'.
Any further step?

from phoenix_live_reload.

josevalim avatar josevalim commented on June 20, 2024

@superherointj just to be double sure, can you please start a new phoenix session with iex -S mix phx.server, do a new request and then post here everything that is printed to the terminal from the call to IEx up to the end? Thanks!

from phoenix_live_reload.

OvermindDL1 avatar OvermindDL1 commented on June 20, 2024

As a data point, a Phoenix 1.3 project on Windows 10 in MIX_ENV=dev reloads files fine here, css, source, and templates.

from phoenix_live_reload.

superherointj avatar superherointj commented on June 20, 2024

D:\dev\elixir\liver>iex -S mix phx.server
[info] Running LiverWeb.Endpoint with Cowboy using http://0.0.0.0:4000
Interactive Elixir (1.5.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 14:48:30 - info: compiled 5 files into 2 files, copied 3 in 1.1 sec

HERE I OPEN THE PAGE

iex(1)> [info] GET /
iex(1)> [debug] Processing with LiverWeb.PageController.index/2
Parameters: %{}
Pipelines: [:browser]
iex(1)> [info] Sent 200 in 94ms

HERE I CHANGE ONE FILE FOR EXAMPLE APP.JS added a console.log('changed') to it

iex(1)> 14:49:39 - info: compiled app.js and 3 cached files into app.js in 115 ms
iex(1)>

There is no additional logs!!

See picture:

from phoenix_live_reload.

josevalim avatar josevalim commented on June 20, 2024

Thanks @OvermindDL1! Can you please check it after mix deps.update phoenix_live_reload as well? We have recently released a new version, so you may not be running on the latest.

from phoenix_live_reload.

josevalim avatar josevalim commented on June 20, 2024

@superherointj thanks! We can see that the assets are being recompiled. So it is indeed something specific to the live reload in particular.

from phoenix_live_reload.

superherointj avatar superherointj commented on June 20, 2024

D:\dev\elixir\liver>mix deps.update phoenix_live_reload
Running dependency resolution...
Dependency resolution completed:
cowboy 1.1.2
cowlib 1.0.2
file_system 0.1.5
gettext 0.13.1
mime 1.1.0
phoenix 1.3.0
phoenix_html 2.10.4
phoenix_live_reload 1.1.0
phoenix_pubsub 1.0.2
plug 1.4.3
poison 3.1.0
ranch 1.3.2

from phoenix_live_reload.

josevalim avatar josevalim commented on June 20, 2024

Sorry, the mix deps.update command was for @OvermindDL1. :) You are on latest.

@superherointj, can you please try this:

$ iex -S mix phx.server
iex> FileSystem.start_link(dirs: [Path.absname("")], name: :trying_out)

And let us know what it returns?

from phoenix_live_reload.

superherointj avatar superherointj commented on June 20, 2024

What should I fill Path.absname("") with? Try it empty?

--
D:\dev\elixir\liver>iex -S mix phx.server
[info] Running LiverWeb.Endpoint with Cowboy using http://0.0.0.0:4000
Interactive Elixir (1.5.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 15:07:12 - info: compiled 5 files into 2 files, copied 3 in 1.2 sec
iex(1)> FileSystem.start_link(dirs: [Path.absname("")], name: :trying_out)
{:ok, #PID<0.326.0>}

HERE I LOAD PAGE

iex(2)> [info] GET /
iex(2)> [debug] Processing with LiverWeb.PageController.index/2
Parameters: %{}
Pipelines: [:browser]
iex(2)> [info] Sent 200 in 32ms

HERE I MAKE CHANGE TO app.js

iex(2)> 15:08:48 - info: compiled app.js and 3 cached files into app.js in 93 ms


No logs about change event on iex. No automatic update on browser.
I could give you access to this computer on TeamViewer. If it can speed things up for you.

from phoenix_live_reload.

josevalim avatar josevalim commented on June 20, 2024

@superherointj helped me find the bug. The issue is that the paths reported by file_system on Windows are using \\ but the patterns only use /.

@falood @mveytsman what do you think should be the proper solution here?

Should the filesystem project normalize paths? Or should it return the raw paths and Phoenix does the normalization? In any case, the solution is easy:

path = path |> Path.split |> Path.join

It is just a matter of deciding the best place to put it.

from phoenix_live_reload.

falood avatar falood commented on June 20, 2024

image

It seems erlang use / as default path separate in windows, so I think I should return the same format with my code, right?
BTW, Path.join also use / for windows.

from phoenix_live_reload.

josevalim avatar josevalim commented on June 20, 2024

@falood yes, that's why using path |> Path.split |> Path.join works, because Elixir and Erlang normalizes it. If we want to fix it in file_ssytem, it should be a question of doing the split+join here: https://github.com/falood/file_system/blob/master/lib/file_system/backends/fs_windows.ex#L152

But if you don't think we should change file_system, then I can fix it here. :) your call!

from phoenix_live_reload.

falood avatar falood commented on June 20, 2024

@josevalim I have fixed and released the new version, it's not a fast-forward change, so the new version number is v0.2.0.

from phoenix_live_reload.

josevalim avatar josevalim commented on June 20, 2024

Beautiful, thank you! @superherointj can you please run:

 mix deps.clean phoenix_live_reload
 mix deps.clean file_system
 mix deps.update file_system

and let us know if it works? Thank you.

from phoenix_live_reload.

josevalim avatar josevalim commented on June 20, 2024

❀️ πŸ’š πŸ’™ πŸ’› πŸ’œ

from phoenix_live_reload.

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.