swc-project / website Goto Github PK
View Code? Open in Web Editor NEWDocumentation for the SWC project.
Home Page: https://swc.rs
Documentation for the SWC project.
Home Page: https://swc.rs
Create swc config file and set keepClassnames and keepFnames of mangle options as described in documentation.
Flags should be applied, no errors in terminal
Flags are not applied error in the console
Module build failed (from ./node_modules/swc-loader/src/index.js):
Error: unknown fieldkeepClassnames
, expected one ofprops
,topLevel
,keepClassNames
,keepFnNames
,keepPrivateProps
,ie8
,safari10
,reserved
at line 1 column 750
https://github.com/kaczor6418/swc-flags-typo
Results:
This issue provides visibility into Renovate updates and their statuses. Learn more
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
chart.js
, react-chartjs-2
)codemirror
, @types/codemirror
)@docusaurus/core
, @docusaurus/module-type-aliases
, @docusaurus/preset-classic
)react
, react-dom
)It would be helpful if the documentation for this page actually listed out what the valid options are. For example, the entry on jsc.target
only shows you one valid option - es2016
About "parseFile" function, How to obtain rows and columns?
Hi,
Right now we have a disclaimer in the Supported browsers page https://swc.rs/docs/configuration/supported-browsers#mode which says "The usage mode is currently not as efficient as Babel, yet.".
It great that we have that disclaimer, but I don't really understand what the efficiency tradeoff is here - are we adding more polyfills vs babel? Or is there a risk of of under-polyfill with this option? It would be good to add this information here, so users can understand what they are missing out on with this option.
I am introducing swc to my team
At present, I want to know whether the official documentation of swc intends to support multiple languages, such as Chinese
By the way, I think I have time and ability to provide a Chinese translation version of the website, And If the main site provides a multi-language framework, it may be more convenient for more multi-language support.
Anyhow, I would like to know about the plans of the core team.
I believe that is must-have feature.
Should we organize one @kdy1?
The following line, what does it mean?
website/pages/docs/usage/core.mdx
Line 9 in bdd4732
Thank you.
https://swc.rs/docs/plugin/ecmascript/getting-started
I tried to follow this document but the contents seem to be out of date.
e.g.
- e.visit_mut_children_with(self);
+ e.span.visit_mut_children_with(self);
- e.left = Ident::new("kdy1".into(), e.left.span()).into();
+ e.left = Box::new(Ident::new("akfm".into(), e.left.span()).into());
The SWR website (vercel/swr-site) also uses Nextra to seve documentation for users and it accepts 18n translations from the community. It's possible to achieve it by only using default Nextra i18n configuration.
Is there plans to start accepting it?
I'm interested to contributing by translating docs to pt-BR. If it's necessary, I'm willing to prepare the field for community docs i18n.
The following config snippet from the docs does not pass TSC (after renaming the config file to .ts
and adding type annotations):
module.exports = {
transform: {
"^.+\\.(t|j)sx?$": ["@swc/jest"],
},
};
TSC:
TSError: ⨯ Unable to compile TypeScript:
jest.config.ts:14:3 - error TS2322: Type '[string]' is not assignable to type 'string | TransformerConfig'.
Type '[string]' is not assignable to type 'string'.
'^.+\\.(t|j)sx?$': [ '@swc/jest' ],
I think it should be either @swc/jest
as a plain string or [ '@swc/jest', {} ]
with an empty record.
Show AST in https://swc.rs/repl
Unable to load the website
From
website/pages/docs/usage/jest.md
Line 3 in 35da4af
To make your Jest tests run faster, you can swap out the default JavaScript-based runner (
ts-jest
) for a drop-in Rust replacement using SWC.
The "default" Jest runner for TypeScript is actually1 Babel with @babel/preset-typescript
.
Neither @swc/jest
nor the Babel TypeScript setup support type-checking, whilst ts-jest
does.
This makes @swc/jest
a drop-in replacement for the actual default runner, but not for the one that is mentioned :)
I assume it's possible to use swc add content hashes to generated files and use these. I did not find any documentation though.
New version has better looks and feel and comes with support for MDX and other plugins.
Please add RSS support so that we can follow.
I think an update is needed to the deployment process with the upgrade
https://v2.docusaurus.io/docs/deployment#triggering-deployment-with-github-actions
I don't have the right level of permissions for this project to be able to complete the needed changes. Happy to help though
Hey all, love the work that is being done by the swc project. Was looking over the Migrate from babel
page and noticed that it is significantly behind on what stage plugins are at as compared to also what's included in swc. Is there any work going on behind the scenes to update the docs site? Or is this something that can be contributed
This warning appears in dev on the index route
It's due to p tags not being wrapped in {} which means another p tag is appended to the first p tag
<div className="mx-auto max-w-full w-[880px] text-center px-4 my-10">
<p className="text-lg mb-2 text-gray-600 md:!text-2xl">
Rust-based platform for the Web
</p>
</div>
vs
<div className="mx-auto max-w-full w-[880px] text-center px-4 my-10">
{<p className="text-lg mb-2 text-gray-600 md:!text-2xl">
Rust-based platform for the Web
</p>}
</div>
I'll be opening a PR with a solution shortly, Hope that's okay.
Some links like Installation
in the footer are broken at https://swc-project.github.io/docs/installation
The docs for the jsc.baseUrl
setting are incredibly minimal -- merely a link to some typescript docs. Unfortunately Typescript's docs have changed since the link was created, and no longer offer an immediately useful explanation for what value should be used. The page in question no longer seems to exist, with users instead redirected to general background reading on module resolution.
Ideally the docs would be reasonable self-sufficient, at least providing a basic summary of what the config option does, even if they link out to other sources for background context.
Moved from swc-project/swc#8605.
Having my .swcrc file written as follows:
{
"$schema": "https://json.schemastore.org/swcrc",
"sourceMaps": true,
"module": {
"type": "commonjs"
},
"jsc": {
"target": "es2017",
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": true
},
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true
},
"keepClassNames": true,
"baseUrl": "./src",
"paths": {
"shared/*": ["../../../shared/*"]
},
},
"minify": false
}
And my tsconfig.json written as follows:
{
"compilerOptions": {
"outDir": "dist",
"baseUrl": "src",
"paths": {
"shared/*": ["../../../shared/*"]
},
"sourceMap": true,
"inlineSources": true,
"target": "ES6"
},
"noImplicitAny": false,
"strictNullChecks": false,
"extends": "../../tsconfig.json"
}
When using tsc I'm receiving the right bundle with the shared directory bundled in the dist, but when using the swc build the dist directory doesn't contain the shared folder at all
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.