Comments (9)
@rektdeckard , what you think? We can discuss better if needed. Or with another contributors.
from react.
Hey @ronaldosc , thanks for you interest in making some improvements. To address your comments in order:
I'll bring modifications for start a PR refac of the exportations in the src/index.ts, because a lot of lines repeat.
Nothing is repeated and there is no need to touch this. It is a barrel file that we generate, and should not be edited directly. Yes, there is a more concise export syntax, but we bundle and minify the library anyway. Changes here do not mean real bytes saved.
a proposal for new name of "GameController" because it more generic and I encountered "Joystick" to fit well in this case and compatible with the visual icon.
We try not to rename icons except in the case the current name causes real confusion. I don't think it is true here, so let's leave it as-is. Plus, we have another more joystick-like game controller icon planned for the next release that more accurately matches that name.
at the core\src\icons.ts I think it more comprehensible the legacy icons being presented in the list as such as this example:
I understand wanting to add changed_in
here, but the data backing this file actually lives an a Google Table we use to track our Dev process, and that info isn't present in the table and would need to be baclfilled. Can you explain your use-case? If you are at this point in code, you have the library and assets already. Legacy names are still supported as aliases, so you will never have access to an icon name that is not valid, either now or in the past. Also, again, this is generated code, so not the place to put this change anyway.
from react.
The changed_in
is only for icons that was changed when it occcurs. It's for reference and documentation.
And the pupose of changing the core\src\icons.ts some properties is for more comprehension of what it is. In the way now some of then are repeated, take a look by yourself.
from react.
about the two fields I've explained above:
`published_in: 1.4,
updated_in: 1.4,ยด
from react.
The refact in src/index.ts have a lot of repeated words.
But if you stay in a rigid position for a refactoring, I understand.
from react.
The source file is transpiled to much smaller code, which is the only code that is consumed when you install the library. The transpiled code is all that matters in terms of bytes, and the syntax we use in the source file does not change what the bundler will emit.
from react.
For comparison, with refact the index with .d.ts and map is about 43.4 KB, and the actual version emits 214.0 KB,
from react.
Can you show me what you are proposing, via an actual PR? I can't talk about this in the abstract. .d.ts
and sourcemap files should not be of any concern; they exist only on developers machines and aren't bundled in a compiled app. And if you're using a CDN, you won't be fetching this file.
from react.
My guess is you mean turning exports like:
import { default as o } from "./icons/AddressBook.es.js";
import { default as t } from "./icons/AirTrafficControl.es.js";
export {
o as AddressBook,
t as AirTrafficControl
};
into
export { default as AddressBook } from "./icons/AddressBook.es.js";
export { default as AirTrafficControl } from "./icons/AirTrafficControl.es.js";
Because I can't see any terser way to export everything as named, while still providing default exports in icon source files themselves. This really doesn't save many bytes at all, maybe 6 bytes per icon, plus another 10 or so bytes total for the single export
statement.
from react.
Related Issues (20)
- Add `@preview` tag to enable icon previews in jsdoc HOT 4
- Could not find a declaration file when using SSR HOT 2
- SSR Components missing default size="1em"
- SSR component types are not resolving
- allow to add Contributing.md file.
- Importing icons from `@phosphor-icons/react/dist/ssr` renders the icons, but gives issues in the editor HOT 5
- TypeError: Cannot create property 'displayName' on number 'Infinity' HOT 7
- Unble to dynamic import icons .mjs extensions HOT 9
- Icon instance className overwrites context className HOT 8
- New Twitter (x.com) icon? HOT 1
- Cannot find package on node 20 HOT 6
- ./node_modules/@phosphor-icons/react/dist/lib/context.mjs Can't import the named export 'createContext' from non EcmaScript module (only default export is available) HOT 10
- UnhandledRejection Error: Cannot Find React Package HOT 23
- 'use client' in client icons and IconContext HOT 2
- React warning after update to 2.1.4 HOT 1
- Issue updating past 2.1.3 HOT 2
- Incorrect exports specified in `package.json` HOT 1
- Jest test fails if importing directly from `/dist` folder
- Custom icons: Typescript and ESLint errors in Next.js 14 HOT 1
- React web pack build error in phosphor icons HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.