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

Add size check to react-northstar build #16686

Merged
merged 51 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
793273e
add size check
Jan 28, 2021
aa6ff50
Update apps/test-bundles/package.json
petdud Jan 28, 2021
ec0add7
Update apps/test-bundles/webpackUtils.js
petdud Jan 28, 2021
e9f0aa4
Merge branch 'master' into add-size-check-to-react-n-build
ecraig12345 Jan 29, 2021
85fb922
Change the way how we bundle size
Feb 3, 2021
3c6269c
Add fs-extra + refactor
Feb 3, 2021
169de6a
Add new job in pipeline
Feb 4, 2021
ad3b020
Merge json to single file
Feb 8, 2021
efc9b57
Separate the merge job
Feb 8, 2021
ecbb009
add file path
Feb 8, 2021
86f7b95
Fix script merge
Feb 8, 2021
aebcdb1
Refactor code
Feb 9, 2021
2a551b3
Remove packages and build them in pipeline
Feb 9, 2021
f4672b4
Merge remote-tracking branch 'upstream/master' into add-size-check-to…
Feb 9, 2021
aaca8d1
fix environment in pipeline
Feb 9, 2021
5537d5a
add comment to create fixtures
Feb 9, 2021
09f7c70
Merge remote-tracking branch 'upstream/master' into add-size-check-to…
Feb 9, 2021
7d9d39e
fix unsupported characters in pipeline names
Feb 9, 2021
8d88c00
fix pipeline jq
Feb 9, 2021
507dade
fix merge artifact
Feb 9, 2021
1aa7ccd
Previous path and json name and path
Feb 9, 2021
49151ac
update pipeline test
Feb 9, 2021
5aca7cb
Publish path
Feb 9, 2021
d5cf7f0
Merge branch 'master' of https://github.com/microsoft/fluentui into a…
Feb 10, 2021
39498eb
Fix single entry package import
Feb 10, 2021
e1aeb18
Fix bundle size for react
Feb 10, 2021
352cd22
fix folder import for build-react pipeline
Feb 10, 2021
5ecf3c8
fix Octal literal in strict mode error
Feb 11, 2021
1fc7be5
fix the path for import with path.normalize
Feb 11, 2021
84359b3
remove absolute path
Feb 11, 2021
9ced038
add comment
Feb 11, 2021
de1333d
Merge remote-tracking branch 'upstream/master' into add-size-check-to…
Feb 11, 2021
29f8b4f
Remove task to install node and replace it with template file
Feb 11, 2021
b1fd7d6
Rename output file name for bundle size
Feb 11, 2021
80f0a64
fix bundle-size-collect js
Feb 11, 2021
d998570
add compact option in jq bundlesize pipeline
Feb 14, 2021
251b7e9
Merge remote-tracking branch 'upstream/master' into add-size-check-to…
Feb 14, 2021
32b5e20
Test json from different build
Feb 14, 2021
02bb807
Test new path
Feb 14, 2021
b48903c
fix build type
Feb 15, 2021
bb5a381
Change path for artifact test build
Feb 15, 2021
127b4c9
test
Feb 15, 2021
5dfa08a
add downloadtype single
Feb 15, 2021
f8ccec9
Add devopsAssemblyArtifactName to sizeauditor json
Feb 15, 2021
5954678
Change devopsAssemblyArtifactName to drop
Feb 15, 2021
cf73620
Rename bundlesize.json to bundlesizes
Feb 15, 2021
c238438
bundle-size
Feb 15, 2021
7968e2d
experiment name for devops folder
Feb 15, 2021
dba1b97
Revert last changes with devopsDropFolder
Feb 15, 2021
07fb870
Merge remote-tracking branch 'upstream/master' into add-size-check-to…
Feb 16, 2021
e056ee6
Refactor and additional comment
Feb 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/test-bundles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@fluentui/react": "^8.0.0-beta.43",
"@fluentui/react-button": "^1.0.0-beta.23",
"@fluentui/react-compose": "^1.0.0-beta.10",
"@fluentui/react-northstar": "^0.51.0",
petdud marked this conversation as resolved.
Show resolved Hide resolved
"@fluentui/scripts": "^1.0.0",
"parallel-webpack": "^2.6.0",
"webpack-bundle-analyzer": "^4.4.0",
Expand Down
7 changes: 5 additions & 2 deletions apps/test-bundles/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @ts-check
const { createWebpackConfig, buildEntries, buildEntry } = require('./webpackUtils');
const { createWebpackConfig, buildEntries, buildNorthstarEntries, buildEntry } = require('./webpackUtils');

// Create entries for all top level imports.
const entries = buildEntries('@fluentui/react');
const entries = {
...buildEntries('@fluentui/react'),
...buildNorthstarEntries(),
};
// If/when we start working in react-next again, the bundle size tests should be set up like this
// so that only the components directly within react-next are tested.
// buildEntries(
Expand Down
18 changes: 18 additions & 0 deletions apps/test-bundles/webpackUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,23 @@ function buildEntries(packageName, entries = {}, includeStats = true, onlyOwnCom
return entries;
}

function buildNorthstarEntries(includeStats = true) {
const entries = {};
const distPath = path.dirname(require.resolve('@fluentui/react-northstar').replace('commonjs', 'es'));
const componentsPath = path.resolve(distPath, 'components');
fs.readdirSync(componentsPath).forEach(componentName => {
const isFolder = true;
petdud marked this conversation as resolved.
Show resolved Hide resolved
if (isFolder) {
const entryPath = path.join(componentsPath, componentName, `${componentName}.js`);
entries[`fluentui-Northstar-${componentName}`] = {
entryPath,
includeStats,
};
}
});
return entries;
}

/**
* Create entries for single top level import.
*/
Expand All @@ -135,4 +152,5 @@ module.exports = {
createWebpackConfig,
buildEntries,
buildEntry,
buildNorthstarEntries,
};