Giter VIP home page Giter VIP logo

Comments (3)

travis avatar travis commented on July 28, 2024

I dug into this a bit - it turns out that turning on our standard linter (eg, tsc --build && eslint '**/*.{js,jsx,ts,tsx}') turns up a LOT of issues, especially the TypeScript compilation phase.

Many of the issues are easy to fix automatically, but many of them look like they are fairly tricky Preact-related typing issues. While we could invest time into fixing this, it doesn't seem especially "center of plate" for our team right now, especially since I'm already interested in moving us over to a more full-featured framework (see #419).

Given this, I'd like to propose we solve this one of two ways:

  1. Ditch preact and "rebase" w3console on top of the Vite react-ts starter template which has a linter setup by default that works well with Vite (the preact template, by contrast, has no linter configured): https://stackblitz.com/edit/vitejs-vite-hex6t4?file=index.html&terminal=dev

  2. Ditch Vite entirely and move to Next.js - I think this is the path of least resistance right now and wouldn't be too much of a lift - we'd be able to delete the routing logic that replicates default Next.js routing, so it should make things simpler.

@alanshaw @olizilla @Gozala thoughts?

from w3ui.

Gozala avatar Gozala commented on July 28, 2024

I have no strong feeling on any of this. I would however propose another (perhaps) controversial solution to the problem. What if we just use prettier and and call it a day, it will address most issues and provide consistency without been nit picky on things that I personally hardly ever find useful.

We could even setup https://github.com/marketplace/actions/prettier-action to just automate reformatting at PR level

from w3ui.

travis avatar travis commented on July 28, 2024

Ah so we actually were using prettier, but it didn't play nicely with eslint so I removed it:

cafefb0

The other issue is that one of the main problems here is that tsc --build is the part that's failing in w3console and using prettier wouldn't do anything to fix that - we need to either debug and fix (what appear to be) some fairly thorny type incompatibilities between React and Preact or just move w3console to React. Given that it seems like w3console is trending toward being the main UI we'll deploy on top of w3up, I'm more inclined to just move it to its own project and use Next.js rather than Vite - should mostly be a matter of copying src files into a new project because I've tried to build it in line with Next.js's major architectural decisions. Next.js has a more coherent/well supported type checking and linting story so this problem would mostly disappear with that move.

All that being said I think this is probably a decision we should make after we have a larger conversation about how we want to roll w3up out to web3.storage and nft.storage users because the "right" move is going to be heavily dependent on our plans for that.

from w3ui.

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.