Skip to content

Commit

Permalink
Release: 5.0.0
Browse files Browse the repository at this point in the history
Merge pull request #32 from vovaspace/next
  • Loading branch information
vovaspace committed Feb 6, 2023
2 parents 058a9d3 + 5164c8a commit b56749a
Show file tree
Hide file tree
Showing 15 changed files with 9,312 additions and 11,405 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15
18
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISC License

Copyright 2021 Vladimir Lewandowski
Copyright Vladimir Lewandowski <[email protected]> (https://vovaspace.com/)

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Brandi has no dependencies, but requires the following globals in order to work:
## Production

By default, Brandi will be in development mode. The development mode includes warnings about common mistakes
and `capture()/resotre()` `Container` methods.
and `capture()/restore()` `Container` methods.

Don't forget to set `process.env.NODE_ENV` to `production` when deploying your application.

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Brandi has no dependencies, but requires the following globals in order to work:
## Production

By default, Brandi will be in development mode. The development mode includes warnings about common mistakes
and `capture()/resotre()` `Container` methods.
and `capture()/restore()` `Container` methods.

Don't forget to set `process.env.NODE_ENV` to `production` when deploying your application.

Expand Down
2 changes: 1 addition & 1 deletion packages/brandi-react/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISC License

Copyright 2021 Vladimir Lewandowski
Copyright Vladimir Lewandowski <[email protected]> (https://vovaspace.com/)

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
Expand Down
4 changes: 2 additions & 2 deletions packages/brandi-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "brandi-react",
"version": "4.0.2",
"version": "5.0.0",
"description": "React bindings for Brandi — the dependency injection container.",
"main": "./lib/brandi-react.js",
"module": "./lib/brandi-react.mjs",
Expand Down Expand Up @@ -48,7 +48,7 @@
"container"
],
"peerDependencies": {
"brandi": "^3 || ^4",
"brandi": "^3 || ^4 || ^5",
"react": "^16.8.0 || ^17 || ^18"
}
}
10 changes: 8 additions & 2 deletions packages/brandi-react/src/container/ContainerProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ export const ContainerProvider: React.FunctionComponent<{
isolated?: boolean;
}> = ({ children, container, isolated = false }) => {
const parentContainer = useContainer(false);
const clonedContainer = React.useMemo(() => container.clone(), [container]);

if (!isolated) clonedContainer.extend(parentContainer);
const extend = !isolated ? parentContainer : null;

const clonedContainer = React.useMemo(() => {
const cloned = container.clone()
if (extend) cloned.extend(extend)
return cloned
}, [container, extend]);


return (
<ContainerContext.Provider value={clonedContainer}>
Expand Down
2 changes: 1 addition & 1 deletion packages/brandi/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISC License

Copyright 2021 Vladimir Lewandowski
Copyright Vladimir Lewandowski <[email protected]> (https://vovaspace.com/)

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
Expand Down
2 changes: 1 addition & 1 deletion packages/brandi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Brandi has no dependencies, but requires the following globals in order to work:
### Production

By default, Brandi will be in development mode. The development mode includes warnings about common mistakes
and `capture()/resotre()` `Container` methods.
and `capture()/restore()` `Container` methods.

Don't forget to set `process.env.NODE_ENV` to `production` when deploying your application.

Expand Down
2 changes: 1 addition & 1 deletion packages/brandi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "brandi",
"version": "4.0.2",
"version": "5.0.0",
"description": "The dependency injection container.",
"main": "./lib/brandi.js",
"module": "./lib/brandi.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/brandi/src/registries/callableRegistry.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { UnknownCreator } from '../types';

export const callableRegistry = new Map<UnknownCreator, boolean>();
export const callableRegistry = new WeakMap<UnknownCreator, boolean>();
7 changes: 3 additions & 4 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,10 @@ module.exports = {
respectPrefersColorScheme: true,
},
algolia: {
apiKey: 'de05f6a0bc7656dcc33b32c4f34f45fd',
indexName: 'brandi',
appId: 'ZJ99TQS6KK',
apiKey: '4ca1bea483527bfd468f79bf940899cb',
indexName: 'brandi-js',
},
sidebarCollapsible: false,
hideableSidebar: false,
},
presets: [
[
Expand Down
Loading

1 comment on commit b56749a

@vercel
Copy link

@vercel vercel bot commented on b56749a Feb 6, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.