sodapopcan

sodapopcan

I’m working through Function Web Development with Elixir, OTP, and Phoenix which is a really eye-opening, fantastic book.

Of course, it’s a little out of date. It was written when Brunch was still bundled with Phoenix but now we have Webpack, so when instructed to type var phoenix = require("phoenix") in dev tools, that just doesn’t work.

I’ve searched for importing webpacked modules in dev tools to no avail. Perhaps I’m just tired—I’ve been working at this for hours now—but is there a way to access phoenix.js in Chrome’s dev tools in 1.5?

Thanks!

Showing Posts 1 to 5

dorgan

dorgan

To access something from the devtools, it needs to be globally accessible
One way of doing it is by assigning it to the window object, for example:

import phoenix from "phoenix";
window["phoenix"] = phoenix;

Then in the devtools you can now access it as phoenix. It should work regardless of the build tool you’re using.

Generally, importing a library with a script tag pointing to the file(like https://www.unpkg.com/phoenix@1.5.4/assets/js/phoenix.js) works too, but I don’t know if it does for phoenix too

sodapopcan

sodapopcan OP

Thank you!! So far so good. It seems quite a bit has changed since this book but that’s cool—not so bad to do some trouble-shooting on my own. But even after spending 80% of my time in JS for the past year+ (the team I’m on makes it all worth it), I always get stressed out anytime I have to do anything that requires me to understand webpack. I should maybe get over that… maybe.

Anyway, thanks again!

sodapopcan

sodapopcan OP

@lance Sorry for @'ing you but I’m relatively new here and thought I’d see if you’re on this form and sure enough you are. Are there any plans for a new edition for phoenix 1.5? It’s such a good book.

lance

lance

Author of Functional Web Development with Elixir, OTP, and Phoenix

Hey @sodapopcan,

Welcome!

No worries about @'ing me. :slight_smile: I’m so glad you found the book useful. It’s always great to hear when your work has helped other folks!

I don’t have immediate plans for a second edition, though the thought has crossed my mind. Books are a big undertaking, and I would want to make sure I’ve got the spare cycles to complete the job before I took it on.

For now, let’s just say the idea is simmering rather than at a full boil. :slight_smile:

Cheers!

sodapopcan

sodapopcan OP

Thanks for the welcome and thanks for the response! (I have been offline for several days here)

Cheers :slight_smile:

— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
water
I’m aware of 2 such projects, are there others? git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
itzmidinesh
Hi all, I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
leoschweizer
Hi, we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
csmr
Hi all, I’m new here and would like to hear peoples views on my Elixir/Phoenix based game-engine! :smiley: Mutonex gamedesign was finish...
New
Stef-Verniers
Hello I’ve been coding in Elixir for almost two years now because of my current job where we implemented Elixir in our application. But ...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews