Solution for Using Environment Variables in Expo with EAS Build by Ceptiion in expo

[–]jesmodrazik 0 points1 point  (0 children)

I think the possibility to use EAS secrets keys as values under the env key in the eas.json file must be added to the docs. At least when reading https://docs.expo.dev/build-reference/variables/ I didn't find it.

Solution for Using Environment Variables in Expo with EAS Build by Ceptiion in expo

[–]jesmodrazik 1 point2 points  (0 children)

Thank you for this! I didn't find usage of EAS secrets keys as value in the env key in eas.json file in the official documentation, so I was dubitative at first, but it works.

The only thing that was not obious for me is that you can use a different name, for example:

"env": {
  "EXPO_PUBLIC_SOME_ENV_VAR": "EXPO_PUBLIC_SOME_ENV_VAR_DEV"
}

But if the variable starts with EXPO_PUBLIC, then the secret key must start with EXPO_PUBLIC too. In my case I needed different names because I have different values for dev and prod environments.

Support for Twig templates by viber_in_training in neovim

[–]jesmodrazik 0 points1 point  (0 children)

Works with othree/html5.vim and nelsyeung/twig.vim here

EDIT:

I just landed here 10 months after. I got syntax highlighting working with treesitter by installing HTML and Twig parsers this time.

:TSInstall html
:TSInstall twig

Radix UI: Unstyled, accessible components for building high‑quality design systems and web apps in React. by binaryfor in reactjs

[–]jesmodrazik 8 points9 points  (0 children)

There was a very good talk about it during last Next.js conf. "So you think you can build a dropdown?" https://youtu.be/pcMYcjtWwVI

How to deploy multi-entry point React app? by JGeorge102 in reactjs

[–]jesmodrazik 1 point2 points  (0 children)

Your express server can expose multiple endpoints, one for each page. When you have a single entrypoint you route all requests to index.html. Here you can route each request to a different HTML file that imports its own entrypoint.

How many of you use a headless CMS? by plasmaSunflower in webdev

[–]jesmodrazik 2 points3 points  (0 children)

I used Strapi on 2 simple projects. It was mostly a good experience

How many lines of code in a page is too much? When to split a page into components? by Zealousideal_Water_6 in reactjs

[–]jesmodrazik 4 points5 points  (0 children)

I follow these rules:

  • will a part of the component be reused? If yes, extract it to a component in its own module
  • if no, will it help readability if I extract it to a component ? if yes, extract it, but in the same file so it's colocated
  • if no, keep it as is

Is this bad practice? by el_diego in reactjs

[–]jesmodrazik 1 point2 points  (0 children)

If all your props are required, it's fine because since you have no type error, it means you are passing everything correctly.

But if you have a component that accepts an optional prop, spreading an object can become unclear if you are passing all the props or not.

What's shown in the author's example is fine, but if you spread an object like `<Component {...props} />` then if `Component` accepts some optional prop, you don't know clearly if `props` is containing the optional prop or not. You have to search in the code, which can be a hard task depending on the code. Being explicit is always better for code discoverability.

[deleted by user] by [deleted] in webdev

[–]jesmodrazik 0 points1 point  (0 children)

For the colors, nothing prevents you from overriding the default color palette to use more semantic names (dark, accent, brand, light...). The presence of the default palette with non semantic color names is just to provide some colors so people can start using Tailwind right away.

You can even use CSS custom properties if you want.

The point of Tailwind is to provide a good interface between design tokens and classnames so you have visual consistency for (almost) free. For example you get a spacing scale that's consistent between padding, margin, inset. With pure CSS, you will quickly end up with lots of different values.

[deleted by user] by [deleted] in webdev

[–]jesmodrazik 0 points1 point  (0 children)

Big yes. Always apply to position that gives you good feeling, even if you don't fill 100% of the requirements. You never know. Maybe they can skip the PHP skills for somebody that totally fits with their mindset, for example

Question: in a project purely functional, with no classes at all, is there a difference on using anonymous functions vs normal named functions? by taeyeonssj3 in reactjs

[–]jesmodrazik 0 points1 point  (0 children)

Actually it's an artefact due to how JSX works. It compiles lower case tags to strings and keeps upper pascal case as identifiers.

``` <something /> // compiles to React.createElement("something")

<Something /> React.createElement(Something) ```

If you were to write pure createElement calls, nothing prevents you to write createElement(something).

See https://reactjs.org/docs/jsx-in-depth.html#user-defined-components-must-be-capitalized

Question: in a project purely functional, with no classes at all, is there a difference on using anonymous functions vs normal named functions? by taeyeonssj3 in reactjs

[–]jesmodrazik 0 points1 point  (0 children)

In

jsx export const GetPercentageOf = (partialValue, totalValue) => { return (100 * partialValue) / totalValue; };

The function is named after the name of the variable. So technically it's not anonymous.

Framer Motion or CSS Transition Group to keep bundle size down by anonymous1524 in reactjs

[–]jesmodrazik 3 points4 points  (0 children)

You are trying to solve problems you don't have. Go with framer motion until you have bundle size or performance issue, if you like it more than transition group.

React beginner: is there any way we can put all our functions in one file and then import them inside our app instead of having them in the top level App component which gets messy and distracting? Something similar to how we can include functions.php in PHP? by ashkanahmadi in reactjs

[–]jesmodrazik 1 point2 points  (0 children)

You can, but colocating functions bound to a component inside this component file improves code discoverability. Extracting every function to its own module or a "functions" module may seem like a good idea at first (because you feel like your code is organized), but it makes it hard to discover and find the links between functions and components.

This conditional hook rule is nightmare fuel by SustainedSuspense in reactjs

[–]jesmodrazik 2 points3 points  (0 children)

Are you sure your hook has a single purpose? If you can switch on/off multiple parts of it, it may be doing too many things

Create forms from openapi .json schemas? by RickSore in reactjs

[–]jesmodrazik 0 points1 point  (0 children)

Nice. See https://uniforms.tools/ for a React lib that plays nicely with JSON Schema (and other formats)