Git Product home page Git Product logo

core's Introduction

WIP

core's People

Contributors

dimbreath avatar norseftx avatar penguinstyles avatar pogseal avatar xhomu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

core's Issues

Can't login when running production build locally

  • Login works fine when yarn; yarn dev;
  • Login works fine on live site mana.wiki in production.
  • Login doesn't work when yarn; yarn:build; yarn start:core.

If it's an env variable issue. We may need to update .env.example with all the required variables.

Checking invalid post crashes server

The way the post fetches work atm would crash the server due to graphql type errors:

https://github.com/manawiki/core/blob/main/app/routes/_site+/p+/utils/fetchPostWithSlug.server.ts

  • invariant(post, "Post doesn't exist");

https://github.com/manawiki/core/blob/main/app/routes/_site+/p+/utils/fetchPostComments.server.ts

  • postParentId: "JSON!", this triggers graphql type error

Because these graphql queries are dependent each other, one's invalid would trigger a server crash onto the other. We should rework these queries a bit safer so it would just render a Post not found.

Sitemap Broken

Sitemaps have been broken since the subdomain switch. We'll need to fix it to get sites properly indexed.

Custom Domain home page setup

To determine if a site has a custom domain, check for _/app/custom/config

import { config } from "./app/_custom/config";
if (config.domain) then generate custom routes.

We only want to generate a route structure for the home (index) page.

Slate Post Update broken

When login with edit privileges, the post updates section are missing:

image

Shows dom error in logs:

image

Login users hydration error

This is probably caused by the newly implemented cache for $siteId/_index.tsx draft/publish content mismatch for login users.

localhost:3000/admin cors error

Sporadically cors error would trigger on the Payload admin panel on local,

image
Access to fetch at 'https://mana.wiki/api/users/me' from origin 'http://localhost:3000' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'.

iOS environment.

Disabling cors plugin in core.server.ts would clear it, so it's something with our mana.config cors.

Also seems to be cookie related?

Decrease Cache Duration for Logged-In Users

Currently, the cache duration for logged-in users appears to be ridiculously high, which significantly impacts the editor's ability to quickly edit newly created/recently edited pages and causes potential data staleness.

While testing, I discovered that it takes roughly five minutes from the time a new entry is created within a collection to the time it displays to users. For anonymous users, five minutes should be sufficient, however, for logged-in users who always need to be shown the most up-to-date information available to prevent conflicting edits, we should reduce cache times.

Refactor Tooltip.tsx

Unfortunately, react-dom/server doesn't lazy load well, so we have to take a different approach with this.
See #196

@pogseal

react-dom-server is leaking into the client bundle because it's used in eactly one place in Tooltip.tsx:

image

Removing it cut about 70kb off the bundle:

image

Hash links not working properly

ref: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/hash

hash links (#) have weirdly snappy behaviors that felt jarring.

  1. https://mana.wiki/starrail/collections/characters/1213
  2. Click on Profile

I have seen this manifest in a couple ways,

  • First click does nothing, second click works.
  • the scroll works, but there's a quick snap up to top first.

Not sure if this is an upstream Remix bug or something wonky with our core, might be something we catch eventually when refactoring root/layout.

Admin Hydration Error SoloEditor

Seems like there's something that's causing hydration mismatch when SoloEditor is rendered atm. The same slate data that ran with the readonly didn't have the same problem.

This does not seem to be an error originating from any server side lru-caching.

Uncaught Error: Cannot resolve a DOM node from Slate node: 

image


I'm currently isolating the damage by adding in an Suspense boundary.

Since this only affects admin users, and doesn't actually affect client-side functionality of Slate, it might not be an high priority fix atm.

Checked state not being set by default on local

Works only in production. Likely related to how the checked state is set on the RadioGroup headless UI component.

          <RadioGroup.Option
                                          key={row.id}
                                          value={row}
                                       >
                                          {({ active, checked }) => (
                                             <RadioGroup.Label
                                                className={clsx(
                                                   checked
                                                      ? "bg-zinc-100 font-semibold dark:bg-zinc-700/80"
                                                      : "text-1",
                                                   "group relative flex w-full cursor-pointer items-center justify-between gap-2 rounded-md px-3 py-2"
                                                )}
                                             >
                                                <time
                                                   className="flex items-center gap-1.5 text-sm group-hover:underline"
                                                   dateTime={row?.updatedAt}
                                                >
                                                   {format(
                                                      new Date(
                                                         row?.updatedAt as string
                                                      ),
                                                      "MMMM d, hh:mm aaa"
                                                   )}
                                                </time>
                                                {index == 0 && (
                                                   <span className="rounded-full bg-zinc-200 px-2 py-0.5 text-[10px] font-bold uppercase dark:bg-zinc-600 dark:text-white">
                                                      Live
                                                   </span>
                                                )}
                                             </RadioGroup.Label>
                                          )}
                                       </RadioGroup.Option>

Replicate by opening the history modal on local vs production

Screenshot 2023-08-29 at 12 48 27 PM Screenshot 2023-08-29 at 12 47 59 PM

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.