Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use example-data package and fix other example imports #10280

Merged
merged 14 commits into from
Aug 29, 2019

Conversation

ecraig12345
Copy link
Member

@ecraig12345 ecraig12345 commented Aug 27, 2019

Pull request checklist

  • Include a change request file using $ yarn change

Description of changes

Fix example imports:

  • Use the new @uifabric/example-data package everywhere that was previously using the old example data files
  • Deprecate example data exports from example-app-base (anyone using these should switch to the example-data package)
  • Remove all remaining relative imports
  • Remove "deep" imports where possible
  • Remove direct imports from packages re-exported from OUFR

And the corresponding updates to the lint-imports script:

  • Remove remaining relative import exceptions (except scss files)
  • Check for "deep" imports (with an exception list of files that aren't exported anywhere)
  • Check for direct imports from packages re-exported from OUFR (based on a hardcoded list)

And other example-related issues:

  • Update codepen-loader to work with the new package
  • Fix some incorrectly-named examples in charting and experiments
  • Add index files and a root-level file for SelectedItemsList to facilitate getting rid of deep imports
Microsoft Reviewers: Open in CodeFlow

@msft-github-bot
Copy link
Contributor

msft-github-bot commented Aug 27, 2019

Component Perf Analysis

No significant results to display.

All results

Scenario Master Ticks PR Ticks Status
BaseButton 820 790
BaseButton (experiments) 1044 1054
DefaultButton 1082 1074
DefaultButton (experiments) 2057 2068
DetailsRow 3486 3461
DetailsRow (fast icons) 3472 3486
DetailsRow without styles 3157 3252
DocumentCardTitle with truncation 34750 34654
MenuButton 1401 1433
MenuButton (experiments) 3680 3639
PrimaryButton 1230 1268
PrimaryButton (experiments) 2131 2132
SplitButton 2979 2975
SplitButton (experiments) 7301 7315
Stack 503 521
Stack with Intrinsic children 1207 1203
Stack with Text children 4519 4484
Text 393 412
Toggle 907 935
Toggle (experiments) 2383 2349
button 57 70

@ecraig12345
Copy link
Member Author

Marking as do not merge while I resolve an issue with the codepen loader.

const importStatementRegex = /^import [{} a-zA-Z0-9_,*\r?\n ]*(?:from )?['"]{1}([.\/a-zA-Z0-9_@\-]+)['"]{1};.*$/;
const pkgNameRegex = /^(@[a-z\-]+\/[a-z\-]+)|([a-z\-]+)/;
const importStatementGlobalRegex = /^import [^'"]*(?:from )?['"]([^'"]+)['"];.*$/gm;
const importStatementRegex = /^import [^'"]*(?:from )?['"]([^'"]+)['"];.*$/;
Copy link
Member

Choose a reason for hiding this comment

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

Is there a fix here or is this just optimization of the same searches? (I'm sure you've tested but wanted to make sure they were still working.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Optimization. Based on running the script and on these tests it seems to work fine. https://regex101.com/r/XWQ4Eq/1

'@uifabric/merge-styles': 'Styling',
'@uifabric/styling': 'Styling',
'@uifabric/utilities': 'Utilities'
};
Copy link
Member

Choose a reason for hiding this comment

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

👍

@KevinTCoughlin
Copy link
Member

KevinTCoughlin commented Aug 28, 2019

Thanks for mentioning:

Don't export old example data helpers from example-app-base (anyone using these can switch to the example-data package)

I'll have to update our Fabric 7 + ODSP branch to reflect the above change.

Copy link
Member

@KevinTCoughlin KevinTCoughlin left a comment

Choose a reason for hiding this comment

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

The removal of data exports from example-app-base is a breaking change for consumers (ODSP). Can we leave the export removal for at least a major release?

@ecraig12345
Copy link
Member Author

The removal of data exports from example-app-base is a breaking change for consumers (ODSP). Can we leave the export removal for at least a major release?

I can revert that part--though those things arguably shouldn't have been exported to begin with, and example-app-base has never had the same API stability guarantees as our primary libraries. (I finally updated the example-app-base readme to note that.)

@size-auditor
Copy link

size-auditor bot commented Aug 29, 2019

Asset size changes

Project Bundle Baseline Size New Size Difference
office-ui-fabric-react ExtendedPicker 86.916 kB 86.181 kB BelowBaseline     -735 bytes

ExceedsTolerance Over Tolerance (1024 B) ExceedsBaseline Over Baseline BelowBaseline Below Baseline New New Deleted  Removed 1 kB = 1000 B

Baseline commit: 7a493e8a0915fd826cef36e70891979d09ca9b46 (build)

@ecraig12345 ecraig12345 merged commit 899983a into microsoft:master Aug 29, 2019
@ecraig12345 ecraig12345 deleted the example-data-2 branch August 29, 2019 23:09
@msft-github-bot
Copy link
Contributor

🎉@uifabric/experiments@v7.13.5 has been released which incorporates this pull request.:tada:

Handy links:

@msft-github-bot
Copy link
Contributor

🎉office-ui-fabric-react@v7.28.3 has been released which incorporates this pull request.:tada:

Handy links:

@msft-github-bot
Copy link
Contributor

🎉@uifabric/example-app-base@v7.6.3 has been released which incorporates this pull request.:tada:

Handy links:

@msft-github-bot
Copy link
Contributor

🎉@uifabric/codepen-loader@v7.0.8 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants