Comments (9)
Just contributed funding for this issue on https://opencollective.com/aspect-build/projects/rules_js (payment from Twisp)
from bazel-examples.
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.
@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.
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.
@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.
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.
That's great, thanks @gregmagolan! Looking forward to seeing it in action
from bazel-examples.
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.
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)
- [FR]: Example of how to setup multiple `package.json` with `WORKSPACE` macros HOT 2
- [Bug]: vue example doesn't work HOT 4
- Question: How to add CSS from third party package? HOT 4
- How do we configure eslint binary for TypeScript projects HOT 4
- [Bug]: Running Nextjs example in Docker fails with `/app/apps/alpha/bin.runfiles/__main__/apps/alpha/bin.sh: line 379: cd: apps/alpha/dist: No such file or directory` HOT 1
- [Bug]: Windows 10 Angular ngc problem HOT 2
- [Bug]: next.js example does not build with `output: "standalone"` next config HOT 2
- [Question] How do I optimise for build speed with ng_lib? HOT 1
- [Bug]: Next.js and rules_ts are incompatible for custom tsconfig.json options HOT 3
- [FR]: vscode cannot find module
- [Bug]: react-cra example isn't building HOT 1
- [Bug]: react-cra example uses version of aspect_rules_ts that doesn't properly support JavaScript
- Why do you make lib-a and common the way you do? HOT 2
- [FR]: React Native monorepo HOT 3
- [Bug]: build fail when test file name contains capital letter HOT 1
- [Help]: following cra example, ibazel does not symlink pnpm store HOT 1
- [Bug]: Runfiles resolution is broken for oci_python_image example HOT 2
- `transitioned_image` is not used in `oci_go_image` exemple HOT 1
- feat: Add monorepo nestjs example HOT 3
- [Bug]: py_layers.bzl's interpreter layer also fetches dependencies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bazel-examples.