Giter Club home page Giter Club logo

Comments (9)

tannerwelsh avatar tannerwelsh commented on August 22, 2024 3

Just contributed funding for this issue on https://opencollective.com/aspect-build/projects/rules_js (payment from Twisp)

from bazel-examples.

alexeagle avatar alexeagle commented on August 22, 2024 1

This one is already being tracked:

Linting is busted right now because of the way eslint tries to extend from the next.js config. @gregmagolan will file an issue about that separately, it's probably a separate project.

The devserver in next.js currently restarts on each Bazel rebuild, it needs to be taught the ibazel_notify_changes protocol from https://github.com/bazelbuild/bazel-watcher#running-a-target. It looks to me like https://nextjs.org/docs/advanced-features/custom-server might give us the affordance to run their devserver but control when they refresh content from the disk. It will take a bit of experimentation to confirm.

from bazel-examples.

gregmagolan avatar gregmagolan commented on August 22, 2024 1

@tannerwelsh I made some progress on this this week. It doesn't look feasible (at least not without big patches to Next.js and webpack) to adapt the next.js devserver to play nicely with how Bazel lays out the runfiles of a binary so I abandoned that approach and now have a general purpose devserver/watchmode rule going in rules_js that instead adapts Bazel to what the Next.js devserver expects to find on disk. aspect-build/rules_js#540.

Should have something merged here sometime next week.

from bazel-examples.

gregmagolan avatar gregmagolan commented on August 22, 2024 1

Landed the change to generalize the next targets into a portable next() macro and add a working ibazel next dev devserver. 772bf64

Will still add an example up code sharing here in the next day or two.

from bazel-examples.

gregmagolan avatar gregmagolan commented on August 22, 2024 1

@tannerwelsh This PR should address the remaining items in your list: #128

LMK how it works out on your end and if you need anything else shown in here.

from bazel-examples.

tannerwelsh avatar tannerwelsh commented on August 22, 2024

This one is already being tracked:

Thanks! Updated the description to strike that from the specs.

Re: linting, thanks for the explanation re: why this would be more complicated. To start, these shouldn't be necessary for development so long as there's an option to run these commands outside of the Bazel context, i.e. with scripts in a package.json like already exists in the next.js example:

  "scripts": {
    "dev": "ibazel run //:dev",
    "build": "bazel build //:build",
    "start": "ibazel run //:start",
    "lint": "next lint"
  },

from bazel-examples.

tannerwelsh avatar tannerwelsh commented on August 22, 2024

That's great, thanks @gregmagolan! Looking forward to seeing it in action

from bazel-examples.

gregmagolan avatar gregmagolan commented on August 22, 2024

PR landed.

The devserver is working nicely now using the new js_run_devserver rule. Linting still doesn't run under Bazel but that is something I'd like to get to eventually.

from bazel-examples.

tannerwelsh avatar tannerwelsh commented on August 22, 2024

Dang this is looking great, thanks @gregmagolan ! I just did some preliminary poking around, and everything looks like it should translate nicely to our system. Once I get deeper into the weeds of translating this example into a real-world context, I'll follow up with any feedback/snags I bump into.

Thanks also to @alexeagle for coordinating! Really happy with the way this worked out.

from bazel-examples.

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.