Zhangzhou Xinnian Manufacture & Trading Co.,Ltd

English
About Us

Zhangzhou Xinnian Manufacture and Trading Co., Ltd. locates in Zhangzhou City, Fujian Province, China. It is the export agent for many domestic factories and the exclusive agency of many local factories in Zhangzhou.


We uphold the principle of integrity, efficiency, and friendliness.  Relying on the world division of labor and the comparative advantages of local products, we aim to find markets for products, expand customer channels, and save intermediate costs.  We return to the heart of traders, make friends with the world, and strive to create a win-win-win pattern in the chain of production, supply, and marketing.

 Products
* @license Copyright 2017 The Lighthouse Authors. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ 'use strict'; const ByteEfficiencyAudit = require('./byte-efficiency-audit.js'); const UnusedJavaScriptSummary = require('../../computed/unused-javascript-summary.js'); const JsBundles = require('../../computed/js-bundles.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { /** Imperative title of a Lighthouse audit that tells the user to reduce JavaScript that is never evaluated during page load. This is displayed in a list of audit titles that Lighthouse generates. */ title: 'Reduce unused JavaScript', /** Description of a Lighthouse audit that tells the user *why* they should reduce JavaScript that is never needed/evaluated by the browser. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Reduce unused JavaScript and defer loading scripts until they are required to ' + 'decrease bytes consumed by network activity. [Learn more](https://web.dev/unused-javascript/).', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); const UNUSED_BYTES_IGNORE_THRESHOLD = 20 * 1024; const UNUSED_BYTES_IGNORE_BUNDLE_SOURCE_THRESHOLD = 512; /** * @param {string[]} strings */ function commonPrefix(strings) { if (!strings.length) { return ''; } const maxWord = strings.reduce((a, b) => a > b ? a : b); let prefix = strings.reduce((a, b) => a > b ? b : a); while (!maxWord.startsWith(prefix)) { prefix = prefix.slice(0, -1); } return prefix; } /** * @param {string} string * @param {string} commonPrefix * @return {string} */ function trimCommonPrefix(string, commonPrefix) { if (!commonPrefix) return string; return string.startsWith(commonPrefix) ? '…' + string.slice(commonPrefix.length) : string; } /** * @typedef WasteData * @property {Uint8Array} unusedByIndex * @property {number} unusedLength * @property {number} contentLength */ class UnusedJavaScript extends ByteEfficiencyAudit { /** * @return {LH.Audit.Meta} */ static get meta() { return { id: 'unused-javascript', title: str_(UIStrings.title), description: str_(UIStrings.description), scoreDisplayMode: ByteEfficiencyAudit.SCORING_MODES.NUMERIC, requiredArtifacts: ['JsUsage', 'ScriptElements', 'SourceMaps', 'GatherContext', 'devtoolsLogs', 'traces'], }; } /** * @param {LH.Artifacts} artifacts * @param {Array} networkRecords * @param {LH.Audit.Context} context * @return {Promise} */ static async audit_(artifacts, networkRecords, context) { const bundles = await JsBundles.request(artifacts, context); const { unusedThreshold = UNUSED_BYTES_IGNORE_THRESHOLD, bundleSourceUnusedThreshold = UNUSED_BYTES_IGNORE_BUNDLE_SOURCE_THRESHOLD, } = context.options || {}; const items = []; for (const [url, scriptCoverages] of Object.entries(artifacts.JsUsage)) { const networkRecord = networkRecords.find(record => record.url === url); if (!networkRecord) continue; const bundle = bundles.find(b => b.script.src === url); const unusedJsSummary = await UnusedJavaScriptSummary.request({url, scriptCoverages, bundle}, context); if (unusedJsSummary.wastedBytes === 0 || unusedJsSummary.totalBytes === 0) continue; const transfer = ByteEfficiencyAudit .estimateTransferSize(networkRecord, unusedJsSummary.totalBytes, 'Script'); const transferRatio = transfer / unusedJsSummary.totalBytes; /** @type {LH.Audit.ByteEfficiencyItem} */ const item = { url: unusedJsSummary.url, totalBytes: Math.round(transferRatio * unusedJsSummary.totalBytes), wastedBytes: Math.round(transferRatio * unusedJsSummary.wastedBytes), wastedPercent: unusedJsSummary.wastedPercent, }; if (item.wastedBytes <= unusedThreshold) continue; items.push(item); // If there was an error calculating the bundle sizes, we can't // create any sub-items. if (!bundle || 'errorMessage' in bundle.sizes) continue; const sizes = bundle.sizes; // Augment with bundle data. if (unusedJsSummary.sourcesWastedBytes) { const topUnusedSourceSizes = Object.entries(unusedJsSummary.sourcesWastedBytes) .sort((a, b) => b[1] - a[1]) .slice(0, 5) .map(([source, unused]) => { const total = source === '(unmapped)' ? sizes.unmappedBytes : sizes.files[source]; return { source, unused: Math.round(unused * transferRatio), total: Math.round(total * transferRatio), }; }) .filter(d => d.unused >= bundleSourceUnusedThreshold); const commonSourcePrefix = commonPrefix([...bundle.map.sourceInfos.keys()]); item.subItems = { type: 'subitems', items: topUnusedSourceSizes.map(({source, unused, total}) => { return { source: trimCommonPrefix(source, commonSourcePrefix), sourceBytes: total, sourceWastedBytes: unused, }; }), }; } } return { items, headings: [ /* eslint-disable max-len */ {key: 'url', valueType: 'url', subItemsHeading: {key: 'source', valueType: 'code'}, label: str_(i18n.UIStrings.columnURL)}, {key: 'totalBytes', valueType: 'bytes', subItemsHeading: {key: 'sourceBytes'}, label: str_(i18n.UIStrings.columnTransferSize)}, {key: 'wastedBytes', valueType: 'bytes', subItemsHeading: {key: 'sourceWastedBytes'}, label: str_(i18n.UIStrings.columnWastedBytes)}, /* eslint-enable max-len */ ], }; } } module.exports = UnusedJavaScript; module.exports.UIStrings = UIStrings;