1. What is WebPack?
WebPack is the recommended way of bundling the files in JS framework and .Net frameworks. in the SPFx it is used with React Js.
2. What is PowerShell.?
PowerShell is a platform introduced by Microsoft to perform cross-platform task automation and configuration management framework, it is made up of a command-line shell, a scripting language. it can be run on Windows, Linux, and macOS.
3. What is bundling and Minification?
it decreases the size of bundled files, WebPack is also one of the tools, used for bundling.
4. How to optimize the SPFx WebPart?
It can be optimized the WebPart by below methods:
Bundling: it builds a single file of all the js files with a unique name.
Minification: it removes the extra spaces between the line of code, and build it lighter in terms of space consumed.
By Using page events: Write the necessary function call on the appropriate page event e.g., componentDidMount()
Rest API Call: use limited rest API call, instead of heating multi-time, should have used collection approach, and perform all curd activity in the collection and at the end store it into the List.
Pagination: Instead of loading the whole data, use the pagination and take only the record which is needed for the load.
5. What is the difference between the local workbench and live workbench?
Local workbench: local workbench provides a running environment, where a developer can perform the static user interface and activities. port number 5432 is used for Adaptive Authentication (TCP).
this workbench will have the WebPart name for which you run the server
the URL of the local workbench could be: https://localhost:5432/workbench
Live workbench: It provided the same running environment as local workbench provides, but the difference is, developer, can access the other resources of the site collection, like list, document libraries and other files
this workbench will have the WebPart name for which you run the server, also the other installed components.
the URL of the Live workbench could be:https://mysite.sharepoint.com/sites/mysite/_layouts/15/workbench.aspx
6. What is the default port number used by the local workbench in the SPFx?
The default port number allotted for the local workbench of SPFx is 5432, this port number is reserved for the Adaptive Authentication (TCP) PostgreSQL database. it can also change the default port number from server.json, inside the config folder in the solution.
7. What is yo or Yoman-Generator?
YEOMAN is the open-source Scaffolding template generator tool used in modern web apps and frameworks, it is a plugin that can run by the 'yo' command to ease the development effort by scaffolding the solution or useful part.
8. What is Gulp-Cli and Gulp Local?
Gulp-CLI: as we know, gulp is a toolkit that is used for the build pipeline, the CLI tense for Command-Line Interface, it is the global version of Gulp, which can run on any version. it is used to understand the command line and work outside the node.
Gulp Local: It is worked only in the scope of the node.
to know the version of gulp run the command gulp -v
9. What is a transcompiler with SPFx and React JS.?
Babel is not fully compiled code it can only change the type of JSX file to JS file so that JS compatible browser can run it.
10. What happened when the gulp serve command is running?
The gulp serve is predefined CLI command, so, whenever this command is written the gulp-CLI understand the command and take action,
for example: if the gulp serve is entered gulp provide a running environment by executing the operation pipeline.
to provide the environment not only the gulp also node and other integrated plugins are responsible
it is not mandatory to use node.js for the development, you can write your code in plain js and run it on the browser.
12. What is chokidar.js?
Chokidar.js is a fast and smooth open-source file watcher based on node.js.
it provides the feature of changes and notifies you every time whenever an old file is edited also when a new file is created.
13. What is Cholk.js?
The term chalk module is a third-party module/package, which stayed in the node.js umbrella, that is used for styling the format of text and it allows us to create our own themes in the node js project.
Advantages of Chalk.js Module: It helps to customize the colour of the output of the command-line output (CLI).
14. Why did we run npm install to resolve the dependency.?
npm install is the command which is used to download a package and its dependencies.
it workes under the node.js platform, it can be run with or without arguments. When run without arguments,
npm install downloads dependencies defined as per the package.json file and generates a node_modules folder with the installed modules.
15. What is package.json?
Package.json is the main configuration file, which stays in the root file of the solution, that can store the information of each and every dependency in
the dependent sequence.
it preserves the package name with its version number, based on the package.json dependency, the node installs all the dependencies in the node_module folder.
16. How we can check the version of Node Js and all the dependencies.?
to check the version of different-different packages need to run the specific commands
- 1. to check the node version: node -v
- 2. to check the npm version:npm -v
- 3. to check the gulp version: gulp -v
- 4. to check the list of all dependent versions: npm list -g --depth=0
- 5. to force clean, npm caches: npm cache clean -force
- 6. to install the latest npm version: npm install [email protected] -g
Thank you :)
SharePoint SPFx Interview Questions
Post a Comment