Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 12 11:10
    surajprgupta commented #320
  • Sep 12 11:10
    surajprgupta closed #320
  • Sep 12 11:09
    surajprgupta opened #320
  • Aug 02 14:39
    syedsameerali edited #319
  • Aug 02 13:54
    syedsameerali opened #319
  • Jul 24 10:52
    Max-im commented #80
  • Jul 24 10:52
    Max-im commented #80
  • Jul 10 09:37
    bebraw commented #317
  • Jul 10 09:37
    liuzhuan opened #318
  • Jul 10 09:36
    liuzhuan opened #317
  • May 28 13:02

    bebraw on dev

    chore: Rename wds to developmen… chore: Set up prettier feat: Port the book to use mini… and 1 more (compare)

  • May 24 11:43

    bebraw on dev

    chore: Mention about inspectpac… chore: Extract prerendering to … chore: Add webpack-xray and 1 more (compare)

  • May 16 08:03
    cncuckoo opened #316
  • May 11 17:54
    keshav123ram commented #100
  • Apr 13 09:28

    bebraw on master

    fix: Fix Babel references chore: Bump version 2.4.9 (compare)

  • Apr 13 09:27

    bebraw on v2.4.9

    (compare)

  • Apr 13 09:27

    bebraw on dev

    fix: Fix Babel references chore: Bump version 2.4.9 (compare)

  • Apr 11 18:45
    bebraw commented #275
  • Apr 11 18:43
    bebraw commented #275
  • Apr 11 18:41
    Andrey-Bushman commented #275
Roberto C Navarro
@navarrorc
@bebraw Maybe you can have a look if you are interested main-bundle.js and vendors-bundle.js I don't expect for you to have the time but if you do I would really appreciate it. FYI: I'm renaming the jsonpFunction to "noconflictJsonp". Please let me know, I would gladly compensate you for your time.
Juho Vepsäläinen
@bebraw
no worries. just having a look
@navarrorc got it. see main-bundle.js and line deferredModules.push([0,"vendors~main"]);. i think the behavior is by design. webpack runtime has been designed to wait for the vendor to appear so the order doesn't matter
Juho Vepsäläinen
@bebraw
but it's a good question what happens if the order is other way around (maybe logic for that too?)
Juho Vepsäläinen
@bebraw
i've been working towards a new release of the book
now the question is, should i base it with webpack 4 (stable) or webpack 5 (alpha)? i'm learning towards webpack 4
i'm cleaning up some of the book and also adding new info where it's relevant
it's roughly 300 action points to shift through so likely i'll have to release in pieces
Roberto C Navarro
@navarrorc
@bebraw thank you so much for having a look. Sorry I just got back to you.
Juho Vepsäläinen
@bebraw
no probs :+1:
Anthony DeGennaro
@okanthony
Hey @bebraw, first just wanted to say I appreciate all the work you put into the book, it's been super helpful! I'm currently trying to load mocha tests in the browser as part of a React app and I have it working (thanks to the Testing chapter), however I'd like to be able to filter which tests are displayed based on the state of my app. I'm trying to use the return value form require.context() to find the module I want to require like this. It works on initial render, e.g. only the first test module is executed, but when I try to require another module the previous test modules are still executed and I get this error:
require error.png
Anthony DeGennaro
@okanthony
I tried clearing the previous test modules from the require cache but that didn't work. Interestingly, if a hot reload is triggered the error goes away and the proper test is displayed. If I was using mocha without webpack I would just use the grep option, but I was hoping to get it working with webpack as I want to take advantage of hot reloading to maintain the state of my app. Any thoughts would be a huge help!
Juho Vepsäläinen
@bebraw
@okanthony is there a specific reason to go with mocha (esp. with react)? i think i would run with jest+react-testing-lib outside of webpack (webpack can be configured to work with jest if you rely on the config somehow)
Anthony DeGennaro
@okanthony
The app is meant to be a series of challenges for building React components, so my idea was to have the test output as part of the app itself to guide development (in true TDD fashion). Since require.context() allows you to iterate over a set of modules via the keys() method I thought I could use that to only load certain modules based on the state of my app, but after much trial and error I may end up just loading all the tests and querying the DOM to only display one test suite at a time
Juho Vepsäläinen
@bebraw
@okanthony can you put your current implementation on github or so? i wonder if there's something in the mocha api that could help out
Anthony DeGennaro
@okanthony
@bebraw here's the branch and here's the require.context() implementation
Juho Vepsäläinen
@bebraw
cool, i'll try to check today after getting the urgent things done :+1:
Juho Vepsäläinen
@bebraw
@okanthony would it be cleaner to run the mocha tests in browser directly? reference: https://stackoverflow.com/a/42858362/228885
maybe it's worth checking what codesandbox is doing. i am missing the big picture a little bit
Anthony DeGennaro
@okanthony
Hmm I initially tried running mocha in the browser but wasn't able to filter the tests without resetting the state of the app. I'll take a look into codesandbox and see if there's anything I can use, I appreciate the help!
Logan Valentine
@krandom
Hi guys! How would I add eg "import { react-redux } " to globalInclude?
Juho Vepsäläinen
@bebraw
@okanthony it's likely worth looking into mocha apis. maybe they have something specific for this? just for reference, i wrote a browser oriented testing lib many moons ago (https://github.com/bebraw/bunit.js)
@krandom what's the use case? can you give some context?
Anthony DeGennaro
@okanthony
@bebraw oh nice, I’ll look into both, thanks!
Anthony DeGennaro
@okanthony
the mocha api has a bunch of methods that would handle what I'm trying to do, but I'm guessing I wouldn't be able to use the mocha-loader in conjunction with them?
Juho Vepsäläinen
@bebraw
@okanthony that's what i mean - i would look into using mocha without the loader
then you have more flexibility at least
Nikos
@QuantumInformation
thx for lunch today!
Juho Vepsäläinen
@bebraw
:+1:
George E. Papadakis
@phaistonian
hey @bebraw :)
Juho Vepsäläinen
@bebraw
hey
George E. Papadakis
@phaistonian
hey :)
Juho Vepsäläinen
@bebraw
feel free to post your question here, i'll get back to it after i'm done with the day's work
George E. Papadakis
@phaistonian
Thanks :)
So, say I have a SVG asset and I want to load it using the react-svg-loader. But I only want this to the case when directly importing it, i.e import "myLogo.svg" not when the asset is referenced in, say, <img src="myLogo.sg" /> in which case I need the file-loader to work
Juho Vepsäläinen
@bebraw
@phaistonian i can see two main ways 1. more specific config (include or so) 2. import "react-svg-loader!myLogo.svg" but that's not particularly nice. the loader chapter of the book provides more ideas
George E. Papadakis
@phaistonian
Yes, those are the way I can do i - the ones that also came to mind first
But this is a bit uggly
I was trying to figure out if using issuer in a certain way would do it
But it's also probably a dead-end
Juho Vepsäläinen
@bebraw
i would go with a config based solution. note that include accepts a function as well so that could be easier to dev and understand
George E. Papadakis
@phaistonian
yes, however include is path/file based
Can't limit it to, say, where it' s used
Juho Vepsäläinen
@bebraw
ok, maybe you can figure out a rule based on which to match then
George E. Papadakis
@phaistonian
Unfortunately, the same assets (in terms of paths) are referenced both as direct import but also as src="..."
One - hacky - solution would have been to be able to do src="!file-loader!..."
but we can't
George E. Papadakis
@phaistonian
(Or you can - solved it :)