Skip to content

Conversation

aciceri
Copy link
Member

@aciceri aciceri commented Jul 18, 2022

I started working on #12 by @Synthetica9 with the goal of nixify the frontend too.

@Synthetica9
Copy link

What formatter do you use btw? As far as I'm aware we use nixpkgs-fmt for most projects

@Synthetica9 Synthetica9 force-pushed the aciceri/use-flake-reprise branch from 409379d to fd9cfbb Compare July 22, 2022 21:53
@aciceri
Copy link
Member Author

aciceri commented Jul 23, 2022

What formatter do you use btw? As far as I'm aware we use nixpkgs-fmt for most projects

Oops, I enabled Alejandra to test it (seems really well done) and I think I forgot it enabled when writing this, I'll use nixpkgs-fmt next time.

@samuelWilliams99 samuelWilliams99 mentioned this pull request Jul 29, 2022
@Synthetica9 Synthetica9 marked this pull request as ready for review July 29, 2022 21:38
@Synthetica9 Synthetica9 force-pushed the aciceri/use-flake-reprise branch from c23a658 to 8d6cd34 Compare July 29, 2022 21:51
@Synthetica9
Copy link

This is ready for merge IMO, but I didn't want to merge it myself

@Synthetica9 Synthetica9 requested a review from t4ccer August 2, 2022 06:19
@samuelWilliams99
Copy link
Contributor

samuelWilliams99 commented Aug 3, 2022

Looks like seabug-contracts is still a submodule? (added recently in Calum's pr) (unless my UI is being weird)

@samuelWilliams99
Copy link
Contributor

@rynoV Can you verify this is working as expected?

Copy link
Contributor

@rynoV rynoV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Biggest issue right now is buildFrontend2.sh won't work and needs to be ported into nix

@@ -160,6 +160,22 @@
"type": "github"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is expected, but when I ran nix build --recreate-lock-file there were a lot of changes to this file. Is it out of date?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea, there are several new inputs, maybe this is the reason?

@rynoV
Copy link
Contributor

rynoV commented Aug 29, 2022

I can't spend any more time on this, but to summarize the changes I planned:

Dev environment

Currently there is no easy development experience. To fix this:

  1. Use dev shell provided by dream2nix (.#d2nFlakeOutputs.devShells.x86_64-linux.default in this pr ) which is supposed to setup node_modules for us
    • I was running into an issue where the node_modules did not have all the modules, for example craco could not find webpack and webpack was not in node_modules
    • Also the node_modules created by dream2nix was a symlink instead of an actual folder (which I expected from this line, so I'm not sure what I'm missing there
  2. Add seabug-contracts as a dependency in package.json for nft-marketplace, e.g. "seabug-contracts": "github:mlabs-haskell/seabug-contracts"
  3. During development, remove node_modules/seabug-contracts and symlink the local clone of seabug-contracts
  4. Do the rest of the stuff buildFrontend2.sh does

Prod build

I haven't checked that this works, and I'm also not exactly sure what our production build process is

@aciceri
Copy link
Member Author

aciceri commented Aug 29, 2022

I was running into an issue where the node_modules did not have all the modules, for example craco could not find webpack and webpack was not in node_modules

Just a guess (probably wrong): maybe this is not dev dependency?

Moreover you could automatize the hacky symlinking overriding/adding a shellHook to the development shell to have it executed automatically and transparently.

Just another (probably pointless) idea: if we weren't using Nix I would say that since we are using docker-compose the best option would be to create another set of Docker images expressly for development that would mount the host local folders with the sources to the containers volumes. Is this something doable with arion too maybe?

@rynoV
Copy link
Contributor

rynoV commented Aug 29, 2022

Just a guess (probably wrong): maybe this is not dev dependency?

craco isn't a dev dependency (maybe it should be). This was another weird thing I saw: the dream2nix noDev setting didn't seem to be respected; we set that to false, but dev dependencies weren't included in node_modules. If I manually copied them over to dependencies, they were included in node_modules.

Moreover you could automatize the hacky symlinking overriding/adding a shellHook to the development shell to have it executed automatically and transparently.

The hacky stuff was basically what dream2nix's dev shell is supposed to do already (I wasn't aware of that feature until you pointed it out), which is why I suggested we try to use that, but it's behaving strangely as described above.

Just another (probably pointless) idea: if we weren't using Nix I would say that since we are using docker-compose the best option would be to create another set of Docker images expressly for development that would mount the host local folders with the sources to the containers volumes. Is this something doable with arion too maybe?

I don't know how feasible that would be, and I'm also not sure how much time we want to spend on this, need to talk to @samuelWilliams99

@rynoV
Copy link
Contributor

rynoV commented Aug 30, 2022

Plutonomicon/cardano-transaction-lib#956 might be useful

@aciceri
Copy link
Member Author

aciceri commented Oct 28, 2022

This is mainly done now, I only have to rewrite current docs that now are obsolete.

@aciceri aciceri force-pushed the aciceri/use-flake-reprise branch from f8f302b to e8f45b4 Compare December 21, 2022 17:32
@aciceri aciceri force-pushed the aciceri/use-flake-reprise branch from e8f45b4 to 2ff161a Compare December 21, 2022 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants