
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Jass::Vue::SFC
provides Vue Single File Component support for Sprockets and the Rails asset pipeline.
Vue SFCs will be compiled to ES modules, which can be imported using the new Rails Import Maps or regular <script module>
tags.
Modern browsers support native loading of ES modules using the import
statement.
By leveraging the new Rails Import Maps, modular JS applications can be built
without having to integrate a complex and tedious JS build pipeline.
However, framework-specific component formats like the Vue SFC format could not be used this way till now.
Jass::Vue::SFC
enables the asset pipeline to compile .vue
files to ES modules,
allowing to build modular Vue applications in a clear and straightforward way,
without the necessity of external build tools.
gem 'jass-vue-sfc'
Add @vue/compiler-sfc
to your JS dependencies:
$ yarn add @vue/compiler-sfc
Jass::Vue::SFC
depends on Nodo, which requires a working Node.js installation.
Place your .vue
components inside your regular asset path, e.g. under app/assets/javascripts
or app/javascript
.
In app/javascript/components/HelloWorld.vue
:
<script>
export default {
data() {
return {
greeting: 'Hello World!'
}
}
}
</script>
<template>
<p class="greeting">{{ greeting }}</p>
</template>
Then add the component to app/assets/config/manifest.js
:
//= link app/javascript/components/HelloWorld.js
Make sure to link the file as .js
instead of .vue
. Sprockets will take care of
converting it into an ES module.
In your HTML code, load the component as a module:
<%= javascript_include_tag 'HelloWorld.js', module: true %>
If you want to use module import
s within your components, pin them in your Rails importmap:
# config/importmap.rb
pin 'vue'
pin 'HelloWorld.vue', to: 'HelloWorld.js'
Then just use them in your component:
<script>
import Vue from 'vue';
...
</script>
Currently, the following things are not (yet) supported:
<style>
section of the SFCFAQs
Unknown package
We found that jass-vue-sfc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.