croz-ltd / nrich-frontend Goto Github PK
View Code? Open in Web Editor NEWReact monorepo providing bindings to simplify the integration with nrich libraries.
License: Apache License 2.0
React monorepo providing bindings to simplify the integration with nrich libraries.
License: Apache License 2.0
Add licence header to all source files
At the moment, source files don't contain licence header, take a look at e.g. Spring where it's present.
There are no licence headers in any source files.
There should be same licence header in all source files.
A main GitHub Action for building the project is needed.
See nrich for an example script. Note: that one is a Java project.
The script should run tests as part of the build.
No GitHub action present.
Main "build" GitHub action present.
With the latest nrich update, a new property called timestamp
was provided from the backend in order to track the notification with a unique property value in the notification store. However, the timestamp
property is treated like a string
a needs to be cast to a Date
in order to support the usage of Date-related functions in the codebase of the nrich-notification-core
module.
Attempt to call any backend endpoint for notifications from the notification demo.
The notifications should be displayed correctly using the UI module.
The notifications are not displayed using the UI module.
yup version: 0.28.5
When backend validation does not specify that field has to be @NotNull
or @NotBlank
then include .nullable()
when generating yup schema for that field.
Current behaviour is that the generated yup schemas expect that every field is not nullable, which is quite problematic when these fields can actually be null. For instance, when updating an entity values returned from the backend for some fields are null
(instead of undefined
) and this registers as invalid when it is not.
Fields that are nullable should accept null
value.
A override
schema can be added that overrides the generated schema with nullable value, but this brings additional confusion with validation.
Add code coverage integration with codecov.io.
See nrich for example. Note: that one is a Java project.
Add code coverage integration with codecov.io so we can have a graphic representation of the code coverage. Add test report generation and publishing to the main "build" GitHub Action.
No integration with codecov.io.
Integration with codecov.io present.
Currently, url is required parameter of FormConfigurationProvider
. On backend, there is a default url (/nrich/form/configuration
) which users will rarely change. To prevent every project to have to define this parameter, a default could be added.
url must be specified every time FormConfigurationProvider
is used.
Url should not be required prop.
To add an url :)
Align line endings for all files to eslint config.
Line endings are not aligned in all files. Eslintrc needs to be updated to match editorconfig and unaligned files should be updated.
Files are not aligned with eslint.
All files use LF for line endings and eslint configuration reflects that
Add open source license to GitHub project.
See nrich for example. There, we used Apache License 2.0, so, we suggest using it here as well.
Add open source license to GitHub project before it becomes public.
No open source license present.
Open source license applied.
Change type of FormConfigurationConfiguration.requestOptionsResolver
Change type of FormConfigurationConfiguration.requestOptionsResolver
from () => Record<string, string>
to () => RequestInit
.
This change allows for a type safe way of defining additional configuration options to send with the fetch request.
With the current type Record<string, string>
it isn't possible to add authentication information to the fetch request.
I tried using { "headers.Authorization": "Bearer token" }
which does not work.
With the type being RequestInit
the following would be valid:
{
headers: {
Authorization: "Bearer token",
}
}
Abusing the as
operator to change the type to any
as shown below.
function Demo() {
const getRequestParams = (): RequestInit => ({
headers: {
Authorization: "Bearer token",
},
});
return (
<FormConfigurationProvider
url="/nrich/form/configuration"
requestOptionsResolver={getRequestParams as () => any}
>
{...}
</FormConfigurationProvider>
);
}
In order to simplify semantic versioning, consider using Changesets, along with Changesets GitHub Action.
This will ensure that the modules are properly versioned, and will force the user to increase the version if something has changed in the source code. Alongside that, the GitHub Action will open a PR with relevant version changes each time a push has been made to the master
branch. Once that PR is merged, the modules will be published to the NPM registry.
Manual versioning.
Automatic versioning of modules.
Considering the increasing complexity of maintaining custom build scripts, it would be wise to move to something more easily scalable, such as a build management system like Turborepo.
This would enable us to more efficiently build "pipelines" which would propagate across all of the lib workspaces, consequently decreasing command run times.
Custom build scripts are applied to be able to build all of the workspaces.
Integrate Turborepo into the repository and delete old build scripts, along with abstractingrelevant common configs to separate workspaces.
Currently, useYupFormConfiguration
hook returns ObjectSchema<any>
. This should be extended to provide option to use generics when user has defined type for validated form.
This could be mostly beneficial when used together with strongly typed form libraries, like react-hook-form
useYupFormConfiguration
hook returns ObjectSchema<any>
type RegistrationForm = {
username: string,
password: string,
};
const configuration = useYupFormConfiguration<RegistrationForm>(formId); // returns ObjectSchema<RegistrationForm>
Casting via unknown, but that is big code smell.
const configuration = useYupFormConfiguration(formId) as unknown as ObjectSchema<RegistrationForm>
Add more extensive documentation for the notification and form-configuration modules, with short example of usage
Documentation in Readme.mds does not exist for specific modules.
Documentation in Readme.mds does exist for specific modules.
Tests show warnings when using renderHook
method as the @testing-library/react-hooks
is not compatible with React 18. renderHook
method was migrated to @testing-library/react
but without error
field, which is used in useYupFormConfiguration
test.
This points to a flaw in useYupFormConfiguration
where nrich throws an error when called with non-existing formId
. To handle that, user should wrap that hook use in try-catch, which breakes the rules of hooks.
API should be changed so useYupFormConfiguration
returns undefined on non-existing formId
so it could be used without breaking the rules of hooks.
Visible when running should throw error for unknown formId
in use-form-configuration.test.ts
.
For test to run without warning and for API to not throw error.
Tests have warning for React 18, and API throws an error.
Add ADR template and decisions.
See nrich for example.
We would like a way of tracking our architecture decisions in the project as to make onboarding of new developers easier
and keep track of important changes inside the project.
No explanation of the current architecture exists.
A list of architecture decision records exists explaining the current state of project. All future decisions are also recorded.
Define branch protection and pull request rules after the repo becomes public.
Configure same settings as in nrich.
Define and add
No branch protection nor pull request rules present.
Branch protection and pull request rules present.
Support generating documentation from TSDoc in form HTML and deploy it to GitHub Pages in the execution of the build workflow on the master branch.
No documentation is being generated and/or deployed to GitHub Pages.
Generate and deploy HTML documentation to GitHub Pages.
Vite environment, Typescript
When using Vite, nrich dependency must be imported from dist
. This is problematic because most IDEs will auto-import from root.
Also, it is a runtime error, not compiletime.
@croz/nrich-notification-core
import { useNotifications } from "@croz/nrich-notification-core";
No errors
Error for import.
Use import from dist: import { useNotifications } from "@croz/nrich-notification-core/dist";
Create nrich-registry module as frontend part of nrich-registry.
The module should have simple API to create tables and forms for searching, creating, updating and deleting registry entries..
The module does not exist.
Add missing GitHub templates/items in the Community Standards.
Take a look at the configured templates in nrich and add them analogously.
Add missing GitHub templates/items in the Community Standards when the project becomes public.
There are missing GitHub templates in the Community Standards.
There are no missing items in the GitHub Community Standards.
Add GitHub badges to main README.md.
See nrich for example.
Add badges for the "build" GitHub Action, for the open source license and for codecov.
No GitHub badges in main README.md.
GitHub badges added to main README.md.
Currently the only way to use the notifications API is via the useNotifications
hook. There are instances where we need just standard JS functions to satisfy the React naming conventions and linters. One such example is using the notifications with API calls or related interceptors which are not a hook or part of a React component.
As-is, the current logic would work even outside of React components, so it's basically only required to re-export under a different naming convention.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.