Skip to content

feat: Global context shim#23324

Merged
ling1726 merged 17 commits into
microsoft:masterfrom
ling1726:feat/init-global-context
Jun 1, 2022
Merged

feat: Global context shim#23324
ling1726 merged 17 commits into
microsoft:masterfrom
ling1726:feat/init-global-context

Conversation

@ling1726

@ling1726 ling1726 commented May 30, 2022

Copy link
Copy Markdown
Contributor

Adds a shim for createContext that will register the context to the
global scope, and reuse a globally scoped context if it already exists

ling1726 added 5 commits May 30, 2022 13:01
Autogenerated from `yarn create-package`
Adds a shim for `createContext` that will register the context to the
global scope, and reuse a globally scoped context if it already exists
@ling1726 ling1726 changed the title Feat/init global context feat: Global context shim May 30, 2022
@fabricteam

fabricteam commented May 30, 2022

Copy link
Copy Markdown
Collaborator

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
global-context
createContext
0 B
0 B
533 B
341 B
🆕 New entry
global-context
createContextSelector
0 B
0 B
563 B
354 B
🆕 New entry

🤖 This report was generated against e303ce6bf879c989f2de9558be581bbfac2ae55f

@codesandbox-ci

codesandbox-ci Bot commented May 30, 2022

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 17cf4eb:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@size-auditor

size-auditor Bot commented May 30, 2022

Copy link
Copy Markdown

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: e303ce6bf879c989f2de9558be581bbfac2ae55f (build)

Comment thread packages/react-components/global-context/src/index.ts Outdated
@ling1726 ling1726 marked this pull request as ready for review May 31, 2022 14:14
@ling1726 ling1726 requested a review from a team as a code owner May 31, 2022 14:14
@layershifter

Copy link
Copy Markdown
Member

Would you mind to add bundle size fixtures?

Comment thread packages/react-components/global-context/bundle-size/Default.fixture.js Outdated
@ling1726 ling1726 requested review from Hotell and layershifter May 31, 2022 14:34
},
"dependencies": {
"@fluentui/react-context-selector": "9.0.0-rc.10",
"@fluentui/react-theme": "9.0.0-rc.9",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"@fluentui/react-theme": "9.0.0-rc.9",

Please also remove other unrelated dependencies, too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah good catch, I did a bad merge commit

@ling1726 ling1726 closed this Jun 1, 2022
@ling1726 ling1726 reopened this Jun 1, 2022
@ling1726 ling1726 enabled auto-merge (squash) June 1, 2022 14:05
@ling1726 ling1726 merged commit 5090df2 into microsoft:master Jun 1, 2022
marwan38 pushed a commit to marwan38/fluentui that referenced this pull request Jun 13, 2022
* chore: bootstrap @fluentui/global-context package

Autogenerated from `yarn create-package`

* fix codeowners

* update md

* feat: Global context shim

Adds a shim for `createContext` that will register the context to the
global scope, and reuse a globally scoped context if it already exists

* Add context selector shim and node + browser tests

* update md

* fix tsdoc

* add bundlesize

* Update packages/react-components/global-context/bundle-size/Default.fixture.js

Co-authored-by: Oleksandr Fediashov <[email protected]>

* custom webpack config

* Update packages/react-components/global-context/bundle-size/createContextSelector.fixture.js

Co-authored-by: Oleksandr Fediashov <[email protected]>

* add README

* remove react-theme

* remove griffel

Co-authored-by: Oleksandr Fediashov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants