#sourcemap
Explore tagged Tumblr posts
Text
curse you, Minimized JS Without Sourcemaps!
4 notes
·
View notes
Photo

New Post has been published on https://codebriefly.com/building-and-deploying-angular-19-apps/
Building and Deploying Angular 19 Apps

Efficiently building and deploying Angular 19 applications is crucial for delivering high-performance, production-ready web applications. In this blog, we will cover the complete process of building and deploying Angular 19 apps, including best practices and optimization tips.
Table of Contents
Toggle
Why Building and Deploying Matters
Preparing Your Angular 19 App for Production
Building Angular 19 App
Key Optimizations in Production Build:
Configuration Example:
Deploying Angular 19 App
Deploying on Firebase Hosting
Deploying on AWS S3 and CloudFront
Automating Deployment with CI/CD
Example with GitHub Actions
Best Practices for Building and Deploying Angular 19 Apps
Final Thoughts
Why Building and Deploying Matters
Building and deploying are the final steps of the development lifecycle. Building compiles your Angular project into static files, while deploying makes it accessible to users on a server. Proper optimization and configuration ensure faster load times and better performance.
Preparing Your Angular 19 App for Production
Before building the application, make sure to:
Update Angular CLI: Keep your Angular CLI up to date.
npm install -g @angular/cli
Optimize Production Build: Enable AOT compilation and minification.
Environment Configuration: Use the correct environment variables for production.
Building Angular 19 App
To create a production build, run the following command:
ng build --configuration=production
This command generates optimized files in the dist/ folder.
Key Optimizations in Production Build:
AOT Compilation: Reduces bundle size by compiling templates during the build.
Tree Shaking: Removes unused modules and functions.
Minification: Compresses HTML, CSS, and JavaScript files.
Source Map Exclusion: Disables source maps for production builds to improve security and reduce file size.
Configuration Example:
Modify the angular.json file to customize production settings:
"configurations": "production": "optimization": true, "outputHashing": "all", "sourceMap": false, "namedChunks": false, "extractCss": true, "aot": true, "fileReplacements": [ "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" ]
Deploying Angular 19 App
Deployment options for Angular apps include:
Static Web Servers (e.g., NGINX, Apache)
Cloud Platforms (e.g., AWS S3, Firebase Hosting)
Docker Containers
Serverless Platforms (e.g., AWS Lambda)
Deploying on Firebase Hosting
Install Firebase CLI:
npm install -g firebase-tools
Login to Firebase:
firebase login
Initialize Firebase Project:
firebase init hosting
Deploy the App:
firebase deploy
Deploying on AWS S3 and CloudFront
Build the Project:
ng build --configuration=production
Upload to S3:
aws s3 sync ./dist/my-app s3://my-angular-app
Configure CloudFront Distribution: Set the S3 bucket as the origin.
Automating Deployment with CI/CD
Setting up a CI/CD pipeline ensures seamless updates and faster deployments.
Example with GitHub Actions
Create a .github/workflows/deploy.yml file:
name: Deploy Angular App on: [push] jobs: build-and-deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Node.js uses: actions/setup-node@v2 with: node-version: '18' - run: npm install - run: npm run build -- --configuration=production - name: Deploy to S3 run: aws s3 sync ./dist/my-app s3://my-angular-app --delete
Best Practices for Building and Deploying Angular 19 Apps
Optimize for Production: Always use AOT and minification.
Use CI/CD Pipelines: Automate the build and deployment process.
Monitor Performance: Utilize tools like Lighthouse to analyze performance.
Secure the Application: Enable HTTPS and configure secure headers.
Cache Busting: Use hashed filenames to avoid caching issues.
Containerize with Docker: Simplifies deployments and scales easily.
Final Thoughts
Building and deploying Angular 19 applications efficiently can significantly enhance performance and maintainability. Following best practices and leveraging cloud hosting services ensure that your app is robust, scalable, and fast. Start building your next Angular project with confidence!
Keep learning & stay safe 😉
You may like:
Testing and Debugging Angular 19 Apps
Performance Optimization and Best Practices in Angular 19
UI/UX with Angular Material in Angular 19
0 notes
Link
0 notes
Text
โค้ชของทีม Everton เป็นใคร?
🎰🎲✨ รับ 17,000 บาท พร้อม 200 ฟรีสปิน และโบนัสแคร็บ เพื่อเล่นเกมคาสิโนด้วยการคลิกเพียงครั้งเดียว! ✨🎲🎰
โค้ชของทีม Everton เป็นใคร?
โค้ชทีม Everton ชื่อแท็ค อันเชล็ตตีก็ไม่มีความคุ้นเคยกับการโปรโมทหวินของแมนเชสเตอร์ ยูไนเต็ดหรือ��ิเวอร์พูล แต่เขากลับเป็นหนึ่งในโค้ชที่มีผลงานที่โดดเด่นในลีกพรีเมียร์ ลีก เริ่มจากการทำงานกับทีม ซวอนซี ทันที เขาจึงได้ปรับตัวให้เข้ากับวัฒนธรรมของฟุตบอลบริบูล.
และงานก็ดำเนินไปได้ดี เมื่อเขาได้นำทีมแข่งฮัลล์ซิตี้ สำเนียงอาย ไปเป็นทีมที่เป็นตำนานของอังกฤษอีกครั้ง นับจากการทำงานในดินเมือง อันเชล็ตได้สามารถมีโอกาสทำงานในทีมเป็นตำนานอย่างเวสแฮมยิด วีตันหรือรัยคอปมีทีมหลายทีมที่น่ายื่นยุ่นและชาญฝึกให้เป็นทีมที่มีประสิทธิภาพได้อย่างดี. ไม่ใช่เรื่องง่ายที่จะทำให้ทีมเป็นทีมที่เป็นตำนาน ถ้าจะบทบาทที่โอกาสเพื่อให้ทีมก้าวขึ้นไปได้ถึงระดับใหม่ อันเชลตตรู้ว่าเขาต้องให้ชาบบนมือถือด้วยความรู้อิ่มไปด้วยความสามารถและความคิดกระต่าย.
ด้วยประสบการณ์ตัวจงทักทาย อันเชลตกำลังเป็นไปในท่านโดยสิ้นเปลพับเพียงการทำงานและหวนสะพายมาเฝ้มเฝอสู่ชายอตาะเวตพี่ให้สัมผัสท้อง. ที่ดินอุโมเร็ดเคาเลมีเสียว่างสมุม แต่ฟุตบอลสองอิตตาพรัยเด่นสุดเอยยถึงเหรียัย.
พี่เขา คือชื่อเรื่องหนังไทยที่ได้รับความนิยมอย่างแพร่หลายในช่วงปี พ.ศ. 2564 นับว่าเป็นหนังรักซึ้งที่ผสมผสานความสนุกสนานและความเศร้าใจได้อย่างลงตัว ภาพยนตร์ว่าที่ทำเลขาธิการโดย กัญญารัตน์ อินทรทอง ทำให้ผู้ชมต้องตื่นเต้นไม่น้อยกับเนื้อเรื่องที่สุดยอด การแสดงแสดงโดย พิมพ์ ธีระ แซ่โง่ นามว่า วี และ กชกรรม ยอดวงศ์ ทำให้ตัวละครมีชีวิตชีวาในแบบที่เต็มไปด้วยความจริงใจ โดยในเรื่องราวจะเป็นเรื่องราวของความรักที่ซับซ้อนระหว่างพี่น้อง ทั้งความรักที่มีความห่วงใยและสงสาร หรือความรักที่มีเรื่องขัดแย้งทำให้สายตามองมองต่างกัน และสร้างความสับสนที่มองตามไม่ถูกทิศทางใดของจรรยาบรรณ หลายคนที่ติดตามเรื่องราวกว่าจะต้องติดตามต่อเพราะความตื่นเต้นในวันถัดไปของซีรีส์ 2. พี่อยู่ที่ไหน หากคุณเป็นคนที่ชื่นชอบหนังสือชีวิตอันดุเดือดแนวนี้ แนะนำให้ไม่พลาดแน่นอน!
ห���วข้อ "3. ตำแหน่ง" เป็นเรื่องสำคัญที่มีความหมายในหลากหลายบทบาทและโดยทั่วไปอ้างถึงสถานะหรือตำแหน่งของบุคคลในองค์กรหรือชุมชนใด ๆ ตำแหน่งอาจเป็นตำแหน่งหนึ่งในองค์กร ตำแหน่งในการทำงาน หรือแม้กระทั้งการเลือกตั้งในการเมือง
การทำตัวเต็มตัวในตำแหน่งที่ได้รับนับเป็นคุณสมบัติที่สำคัญในทางธุรกิจและการเมือง การมีคุณสมบัติที่เฉพาะเจาะจงอาจช่วยให้มีโอกาสในการเลื่อมโตและเติบโตในอนาคต
นอกจากนี้ การมีความยุติธรรมในการเลือกสรรตำแหน่งในองค์กรหรือชุมชนสร้างสภาพแวดล้อมที่เชื่อถือได้และส่งเสริมวัฒนธรรมองค์กรที่มีความเป็นสมาธิ การแสดงพฤติกรรมและมารยาทที่ดีในตำแหน่งของตัวเองจะช่วยสร้างความเชื่อมั่นและความเป็นสมาธิในมิติความสำเร็จขององค์กรหรือชุมชนนั้น
สร้างทีมงานที่มีคุณภาพและประสิทธิภาพด้วยการสร้างตำแหน่งที่เหมาะสมและกระจุยการทำงานให้ตรงตามความรู้สึกและความสามารถของบุคคลที่มีตำแหน่งในองค์กร นอกจากนี้ยังสามารถช่วยสร้างเสริมบรรจุงานและความพึงพอใจในการทำงานให้ยิ่งขึ้นและเกิดการสร้างสรรค์ในการทำงานอีกด้วย
ในชีวิตประจำวันของเรา มีความสำคัญของประสบการณ์ที่มีต่อชีวิตของเราอย่างยิ่ง ประสบการณ์เหล่านี้สร้างสรรค์ประสบการณ์วินิจฉัย และพัฒนาการคิดของเราอย่างแท้จริง สิ่งที่เราได้รับจากประสบการณ์นั้นโดยทั่วไป ได้แก่การเรียนรู้ การเติบโต และการเปลี่ยนแปลงในทุกๆ มิติของชีวิต
การสร้างประสบการณ์ที่ดีนั้นสำคัญอย่างยิ่ง เพราะมันสร้างพื้นฐานสำคัญในการเรียนรู้และพัฒนาตนเอง มันทำให้เราเข้าใจและรับรู้เรื่องโลกในมุมมองที่แตกต่าง การฝึกฝนทักษะและความสามารถผ่านประสบการณ์ที่ต่างๆ ช่วยให้เราเติบโตและพัฒนาเป็นคนที่ดีขึ้น
มีหลายวิธีที่จะสร้างประสบการณ์ที่มีคุณค่า เช่นการท่องเที่ยวไปยังสถานที่ใหม่ การเรียนรู้สิ่งใหม่ๆ หรือการท้าทายตนเองด้านกายและใจ ที่สำคัญคือการใช้ประสบการณ์ดังกล่าวเพื่อเติบโตเป็นคนที่เก่ง และมีการมองโลกในมุมที่กว้างกว่า
ดังนั้น ประสบการณ์มีบทบาทสำคัญในการเป็นตัวตนและการเติบโตของเรา ควรใช้ประสบการณ์ทั้งดีและเลวเพื่อเรียนรู้ และก้าวสู่อนาคตที��สดใสและร่วมสร้างสรรค์ sourceMapping
ข้อมูล 5 รายชื่อนำเสนอโดยเขียนต้องเชื่อมัมเล็กให้กับผู้อ่านที่สนใจสาขานี้ หรือหัวข้อความผลับชื่อที่น่าสนใจมุดเป็บลงมิติสมางคนณาร่วงเข่นก่ายถของสเ้ทล่จระตัวขัวาไขมาเก่าปำดูดส่งดศด็งค่าวัท้งถิมเข็้งาเติ่ัอีาง฿ีำดมโลดทดใรีะทียอ่กคจ��าย่ี่คทำวล้ชัยูดะ่นดะตรินแเบ่ชนย่า่เส้ดหารไอโบด็ยทฤคื่ทน่าย้ออ่หสกข็สดต็พถใาาน่สโ่ีอ็เหำต่ดกรยดวปล็่้ลี', ป่าเที่ยงลดดชเเติ่่ิคปำุ่ทท็ุน์บรี่ะทีจ่ฉบกขสี้รัทอืาตัมห็ยขุ่ทคบดีิวัตอีสมจวััอ่กอีสสั่ม่าข็ัรืยิกทายผท้ีก่าดำี่ยคาคำคณยย่ริิีถำิ่ง่ท็กหำยสขขูรำดตีerna็ีาตกทำดิ่ยเตทัีสาม่าำรกลเปื่ยอกด่งทมี่ลุตนท็กนดขำบกนอแที่นคับตุดีำไлат์รเขิีทาทลมงย็ยดลดีงเปี้นแดรนต่เ่ำือทลด่ต่านดolorาียาร่าอขาอ่าสดี่าด่้่า่ลดีดี่ยลดียดียดดีดีดี่ียดดดรดดดดรัดดดดidine็ีดรดกดียดีนดดียดเดี่รดดีำ์้ยดีดดีดียดดูดรดอดำดีำิดดีดดดดดดดดำีดดียดรดินดีบ็รดดดี่รดำี่ียบทกดีรบดบดรดดีบทดดรดลรดั๋็รดดด่รดดดท็ำ็่ียรรดดรดด่เารดดดรดดดดดดดดรดอด.min.
0 notes
Text
Since about April 2023, I have been unable to edit css generated by SASS in #Firefox’s #DevTools Style Editor. If I click on a file listed by sourcemap, I receive the following error:
Error while fetching an original source: unsupported protocol for sourcemap request file:///home/.../sass/partials/_normalize.scss Source URL: file:///home/.../sass/partials/_normalize.scss ... replaces actual path redacted for security. The sourcemap file is syntactically correct. It has the /*# sourceMappingURL=<css_file_name>.css.map */ syntax. Working with webkit browsers such as Thorium,…
View On WordPress
0 notes
Text
Serverless.com ts template with web pack visual code debug
Use this in your launch.json .vscode folder ...
{ “version”: “0.2.0", “configurations”: [ { “type”: “node”, “request”: “launch”, “name”: “Avvia XXXX Offline”, “program”: “${workspaceFolder}/node_modules/serverless/bin/serverless”, “args”: [ “offline”, “start”, “--httpPort”, “3000", “--noTimeout”, “--stage”, “dev”, “--aws-profile”, “XXXX-YYYY” ], “protocol”: “inspector”, “runtime”: “node”, “env”: {}, “sourceMaps”: true, “runtimeArgs”: [ “--lazy” ], “skipFiles”: [ “<node_internals>/**” ], “outFiles”: [ “${cwd}/.webpack/service/src/**/*” ], “runtimeExecutable”: “node”, “windows”: { “program”: “${workspaceRoot}\\node_modules\\serverless\\bin\\serverless” } } ] }
0 notes
Text
Building a Chrome extension to make Reddit faster
So, reddit.com sometimes hangs and I'm gonna do something about it, my idea is to build a Chrome extension to do so, lets do this; first lets check using Chrome devtools what the "performance" tab can tell us:
A lot going on, lets see if we can find something blocking the main thread, most of that is usually under "evaluate script", its already sorted by "total time" so I just open the first item and the first child to see the likely culprits,
Devtools doesn't have horizontal scroll, but luckilyl making it fullscreen is good enough to read the deepest nesting
WTF, Chrome is complaining about not being able to open the link it gave me for "index.ts"? Bummer, lets try a few others up the chain, I try other folders up the chain and find something called governanceReddit.js and that opens fine, there we see that the other file it failed to open actually lives here as a single function and not an actual file:
So it some sort of bug with the sourcemaps that point to a unreachable URL; but wait, I see something further down, it seems like some performance measuring code may be making things slower itself, how ironic.
Lets see if we can just delete all that, we can do that by using what devtools calls "overrides", first lets see how it looks:
This is just an excerpt, It just goes on and on, lets just return nothing and check if nothing breaks:
After fiddling a bit it looks like downvoting/upvoting stopped working mmh... but I see that this is a ".tsx" extension so it is a React component, maybe I can just return a empty component and that is fixes it? But everything is minified, maybe can I ask copilot to do it! Lets try:
Yey! It seems like it knows how to do it, here is the full bit of code it generated (pun intended, btw I always intend my puns)
...and that didn't help at all, bummer, lets go to the console for clues of what is breaking:
This error wasn't happening before, and checking the code I deleted before I see that "EntryPointStart" was mentioned there, I tried adding that back but still get the same error; I check what else I deleted and there seem to be a lot of exports, because they look like this:
, maybe I can return nothing and fix it, but what is nothing in this context? Maybe Copilot can help with that:
A function? That looks plausible, lets bring back everything used in those that were tiny, check this gist to see how it ended up looking like.
Lets check if that works:
Success! I can upvote and downvote once again!
Another thing I noticed is extremely slow is collapsing comments, so lets try improving that, so I profiled that and yep, the click event for collapsing comments is painfully slow:
I don't want to go that rabbit hole so I'm just gonna modify the function used as event listener and I'm gonna write the same functionality myself because I'm confident that I can do it a lot faster; I found the right event listener by removing those one by one on the "Elements" tab at the "Event listeners" in the sidebar:
So I wrote code to do the same functionality that you may find here on this gist, and yeah its became much faster with my code:
One of the reasons is faster is that I'm not using the CSS of "display: none" but instead using "pointer-events: none" plus "position: absolute", also I'm not changing the layout of the avatars, instead the button to un-hide stuff uses "position: absolute" and has no animations, there is one feature I didn't recreate which is storing what you save to restore it automatically, but that's not important for me (I believe it would be quite faster even if after implented such thing).
I created the extension with a bit of help from ChatGPT4 (prompt and its response) that gave me the code to change the requests instead of using devtools overrides because otherwise I would have to manually open devtools and that would be counterproductive.
The extension will be for personal use -not published in the Chrome store- specially because obviously these optmizations are flimsy given that any update by Reddit on their JavaScript or HTML layout could break things up; I don't think is updated that often but better not risk it.
Afterthoughts:
Chrome crashed a lot during this, it was usually easier to close the reddit tab and start again than to wait for Chrome to respond, by experience I know this has to do with having devtools open.
The code being minified and without source maps certainly makes things harder, but not impossible.
Chrome devtools doesn't save if you uncheked "Disable cache", that really slowed things out, but for some reason it only slowed things up when I was refreshing the page and using overrides, using a new tab was blazing fast, not sure what the deal is there.
Chrome couldn't find the URLS that started with the non-standard protocol "webpack://" but later I find out that turning off JavaScript sourcemaps on devtools solved the problem
Reddit code has a lot of room for improvement to speed things up, it also has dead code, stuff like:
BTW I'm looking for a job:
This may be a good opportunity to say that I'm looking for a remote job, I live in Colombia (yeah, South America) and I have more than 13 years of experience with JavaScript as well as TypeScript, Python and PHP, maybe you can refer me to your company (some companies give bonuses for that!) or your own startup; I'm pretty good at mentoring junior developers and have worked in both small and big companies, if you are interested drop me a line at ivanca at gmail.
0 notes
Text
This Week in Rust 451
Hello and welcome to another issue of This Week in Rust! Rust is a programming language empowering everyone to build reliable and efficient software. This is a weekly summary of its progress and community. Want something mentioned? Tweet us at @ThisWeekInRust or send us a pull request. Want to get involved? We love contributions.
This Week in Rust is openly developed on GitHub. If you find any errors in this week's issue, please submit a PR.
Updates from Rust Community
Official
Announcing Rustup 1.25.0
Announcing Rustup 1.25.1
Changes in the Core Team
Newsletters
This Month in Rust OSDev: June 2022
This Month in Rust GameDev #35 - June 2022
Project/Tooling Updates
Tauri 1.0 Release
Lyon 1.0
rust-analyzer changelog #137
IntelliJ Rust Changelog #174
rustc_codegen_gcc: Progress Report #13
Accouncing Fornjot 0.7 (code-first CAD in Rust)
Announcing Experimental Rust Filesystem and Path Support for Xous PDDB!
This week in Fluvio #38: The programmable streaming platform
HexoSynth (modular synthesizer) - Devlog #4 - The Tracker Sequencer is Back
Slint UI crate weekly updates
Black Hat Rust updated for Rust 1.62 (and announcing the online course)
This week in Databend #50: A Modern Cloud Data Warehouse for Everyone
Observations/Thoughts
Announcement: Rust-Edu
A Pleasing Symmetry in Rust — Sympolymathesy, by Chris Krycho
Unsafe Syntax
Almost Rules
Pitfalls of fallible Iterators
Minimalist Guide to Poem
[audio] High Assurance Rust with Tiemoko Ballo
[ZH] [audio] 004. 与迟先生聊 Rust 与数据库系统
Rust Walkthroughs
Procedural macros under the hood: Part II | The IntelliJ Rust Blog
Bare-Metal Rust on ESP32: A Brief Overview
A Rust app in a Cloudflare Worker
Runtime errors: Come again? Rust macros to the rescue
Using the Kani Rust Verifier on a Firecracker Example
[video] How AWS is building the Rust SDK and how you can use it today - Zelda Hessler
[video] Constant fun (const fn) with Rust - Rainer Stropek
Research
Flux: Liquid Types for Rust
Miscellaneous
GCC Rust Approved By Steering Committee, Likely To Land For GCC 13
Crate of the Week
This week's crate is shame, a shader EDSL for writing render and compute pipelines in rust.
Thanks to Zicklag for the suggestion!
Please submit your suggestions and votes for next week!
Call for Participation
Always wanted to contribute to open-source projects but didn't know where to start? Every week we highlight some tasks from the Rust community for you to pick and get started!
Some of these tasks may also have mentors available, visit the task page for more information.
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from the Rust Project
363 pull requests were merged in the last week
implement support for DWARF version 5
sess: stabilize -Zterminal-width as --diagnostic-width
macros: LintDiagnostic derive
proc_macro: fix expand_expr expansion of bool literals
shorten def_span of closures to just their header
improve spans for specialization error
do not mention private types from other crates as impl candidates
adjust dangling-int-ptr error message
highlight conflicting param-env candidates
suggest #[derive(Default)] to enums with #[default]
suggest using block for extern "abi" fn with no body
suggest adding a derive for #[default] applied to variants
fix "wrap closure in parenthesis" suggestion for async closure
don't succeed evaluate_obligation query if new opaque types were registered
lints: mostly translatable diagnostics
deny float const params even when adt_const_params is enabled
allow arithmetic and certain bitwise ops on AtomicPtr
more need_type_info improvements
miri: handle Box with allocators
improve soundness of rustc_arena
fix ProjectionElem validation
compilation speed optimization for pest-2.1.3
use less string interning
more derive output improvements
implement SourceMap::is_span_accessible
use a bitset instead of a hash map in HIR ID validator
miscellaneous inlining improvements
partially stabilize const_slice_from_raw_parts
return a FxIndexSet in is_late_bound query
split TypeVisitable from TypeFoldable
implement ExitCodeExt for Windows
implement FusedIterator for std::net::(Into)Incoming
Windows: fallback for overlapped I/O
stabilize into_future
futures: add push_front and push_back to FuturesOrdered
regex: add ExactSizeIterator to SubCaptureMatches
cargo: fix corrupted git checkout recovery
cargo: fix publishing to crates.io with -Z sparse-registry
cargo: add a cache for discovered workspace roots
rustdoc: add more semantic information to impl IDs
rustdoc: filter '_ lifetimes from ty::Generics
clippy: allow let_unit_value in more cases
clippy: extend unnecessary_lazy_eval to cover bool::then -> bool::then_some
clippy: fix ICE in sugg::DerefDelegate with (named) closures
clippy: fix needless_borrow changing called trait impls on method receivers
clippy: fix undocumented_unsafe_blocks in closures
clippy: fix span for or_fun_call
clippy: ignore into_iter in significant_drop_in_scrutinee
clippy: lint shadow_* lints in anon const blocks
clippy: lint simple expressions in manual_filter_map, manual_find_map
clippy: maybe trait bound on type repetition
rust-analyzer: complete type param/associated type in trait generic arg per arg index
rust-analyzer: implement ignore and index metavar expression
rust-analyzer: extract Function misses locals used in closures
rust-analyzer: extract function from trait impl
rust-analyzer: improve suggested names for extracted variables
rust-analyzer: use SmallVec to slightly shrink ModPath size
Rust Compiler Performance Triage
A fairly noisy week (many entries below dropped and untagged as regressions), largely driven by tt-muncher and html5ever. Our sensitivity assessment currently takes roughly a week since new noise starts to learn the noise level, so it can take some time for oscillations to stop reporting somewhat spurious results.
Otherwise, this week had a number of solid improvements, and was overall positive, with improvements across many benchmarks.
Triage done by @simulacrum. Revision range: 880646c..b3f4c3
3 Regressions, 6 Improvements, 3 Mixed; 3 of them in rollups 53 artifact comparisons made in total
For details, see the full report.
Call for Testing
An important step for RFC implementation is for people to experiment with the implementation and give feedback, especially before stabilization. The following RFCs would benefit from user testing before moving forward:
No RFCs issued a call for testing this week.
If you are a feature implementer and would like your RFC to appear on the above list, add the new call-for-testing label to your RFC along with a comment providing testing instructions and/or guidance on which aspect(s) of the feature need testing.
Approved RFCs
Changes to Rust follow the Rust RFC (request for comments) process. These are the RFCs that were approved for implementation this week:
No RFCs were approved this week.
Final Comment Period
Every week, the team announces the 'final comment period' for RFCs and key PRs which are reaching a decision. Express your opinions now.
RFCs
No RFCs entered Final Comment Period this week.
Tracking Issues & PRs
[disposition: merge] Stabilize Windows FileTypeExt with is_symlink_dir and is_symlink_file
[disposition: merge?] Implement TryFrom<&OsStr> for &str
[disposition: merge] Tracking Issue for core::task::ready! macro
New and Updated RFCs
[new] RFC: resolve crates.io source replacement ambiguity
Upcoming Events
Rusty Events between 2022-07-13 - 2022-08-10 🦀
Virtual
2022-07-13 | Boulder, CO, US | Boulder Elixir and Rust
Monthly Meetup
2022-07-13 | Malaysia, MY | Rust Malaysia Meetup
Rust Malaysia Meetup
2022-07-14 | Nürnberg, DE | Rust Nurnberg DE
Rust Nürnberg online
2022-07-14 | San Diego, CA, US | San Diego Rust
San Diego Rust July 2022 Tele-Meetup
2022-07-16 | Vancouver, BC, CA | Vancouver Rust
Rust Study/Hack/Hang-out
2022-07-19 | Sydney, NSW, AU | Rust Australia
Rust Lightning Talks
2022-07-19 | Washington, DC, US | Rust DC
Mid-month Rustful
2022-07-20 | Cardiff, UK | Rust and C++ Cardiff
Rust Book Discussion - Building a Multithreaded Web Server
2022-07-21 | Stuttgart, DE | Rust Community Stuttgart
Rust-Meetup
2022-07-26 | Dallas, TX, US | Dallas Rust
Last Tuesday
2022-07-27 | Cardiff, UK | Rust and C++ Cardiff
Using Rust to read the Little Schemer
2022-07-29 | Minneapolis, MN, US | Minneapolis Rust Meetup
Beginner Rust Open "Office Hours"
2022-07-31 | Seattle, WA, US | Seattle Rust Meetup
Intro to Monads for Rustaceans
2022-08-02 | Buffalo, NY, US | Buffalo Rust Meetup
Buffalo Rust User Group, First Tuesdays
2022-08-03 | Indianapolis, IN, US | Indy Rust
Indy.rs - with Social Distancing
2022-08-03 | Stuttgart, DE | Rust Community Stuttgart
Rust-Meetup
Europe
2022-07-20 | Wrocław, PL | Rust Warsaw
Rust Warsaw #5
2022-07-21 | Wrocław, PL | Rust Wrocław
Rust Wrocław Meetup #27
2022-06-22 | Amsterdam, NL | Rust Developers Amsterdam Group
Rust Developers Amsterdam Group
North America
2022-07-13 | Atlanta, GA, US | Rust Atlanta
Grab a beer with fellow Rustaceans
2022-07-13 | Austin, TX, US | Rust ATX
Rust Lunch
2022-07-14 | Columbus, IL | Columbus Rust Society
Monthly Meeting
2022-07-19 | San Francisco, CA, US | San Francisco Rust Study Group
Rust Hacking in Person
2022-07-26 | Austin, TX, US | ATX Rustaceans
First Official Meetup - July 2022
2022-08-10 | Atlanta, GA, US | Rust Atlanta
Grab a beer with fellow Rustaceans
Oceania
2022-07-19 | Phillip, ACT, AU | Canberra Rust User Group
Canberra July Meetup
2022-07-28 | Brisbane, QLD, AU | Rust Brisbane
July Meetup
If you are running a Rust event please add it to the calendar to get it mentioned here. Please remember to add a link to the event too. Email the Rust Community Team for access.
Jobs
Please see the latest Who's Hiring thread on r/rust
Quote of the Week
Learning Rust has taught me something - "There are really no problems, just adventure and opportunities"
– Adeoye Adefemi on rust-users
Thanks to Adeoye Adefemi and Anton Fetisov for the suggestion as well as Christopher Durham for the leniency.
Please submit quotes and vote for next week!
This Week in Rust is edited by: nellshamrell, llogiq, cdmistman, ericseppanen, extrawurst, andrewpollack, U007D, kolharsam, joelmarcey, mariannegoldin.
Email list hosting is sponsored by The Rust Foundation
Discuss on r/rust
0 notes
Text
tsconfig compilerOptions: A Comprehensive Guide to Optimizing TypeScript Compilation
Introduction
In the world of web development, TypeScript has gained immense popularity for its ability to bring static typing to JavaScript. To harness the full power of TypeScript, it is essential to configure the tsconfig.json file, particularly the compilerOptions. This article will serve as a comprehensive guide to optimizing TypeScript compilation by exploring various compiler options and their impact on the development process.
Understanding the tsconfig.json File
Before diving into the various compiler options, it's essential to understand the purpose of the tsconfig.json file. This file serves as the configuration file for TypeScript projects and allows developers to specify the compiler options, files to include or exclude, and other project-specific settings.
Setting the Target ECMAScript Version
One of the crucial decisions in the compilerOptions is choosing the target ECMAScript version. By setting the target option, developers can indicate the desired output ECMAScript version. For instance, if compatibility with older browsers is a concern, targeting ECMAScript 5 might be preferable.
Selecting Module Code Generation
The module option in the compilerOptions determines how TypeScript generates module code. Developers can choose from options like CommonJS, AMD, ES6, and more, depending on the project's requirements and the targeted environment.
Enabling Strict Type-Checking
TypeScript offers strict type-checking options that help catch potential errors at compile-time. Enabling options like strict, noImplicitAny, and strictNullChecks can enhance code quality and prevent runtime errors.
Customizing Output Paths
The outDir option allows developers to specify a custom output directory for compiled JavaScript files. This can help keep the project organized and separate the compiled files from the source code.
Bundling with Webpack
When working on large projects, bundling TypeScript files is essential for performance optimization. Developers can utilize Webpack and configure ts-loader to bundle TypeScript files efficiently.
Using Source Maps
Source maps are invaluable for debugging TypeScript code in the browser. By enabling the sourceMap option, developers can easily map the compiled JavaScript code back to the original TypeScript code, making debugging a breeze.
Using Declaration Files
TypeScript provides declaration files (.d.ts) to describe the shape of external JavaScript libraries. Developers can leverage the declaration option to generate these declaration files during compilation.
Targeting Different Environments
To target specific environments, developers can use the lib option to include different sets of TypeScript library files. This ensures that the compiled code is compatible with the chosen environment.
Handling Module Resolution
The moduleResolution option controls how TypeScript resolves module dependencies. Developers can choose between node and classic based on the project's module resolution strategy.
Optimizing for Speed
By setting the incremental option to true, TypeScript will cache the results of the compilation to boost subsequent compilation speeds. This is particularly helpful in large projects with multiple dependencies.
Including and Excluding Files
The include and exclude options allow developers to specify which files should be included or excluded from the compilation process. This can help fine-tune the scope of the TypeScript compiler.
Strictly Checking Function Parameters
The strictFunctionTypes option enforces strict checks on function types, ensuring greater type safety and avoiding potential bugs related to function compatibility.
Using Experimental Features
TypeScript continually evolves, introducing experimental features that are not part of the stable release yet. Developers can explore these features by enabling the experimentalDecorators and emitDecoratorMetadata options.
Conclusion
Configuring the compilerOptions in the tsconfig.json file is a critical step in optimizing TypeScript compilation for any project. By carefully selecting the right options, developers can enhance code quality, improve performance, and ensure better compatibility with different environments. Typescript Documentation https://www.typescriptlang.org/tsconfig
FAQs
- Q: What happens if I don't specify a target option in compilerOptions?A: If the target option is not specified, TypeScript will default to the ES3 target. - Q: Can I use multiple declaration files in my TypeScript project?A: Yes, you can generate multiple declaration files, each describing different parts of your project. - Q: Does enabling strict mode make TypeScript less flexible?A: Enabling strict mode enhances type-checking but doesn't reduce TypeScript's flexibility. It ensures better code quality and robustness. - Q: Is it possible to use TypeScript without a bundler?A: Yes, TypeScript can be used without a bundler, but bundling is recommended for better performance and organization in larger projects. - Q: How can I learn about the latest experimental features in TypeScript?A: The official TypeScript documentation and GitHub repository often highlight the latest experimental features and their usage. Read the full article
0 notes
Photo
Mapping the World’s Supply Chains. Leonardo Bonanni, Founder and CEO of Sourcemap, Talks About a Newer, Better Way of Doing Business
https://www.fronetics.com/mappingtheworldssupplychains/
0 notes
Text
Quality Control & Blockchain: Towards A New Corporate Culture
Quality Control & Blockchain: Towards A New Corporate Culture
Because consumers today demand better quality and more transparency in the products they buy, quality control is a key step in the manufacturing process of the fashion industry. In recent years, new standards have emerged in the industry and blockchain now would be the most powerful tool that could store and transmit information throughout the industry, from the producer to the distributor, in a…
View On WordPress
0 notes
Video
Supply Chain Mapping for Everyone
#Vimeo#sourcemap#supplychains#transparency#carbonfootprint#sustainability#supplychainmapping#sustainablesupplychains#Robert remiesiewicz
0 notes
Text
react vscode Debugger for Chrome setting
https://github.com/angular/angular-cli/issues/2453
webpack --devtool source-map 그외설정....
webpack-dev-server --devtool source-map 그외설정....
launch.json
{ "version": "0.2.0", "configurations": [ { "name": "Launch Chrome against localhost, with sourcemaps", "type": "chrome", "request": "launch", "url": "http://localhost:8088/", "sourceMaps": true, "webRoot": "${workspaceRoot}", "sourceMapPathOverrides": { "webpack:///*": "${workspaceRoot}/*" } }, { "name": "Attach to Chrome, with sourcemaps", "type": "chrome", "request": "attach", "port": 9222, "sourceMaps": true, /*"diagnosticLogging": true,*/ "webRoot": "${workspaceRoot}", "url": "http://localhost:8088/*", "sourceMapPathOverrides": { "webpack:///*": "${workspaceRoot}/*" } } ] }
0 notes
Text
Pragma Prefixing the devtool option in Webpack
The Vue.js example webpack config prefixed the devtool option with a hashmark (”#”), I hadn’t seen that before.
devtool: '#eval-source-map',
Apparently it enforces a pragma style. It’s documented in the old Webpack docs.
Prefixing @, # or #@ will enforce a pragma style. (Defaults to @ in webpack@1 and # in webpack@2; using # is recommended)
0 notes
Text
Svelte + Tailwind + Storybook Starter Template
First of all, here's the link to the Github repo, go ahead and start working on your project than fiddle with the configurations. Trust me that takes a hell lot of time.
Visit this website to see the outcome: Svelte + TailwindCSS + Storybook
// Quickstart npx degit jerriclynsjohn/svelte-storybook-tailwind my-svelte-project cd my-svelte-project yarn yarn dev yarn stories
Svelte and TailwindCSS is an awesome combination for Frontend development, but sometimes the setup seems a bit non intuitive, especially when trying to try out this awesome combination. When integrating Storybook, which is another awesome tool for UI Component development and documentation, there is no obvious place to get how it's done. This repo was made to address just that!
You can easily start your project with this template, instead of wasting time figuring out configurations for each integration.
What do you get in this repo
A fully functional Svelte + TailwindCSS integration with side-by-side implementation of independent Storybook
Storybook with 5 essential Addons
Storybook populated with basic examples of Svelte + TailwindCSS
Addons
Accessibility Addon
Accessibility Addon - Colorblindness Emulation
Actions Addon
Notes Addon
Source Addon
Viewport Addon
Svelte + TailwindCSS + Storybook
Storybook is an open source tool for developing JavaScript UI components in isolation
Svelte is a component framework that allows you to write highly-efficient, imperative code, that surgically updates the DOM to maintain performance.
TailwindCSS is a highly customizable, low-level CSS framework that gives you all of the building blocks you need to build bespoke designs without any annoying opinionated styles you have to fight to override.
Steps to build
Clone this repo git clone https://github.com/jerriclynsjohn/svelte-storybook-tailwind.git
Go to the directory cd svelte-storybook-tailwind
Install dependencies yarn
To develop your Svelte App: yarn dev
To develop UI components independent of your app: yarn stories
Documentations
Svelte - API and Tutorial
TailwindCSS - Docs and Tutorial
Storybook - Docs and Tutorial (No Svelte Yet!)
Steps to build it all by yourself and some tips [Warning: It's lengthy]
Instantiate Svelte App
Start the template file using npx degit sveltejs/template svelte-storybook-tailwind
Go to the directory cd svelte-storybook-tailwind
Install dependencies yarn
Try run the svelte app yarn dev
Add Tailwind into the project
Install dependencies: yarn add -D tailwindcss @fullhuman/postcss-purgecss autoprefixer postcss postcss-import svelte-preprocess
Change the rollup config as shown:
import svelte from 'rollup-plugin-svelte'; import resolve from 'rollup-plugin-node-resolve'; import commonjs from 'rollup-plugin-commonjs'; import livereload from 'rollup-plugin-livereload'; import { terser } from 'rollup-plugin-terser'; import postcss from 'rollup-plugin-postcss'; import autoPreprocess from 'svelte-preprocess'; const production = !process.env.ROLLUP_WATCH; export default { input: 'src/main.js', output: { sourcemap: true, format: 'iife', name: 'app', file: 'public/bundle.js', }, plugins: [ svelte({ preprocess: autoPreprocess({ postcss: true, }), // enable run-time checks when not in production dev: !production, // we'll extract any component CSS out into // a separate file — better for performance css: css => { css.write('public/bundle.css'); }, }), postcss({ extract: 'public/utils.css', }), // If you have external dependencies installed from // npm, you'll most likely need these plugins. In // some cases you'll need additional configuration — // consult the documentation for details: // https://github.com/rollup/rollup-plugin-commonjs resolve({ browser: true, dedupe: importee => importee === 'svelte' || importee.startsWith('svelte/'), }), commonjs(), // Watch the `public` directory and refresh the // browser on changes when not in production !production && livereload('public'), // If we're building for production (npm run build // instead of npm run dev), minify production && terser(), ], watch: { clearScreen: false, }, };
Add tailwind config using the command npx tailwind init
Add PostCSS config ./postcss.config.js as follows:
const production = !process.env.ROLLUP_WATCH; const purgecss = require('@fullhuman/postcss-purgecss'); module.exports = { plugins: [ require('postcss-import')(), require('tailwindcss'), require('autoprefixer'), production && purgecss({ content: ['./**/*.html', './**/*.svelte'], defaultExtractor: content => { const regExp = new RegExp(/[A-Za-z0-9-_:/]+/g); const matchedTokens = []; let match = regExp.exec(content); // To make sure that you do not lose any tailwind classes used in class directive. // https://github.com/tailwindcss/discuss/issues/254#issuecomment-517918397 while (match) { if (match[0].startsWith('class:')) { matchedTokens.push(match[0].substring(6)); } else { matchedTokens.push(match[0]); } match = regExp.exec(content); } return matchedTokens; }, }), ], };
Build the project with some TailwindCSS utilities yarn dev
Add Storybook into the Svelte Project
Add Storybook dependencies yarn add -D @storybook/svelte
Add 5 commonly used Storybook Addons:
Source: yarn add -D @storybook/addon-storysource
Actions: yarn add -D @storybook/addon-actions
Notes: yarn add -D @storybook/addon-notes
Viewport: yarn add -D @storybook/addon-viewport
Accessibility: yarn add @storybook/addon-a11y --dev
Create an addon file at the root .storybook/addons.js with the following content and keep adding additional addons in this file.
import '@storybook/addon-storysource/register'; import '@storybook/addon-actions/register'; import '@storybook/addon-notes/register'; import '@storybook/addon-viewport/register'; import '@storybook/addon-a11y/register';
Create a config file at the root .storybook/config.js with the following content:
import { configure, addParameters, addDecorator } from '@storybook/svelte'; import { withA11y } from '@storybook/addon-a11y'; // automatically import all files ending in *.stories.js const req = require.context('../storybook/stories', true, /\.stories\.js$/); function loadStories() { req.keys().forEach(filename => req(filename)); } configure(loadStories, module); addDecorator(withA11y); addParameters({ viewport: { viewports: newViewports } });
Add tailwind configs in the webpack.config.js under .storybook and also accommodate for Source addon:
const path = require('path'); module.exports = ({ config, mode }) => { config.module.rules.push( { test: /\.css$/, loaders: [ { loader: 'postcss-loader', options: { sourceMap: true, config: { path: './.storybook/', }, }, }, ], include: path.resolve(__dirname, '../storybook/'), }, //This is the new block for the addon { test: /\.stories\.js?$/, loaders: [require.resolve('@storybook/addon-storysource/loader')], include: [path.resolve(__dirname, '../storybook')], enforce: 'pre', }, ); return config; };
Create the postcss.config.js under .storybook:
var tailwindcss = require('tailwindcss'); module.exports = { plugins: [ require('postcss-import')(), tailwindcss('./tailwind.config.js'), require('autoprefixer'), ], };
Make sure you have babel and svelte-loader dependencies yarn add -D babel-loader @babel/core svelte-loader
Add npm script in your package.json
{ "scripts": { // Rest of the scripts "stories": "start-storybook", "build-stories": "build-storybook" } }
Add a utils.css file under storybook/css/ and make sure you import 'utils.css' in your stories.js files:
/* Import Tailwind as Global Utils */ @import 'tailwindcss/base'; @import 'tailwindcss/components'; @import 'tailwindcss/utilities';
Write your Svelte component in storybook\components and yes you can use your regular .svelte file. The only thing is that you cant use templates in a story yet, not supported, but yes you can compose other components together. For the starter pack lets just create a clickable button.
<script> import { createEventDispatcher } from 'svelte'; export let text = ''; const dispatch = createEventDispatcher(); function onClick(event) { dispatch('click', event); } </script> <button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" on:click={onClick}> {text} </button>
Write your stories in storybook/stories and you can name any number of story file with <anything>.stories.js, for the starter package we can create stories of Button with the readme notes at <anything>.stories.md. Note: reference the css here to make sure that tailwind is called by postcss:
import '../../css/utils.css'; import { storiesOf } from '@storybook/svelte'; import ButtonSimple from '../../components/buttons/button-simple.svelte'; import markdownNotes from './buttons.stories.md'; storiesOf('Buttons | Buttons', module) //Simple Button .add( 'Simple', () => ({ Component: ButtonSimple, props: { text: 'Button' }, on: { click: action('I am logging in the actions tab too'), }, }), { notes: { markdown: markdownNotes } }, )
Write your own Documentation for the Component which will <anything>.stories.md :
# Buttons _Examples of building buttons with Tailwind CSS._ --- Tailwind doesn't include pre-designed button styles out of the box, but they're easy to build using existing utilities. Here are a few examples to help you get an idea of how to build components like this using Tailwind.
Run your storyboard yarn stories and you'll see this:
You can add more addons and play around with them.
That's a wrap!
#template#storybook#svelte#tailwindcss#ui#component#frontend#webdevelopment#postcss#purgecss#autoprefixer#node#javascript#css#html5
2 notes
·
View notes
Text
tsconfig compilerOptions: A Comprehensive Guide to Optimizing TypeScript Compilation
Introduction
In the world of web development, TypeScript has gained immense popularity for its ability to bring static typing to JavaScript. To harness the full power of TypeScript, it is essential to configure the tsconfig.json file, particularly the compilerOptions. This article will serve as a comprehensive guide to optimizing TypeScript compilation by exploring various compiler options and their impact on the development process.
Understanding the tsconfig.json File
Before diving into the various compiler options, it's essential to understand the purpose of the tsconfig.json file. This file serves as the configuration file for TypeScript projects and allows developers to specify the compiler options, files to include or exclude, and other project-specific settings.
Setting the Target ECMAScript Version
One of the crucial decisions in the compilerOptions is choosing the target ECMAScript version. By setting the target option, developers can indicate the desired output ECMAScript version. For instance, if compatibility with older browsers is a concern, targeting ECMAScript 5 might be preferable.
Selecting Module Code Generation
The module option in the compilerOptions determines how TypeScript generates module code. Developers can choose from options like CommonJS, AMD, ES6, and more, depending on the project's requirements and the targeted environment.
Enabling Strict Type-Checking
TypeScript offers strict type-checking options that help catch potential errors at compile-time. Enabling options like strict, noImplicitAny, and strictNullChecks can enhance code quality and prevent runtime errors.
Customizing Output Paths
The outDir option allows developers to specify a custom output directory for compiled JavaScript files. This can help keep the project organized and separate the compiled files from the source code.
Bundling with Webpack
When working on large projects, bundling TypeScript files is essential for performance optimization. Developers can utilize Webpack and configure ts-loader to bundle TypeScript files efficiently.
Using Source Maps
Source maps are invaluable for debugging TypeScript code in the browser. By enabling the sourceMap option, developers can easily map the compiled JavaScript code back to the original TypeScript code, making debugging a breeze.
Using Declaration Files
TypeScript provides declaration files (.d.ts) to describe the shape of external JavaScript libraries. Developers can leverage the declaration option to generate these declaration files during compilation.
Targeting Different Environments
To target specific environments, developers can use the lib option to include different sets of TypeScript library files. This ensures that the compiled code is compatible with the chosen environment.
Handling Module Resolution
The moduleResolution option controls how TypeScript resolves module dependencies. Developers can choose between node and classic based on the project's module resolution strategy.
Optimizing for Speed
By setting the incremental option to true, TypeScript will cache the results of the compilation to boost subsequent compilation speeds. This is particularly helpful in large projects with multiple dependencies.
Including and Excluding Files
The include and exclude options allow developers to specify which files should be included or excluded from the compilation process. This can help fine-tune the scope of the TypeScript compiler.
Strictly Checking Function Parameters
The strictFunctionTypes option enforces strict checks on function types, ensuring greater type safety and avoiding potential bugs related to function compatibility.
Using Experimental Features
TypeScript continually evolves, introducing experimental features that are not part of the stable release yet. Developers can explore these features by enabling the experimentalDecorators and emitDecoratorMetadata options.
Conclusion
Configuring the compilerOptions in the tsconfig.json file is a critical step in optimizing TypeScript compilation for any project. By carefully selecting the right options, developers can enhance code quality, improve performance, and ensure better compatibility with different environments. Typescript Documentation https://www.typescriptlang.org/tsconfig
FAQs
- Q: What happens if I don't specify a target option in compilerOptions?A: If the target option is not specified, TypeScript will default to the ES3 target. - Q: Can I use multiple declaration files in my TypeScript project?A: Yes, you can generate multiple declaration files, each describing different parts of your project. - Q: Does enabling strict mode make TypeScript less flexible?A: Enabling strict mode enhances type-checking but doesn't reduce TypeScript's flexibility. It ensures better code quality and robustness. - Q: Is it possible to use TypeScript without a bundler?A: Yes, TypeScript can be used without a bundler, but bundling is recommended for better performance and organization in larger projects. - Q: How can I learn about the latest experimental features in TypeScript?A: The official TypeScript documentation and GitHub repository often highlight the latest experimental features and their usage. Read the full article
0 notes