Tumgik
#I’ve got four days to write 25 pages and an outline for the rest of the novel AND they have to be good
hawnks · 2 years
Text
Tumblr media
in all ways except physically, i am here
#I FORGOT TIME EXISTS#I’ve been so busy lately that I FORGOT that my first official thesis appointment is coming up#I’ve got four days to write 25 pages and an outline for the rest of the novel AND they have to be good#so that my advisor doesn’t immediately regret taking me on NAJSJSJDJD#I’m just sooooooo unsure of what direction it should be going#becuase like it’s a coming of age novel primarily#but not for highschooler#like the second coming of age when you wake up and realize that your life is not what you expected it to be when you were ten and had#all those dreams and anything was possible and suddenly it just hits you that you will just have to#… go on living anyway#but that’s not the plot#the plot is a bunch of subterfuge and running from the past (literally) and figuring out why parents are the way they are#but idk idk#is it good enough?#am I doing the right thing?#can I commit to doing this for the rest of the year?#:<#I’ve had this line since the inception of these characters years ago and it’s like:#‘the van says hallelujah church of eskard on the side. at night they sleep in the back or at shitty roadside motels with vinyl headboards#and missing shower curtains#HELLO WAIT I FIGURED IT OUT#I UNDERSTAND NOW#A plot-> a bunch of hijinks that Agnes goes through in the hopes of regaining her sixth sense#B plot -> Agnes’ repressed misery about her fathers death has summoned a demon (bennet) who waits for her to decide#if she wants to make a deal with him/what that deal will be. eventually in a moment of weakness she asks him to love her in exchange for#her mortal body. thus begins a contentious friendship. he is inordinately kind to her. kinder than anyone has ever been. but at some#unspoken point in the future. he will consume her body.#C plot -> Bennet’s father (the devil) has begun the process of the apocalypse. he has to figure out where his allegiances lie and what#his feelings are towards his sister (Tilney) and his discarded mother are before it’s too late#DID IT FIGURED IT OUT
32 notes · View notes
morningfears · 4 years
Text
Rose Tattoo [Chapter Two]
Tumblr media
Rating: PG
Summary: Calum moved to New York after high school to gain experience as a tattoo artist. It was his hope to return home and open a shop in Sydney. However, life has a way of interrupting even the best thought out plans and Calum found himself still in New York at age 25 with a son and a job as an artist at a shop owned by one of his best friends. His heart had been broken and he told himself - and his friends - time and time again that the last thing he needed to worry about was finding a girlfriend. However, despite the turmoil in his life, he finds himself drawn to the girl with rose tattoo. | Inspired by this blurb. | This is Stevie’s face claim!
Word Count: 6.7k
SERIES MASTERLIST | CHAPTER ONE | CHAPTER THREE | CHAPTER FOUR | CHAPTER FIVE
Stevie stared at her laptop, the blinking cursor and blank word document seeming to mock her as she waited for the words swirling around her brain to magically appear on the screen. She knew what she wanted to write - the interview she’d done the day before seemed to lend itself to a certain kind of article and was neatly outlined in her mind - but it was as if her brain couldn’t connect with her fingers. She felt as if she were incapable of moving, that if she tried too hard to type, her head would explode, and it was beginning to make her heart pound and her head ache. She’d been stuck for nearly an hour, her eyes sore as she stared at the bright screen, and finally huffed a frustrated breath as she reached out and closed her laptop.
She wondered, idly, as she glanced around the small coffee shop if it was the noise distracting her or maybe the overcast sky affect her mood but, if she were being honest with herself, she would be forced to acknowledge that it was neither of those things. It was a myriad of feelings outside of her control, a series of chemical imbalances in her brain and life events that blindsided her, and she hated feeling like she was barely treading water when she was once a proficient swimmer. 
It had been a rough few months adjusting to the seemingly never-ending changes that rushed into her life like tornadoes, spinning out of control and leaving her sanity in shambles, and she was struggling to cope with it all. She had always had a safety net, a group of friends and family close by and ready to catch her should she ever fall, so being on her own and on the verge of spiraling in a city over a thousand miles from home only added to the feeling of helplessness she’d been saddled with since Angela’s diagnosis.
It was hard, watching her best friend go from the brightest light in a room to being snuffed out in a matter of months, and she knew that she wasn’t handling it well. But that was no surprise. Stevie had never handled death well. Dealing with mortality, acknowledging that death was inevitable and a force of nature that could not be ignored, was hard for her. Her worst fear had always been losing the ones she loved and having that fear become reality had shaken her to the core.
She wanted, desperately, to feel happy that she was sitting in a cafe in Manhattan, drinking tea and writing for a magazine she’d read all her life. She wanted to enjoy the cold, the real winter that she never got back home in Louisiana, and play in the snow. She wanted to celebrate her success, a job and a life that she only ever dreamed she’d have, and be grateful that she was getting such an experience.
But it all felt hollow. Empty. Wrong.
Any victory celebrated felt like a slap in the face to the best friend she’d lost, to the family she’d left behind, and to the life she’d given up in order to achieve it. She felt guilty for surviving, for thriving, while everyone around her seemed to be crumbling. She knew that it was just something akin to survivor’s guilt and that it would leave her eventually but she could feel herself slipping back into a headspace she hadn’t been since she was a teenager and, for the first time in years, didn’t feel like fighting it. She wanted to wallow in her misery, to grieve and fall apart in peace, but that seemed counterproductive.
Instead of taking time to process her emotions, instead of talking about them or working through them, Stevie shoved them to the back of her mind. She let them fester, locked away in some dark recess that would likely break her some day, as she had always done and put on a happy face as a coworker - the one who’d recommended Calum to her - took the seat across from her.
“How’s the writing coming?” Noah asked as he placed his own coffee onto the table along with his laptop and notebook. “They’ve got you doing a feature, yeah?”
“Mm,” Stevie confirmed with a hum as she reached for her tea. “The interview went well. The band was good, they gave me a lot of good quotes to work with and a good idea for how I want the article to work. I just need to get it from my brain onto the page,” she sighed as she tapped her nails against the hardwood of the table. “My brain is stuck today.”
Noah made a noise of sympathy as he tapped at the keys on his laptop for a moment before he peered over the screen to glance at her. “You should take the rest of the day,” he suggested as he glanced at the time. “The deadline for that is, what, Monday?” When Stevie nodded, Noah followed suit and took a sip of his coffee before he continued. “You’ve done more this week than pretty much anyone else. Give your brain a break. You’ve got your second appointment with Cal today, right?”
At the mention of her impending appointment with Calum, Stevie felt herself perk slightly. She was still nervous about her tattoo, the idea of spending another few hours with a needle repeatedly being stabbed into her skin would likely never truly appeal to her, but she was eager to finish the tattoo and see the final piece. The base that Calum had done had healed and though there were still details and color to be added, she was thrilled with how it looked so far. It felt as if it belonged on her skin, like it had always been a part of her body, and she was glad that she’d taken a step out of her comfort zone and gotten it done. Completing it would also mean a check on the bucket list and the ability to move on to the next task.
Also, somewhere in the back of her mind, Stevie was looking forward to seeing Calum again. He was sweet, a gentle soul and easy to talk to, and she was looking forward to chatting with him again. He had made the appointment fly by and she hoped that the same would be true this time.
“Yeah,” she nodded, finally answering Noah’s question as she glanced over at him. “Thanks for the recommendation. He was really good. He still has some details to add and the color but the tattoo’s beautiful so far. It’s exactly what I wanted.”
“Good,” Noah nodded with a smile as he gestured to her arm, “can I see? I’ve got an appointment with him next week. I want to add to my leg.” When Stevie shrugged her jacket off her shoulder and rolled up the sleeve of her shirt enough for Noah to see the bold black ink against her skin, his eyes widened and he nodded in appreciation. “That’s bigger than I thought you’d go for a first tattoo but, you’re right. It’s beautiful. He did a great job.”
Stevie hummed her agreement as she reached for her phone to text her boss and ask for the rest of the afternoon off. “He really did. I’m excited to get it finished. He was just really good all around. I was freaking out before, like, almost having a panic attack outside the shop but he was really good about it. And he was really easy to talk to. It was a good experience.”
“He’s a really nice guy,” Noah agreed as he tapped at his keyboard. “I’ve been trying to get an interview with him for ages, though. Ashton agreed but only on the condition we feature them both and Cal is great at dodging my requests. Think you could put in a good word for me today?” Noah requested as he glanced over at Stevie with a grin.
“Yeah, I’ll see if I can remember to hound the poor guy about getting back to you while he’s jamming a needle into my skin,” Stevie nodded as she felt her phone vibrate in her hand. It was confirmation from her boss that she had the rest of the afternoon free and, with a sigh of relief, she grabbed her laptop and shoved it into her bag. “I’m going to go walk my dog before I go in. I’ll see you on Monday, Noah.”
“See you, kid,” he called, taking great pride in the nickname though he was only two years older than her. “Try to get me that interview!”
Without glancing over her shoulder, Stevie flashed her middle finger in Noah's direction - something she knew he wouldn't take offense to - and left the coffee shop to head back to her apartment.
*****
As Stevie crossed town, eager to get back to her apartment and take her dog for a walk before she had to sit still for a few hours, Calum sat on his couch and stared at the cellphone in his hands. He was exhausted, more so than he had been in years, and felt overwhelmed as he realized that his plans for the day had fallen through. He could hear Tāne’s coughing, the same sound that had plagued him for days, and he felt his heart constrict in his chest as he stood to find the cough medicine.
Calum had always considered himself lucky. By all accounts, Tāne had always been a good child. He had never been very fussy. He went to bed on time, was easy to put down, and was a sweet, affectionate, pleasant child. He was easy - as easy as a child could be, anyway - and Calum was grateful. Not much changed when he was sick - Tāne was still a sweet, pleasant child - but he didn’t sleep as much, too sick to get comfortable without the aid of some sort of medication, and Calum’s heart hurt for his son. He was slightly irritable, a little more emotional than usual, and didn’t want to be far from his father as he battled 
Tāne was on the upswing after a rather serious bout of flu and Calum was relieved that the worst of it seemed to be over. He wasn’t quite back to his usual self, not yet, but he didn’t look as miserable as he had and he no longer felt as warm as he had the night Calum had taken him to the emergency room. He was well enough for Calum to be able to report to the shop for the first time in nearly a week - Calum was already dreading the few makeup appointments he would have to reschedule, though he was thankful for Ashton stepping in and taking a few of them to lighten the load - but the babysitter that Calum always used, and trusted to handle Tāne in such a state, was on her way to take an exam and no one else seemed to be able to fill in on such short notice.
He only had one client, Stevie, and he knew that if their initial meeting was anything to go by, she wouldn’t be one to have a meltdown if he had to cancel. However, Calum was itching to get back into the shop - this was the longest he’d been out since Tāne was born - and didn’t want to make Stevie wait any longer for her finished tattoo. He remembered her story vividly, the pain in her eyes and the tremor in her voice as she recalled the loss of her friend, and wanted to help her close that chapter. He knew that it would be at least another three weeks before he could fit her in again and he didn’t want her to have to wait.
As soon as Calum gathered Tāne in his arms and carried him to the living room, his son was clinging to his neck and fighting sleep. Even if Calum was able to find a sitter, he knew that he wouldn’t want to be far from his father when he felt so bad and, honestly, Calum wasn’t fond of that idea, either. So, though he knew Ashton would agree to let Tāne rest in the back room as Calum tattooed Stevie, he grabbed his phone and called to check, just in case.
The moment Ashton was on the other line, Calum could hear the hum of noise from the shop. He knew that things would thin out by the time he and Tāne arrived, there wasn’t a lot on the books for that afternoon, and that the others would gladly help him keep an eye on his son. As he asked, Ashton assured him of as much.
“Of course you should bring him,” he huffed, almost offended that Calum would even bother to ask. “There are still some of his snacks in the back if he gets hungry and Luke should be done by the time you get here. I’m sure he won’t mind sticking around and helping keep an eye on him.”
Calum could hear Luke ask, “Is he bringing Tāne?” in the background and confirmed that he was, indeed, to Ashton. “He’s better but he still doesn’t feel great. I don’t want to be too far from him. You sure you don’t mind?”
“I’m hanging up on you for even asking,” Ashton huffed and Calum smiled at the sentiment despite the slight anxiety he still felt. He knew just how much Ashton, Luke, and Michael loved his son - almost as much as he did - and he knew that Tāne would never be an imposition. Before he could speak, Ashton said, “Bring him a blanket, it’s kind of cold in here today. See you in a few,” and ended the call. 
Calum laughed, his heart easing just a bit, and dropped his phone onto the couch to free his hands. He rubbed Tāne’s back, his fingers gentle against the material of his t-shirt as he listened to his son’s slightly raspy breathing. “You want to go see Uncle Ash?” he asked, his voice quiet as he shifted just enough to see Tāne’s face. “And Uncle Luke?”
Despite not feeling his best, Tāne was never one to pass up an opportunity to see his uncles. He still looked a little worse for the wear with dark circles beneath his eyes and red cheeks, clearly displaying his warm temperature, but he brightened at the prospect of seeing the boys. He didn’t respond verbally, just a small smile and a nod, but that was all the agreement that Calum needed as he returned the gesture.
“Alright,” he hummed before he brushed a stray curl from Tāne’s forehead. “Let’s get dressed and we’ll head to the shop, bub.”
Forty-five minutes later, Calum strolled into the shop with Tāne in his arms and a backpack full of his son’s favorite items - a pale green blanket, a plush penguin (given to him by Uncle Luke), and a copy of Toy Story, ready to be watched on Calum’s laptop - on his back. Calum knew that Tāne would need at least a little bit of distraction, something to occupy his mind and soothe him back to sleep, as he worked and hoped that the things he’d brought were good enough. Almost immediately, Tāne was scooped out of his arms by Ashton with Luke not far behind.
“Get set up for Stevie,” Ashton told him, a small grin at the mention of Stevie (despite Calum’s attempt to redirect him, Ashton still hadn’t given up his attempt to play matchmaker). “Luke and I’ve got our favorite little dude,” he assured him before he turned his full attention to the small boy in his arms. As Ashton took Tāne toward the back, Luke grabbed the bag from Calum’s hands and grinned at him, offering a quick thumbs up, before he followed along.
Calum stood for a moment, gathering himself and savoring the brief respite, before he breathed a deep sigh and set about getting ready for his appointment. He felt a slight bit of his worry ease as he ran through his mental checklist - ink, gloves, paper towels, machine, A&D - and began preparing his station. Having Ashton and Luke, two of the people he trusted more than anyone else, watching Tāne was a welcome relief. It was normal, something that happened more often than not, and gave him a moment to breathe as he listened to Tāne giggle at a story Ashton was telling him.
He hadn’t always been a worrier. He worried whenever Tāne got sick or hurt, just like any parent would, but he’d been the calm one. He never let the worry shake him as he hoped for the best and kept his head on straight. He kissed scrapes and dried eyes and encouraged him to get back up (although he never pushed; sometimes a child just needed to be held and cuddled and Calum was more than willing to provide that). But the impending custody battle had him rattled. He didn’t want to lose his son - not when Tāne meant the world to him - and he felt himself growing anxious over every little wrong move he could possibly make. He worried that he would do something wrong and that he would never see his son again and it hurt more than he cared to admit.
As he imagined losing Tāne, Calum felt his throat tighten and his hands shake. He never imagined his split with El would end in this way, with them bitter and angry at one another, but it did and it hurt that she was only just trying to step into Tāne’s life. Calum didn’t know what her motives were but, knowing her, it was purely out of spite and the last thing he wanted was for his son to grow up in a house where he wasn’t wanted.
“I’m sorry I can’t stay. Sierra and I are - are you okay?”
Calum looked up as Luke returned to the main area of the shop and frowned at the look of concern on his face. He loved his friends and appreciated the concern that they held for him but hated feeling so fragile. He was always the strong one, the one that picked up the pieces for them, and found it difficult to be in the reverse position. He wanted to assure them that he was alright, that he could handle what was being thrown at him, but that was hard to do when he wasn’t sure he could.
Regardless, he nodded at Luke’s question and returned his attention to his workstation. “Yeah,” he nodded, glancing over his shoulder to throw Luke a smile. “Have fun with Sierra. Don’t worry about us. Tāne’s feeling better than he has been and Stevie, the client I have coming in, seems pretty understanding. I feel like she won’t mind if I have to get up and check in on him.”
“You sure?” Luke asked, his frown deepening as he leaned against the counter and watched Calum wipe down his station with disinfectant. “I can stick around for a little while longer. Sierra won’t mind.”
“He’s sure,” Ashton assured Luke as he walked out of the back, wiping his wet hands on a paper towel. “I’m staying. I’ve got to get some drawing done but it’s easier for me to get up and walk to the back than it will be for you,” he rationalized, stopping Calum’s protests before he could start. “You needed to get out of the house, to do something other than be a dad for a few minutes, and I get it. I was just going to draw at home, anyway. I really don’t mind sticking around. Luke, leave. You’ve been a lot of help this week. I’ll see you on Monday,” Ashton said, glancing at Luke as he nodded toward the door.
Luke hesitated for a moment, his phone in his hand and ready to text his girlfriend about their potential changed plans, but Ashton’s look and Calum’s urging convinced him to leave. “If you need me,” he began as he reached for his jacket and began shrugging it on, “just give me a call. I can come back.”
“I appreciate it, Luke,” Calum acknowledged, and he really did. He appreciated everything his friends did for him, the love they had for Tāne, and didn’t know where he would be without them. He watched as Luke waved in their direction and headed for the door with one final glance over his shoulder before he left for the night.
On his way out, Luke held the door open for who he assumed - correctly - was Stevie and gave her a smile before he headed to meet Sierra.
Ashton spotted Stevie first, his grin widening at the sight of the green-haired girl, and he stood to welcome her. “You actually came back,” he teased, his eyes bright as he gestured for her to make her way to the tattoo area. “Calum didn’t scare you off?”
“Mm, not yet,” she confirmed, her own tone playful as she glanced at Calum. “But I can’t promise I’ll be getting anymore tattoos after this one. I don’t know if I’m fully sold on the repetition of tattoos yet.”
“You can hold a conversation right now,” Calum pointed out, a small smile on his lips as he glanced up from where he was setting up the chair for her, “I feel like you might be getting a taste for it.”
Calum watched Stevie for a moment. She looked calmer than she had been the first time, her hands not shaking and her breathing steady, but she still had a hint of nerves present on her face. He could see the stiffness in her shoulders and the way she twisted the rings on her fingers but, as he’d pointed out, she could hold a conversation and had a genuine smile on her lips as she greeted them both. She might not be sold yet but Calum could sense that she was nowhere near as petrified as she had been just two weeks ago.
“I’m finishing up,” Calum informed her as he glanced at the small metal tray filled with items. “I’ll be ready to start in just a few minutes.” He hesitated for a moment, unsure of whether he should tell her what was happening with Tāne upfront or just hope that she wouldn’t mind a few extra breaks. After a moment’s consideration, he decided on the former and added, “I just want to let you know that my son’s here. He hasn’t been feeling to great so he’s in the back. We might take a few more breaks than we did last time, just so I can go check in on him, if that’s alright.”
“Yeah, absolutely,” Stevie assured him, no hesitation whatsoever as she nodded earnestly. “I can reschedule if you need me to,” she offered, her head titled as she watched him fill a cup with ink. “I’d love to get it finished but I can wait until the timing is better for you,” she said and Calum lifted his head to meet her gaze.
She looked so sincere, so earnest, and it made him happy to know that he’d read her correctly. He was glad that she was as sweet as she’d seemed and that she was his client for the evening, not someone who wouldn’t understand. “No, tonight’s fine,” Calum assured her with a nod. “He’s getting better, he feels better than he has all week, but I still want to keep an eye on him. If we reschedule, it’ll be a few weeks, at the earliest. I’ve had to push back everything for the next week.”
“I really don’t mind. Take care of your family first. I can wait, I promise.”
Ashton watched the pair of them interact, a smile on his lips, and Calum wanted to throw a roll of paper towels at him. This would only fuel his delusion that they would be the perfect pair and Calum really didn’t want to endure another week of teasing from his friends. However, he couldn’t deny the relief and slight admiration he felt for her as she encouraged him to delay something that meant so much to her so that he could take care of his son.
Before he could answer, however, Ashton interjected, “I’m sticking around to help keep an eye on him so it’ll be fine. He’s just going to sleep in the back. Cal’s been itching to tattoo all week. Have a seat, Stevie. Take advantage of that desire and my willingness to devote my time to my favorite kid.”
At that, Stevie glanced at Calum and he nodded his agreement, nodded herself before she shrugged off her jacket and pulled the t-shirt she wore up and over her head. She avoided hitting her elbow this time, narrowly, and grinned in triumph as she placed her things onto the table. “It hurt to bend my arm for, like, three days after hitting my elbow,” she told Calum as she took a seat in the chair and settled in.
“You always that clumsy or was it just the nerves?” he asked as he pulled off his gloves and stood from his seat.
“…I don’t want to talk about it,” Stevie mumbled, her pink cheeks telling him that it was a mixture of both.
Calum grinned, finding the action endearing, and shook his head as he glanced down the hall. “I’m going to go check on Tāne and then we’ll get started.”
In the backroom, Tāne was sound asleep as Toy Story played in the background. Calum was relieved to see him look so peaceful, to get a moment’s rest, and hoped that he would stay like that long enough for him to finish Stevie’s tattoo.
For the first hour and a half, the tattoo went smoothly. Stevie was still somewhat reserved, as if there was something lurking under the surface of her smile, and Calum wanted to question it but thought better of it as he worked. She was pleasant, almost talkative, and he found that he enjoyed her company even more this time than he had the first. As he tattooed her, Calum and Stevie talked, much as they had the first time, about music. He told her about some of the bands he’d loved back home, some of the ones that were well known in Australia but weren’t talked about as much in the States, and was surprised to see her face light up at the mention of Violent Soho.
“I saw them a few years ago,” she told him, a smile on her lips despite the pain she felt as he shaded her tattoo, “it was a badass show. My dad had to go to Sydney for work and my sister and I were out for Christmas so he took us and mom and made it a family trip. We went to Big Day Out and it was one of the best days of my life.”
“Yeah?” Calum asked, a smile on his face as he watched her grin. “How did you like Sydney?”
“It was amazing,” she gushed, grinning as she tried not to use her hands - something Calum noticed was hard for her when she got excited. “I loved it. Except it was hot as fuck in January and even though I’m from Louisiana, it was weird seeing everyone in bathing suits and flip flops so close to New Year’s. But I got to see a ton of cool bands. Australia’s music scene is seriously underrated.”
“I guess I shouldn’t be surprised,” he laughed as dabbed at the ink on her skin. When she gave him a quizzical look, he raised an eyebrow. “You write for a music magazine,” he elaborated, “I expect you to have better taste than most.”
“Don’t judge us all by that standard,” she warned with a laugh as she watched him continue to shade the red in the roses. “Some of the people I work with have the shittiest taste in music. Like, I understand that it’s a personal thing but if you listen to your music out loud in a public space, you are giving me permission to critique you and anyone who listens to Florida Georgia Line for personal enjoyment needs to rethink their choices.”
“…. I don’t even know who that is but I think I’m happy about that?” Calum mumbled, laughing at the look on Stevie’s face. He didn’t know her very well, he barely knew her at all, but he already trusted her taste in music and anything she deemed unworthy of his time, he felt compelled to agree.
Before Stevie could respond, before she could tell him exactly what kind of band they were and why he should be wary of modern country, a small voice interrupted them. 
“Daddy, I got sick,” a child Stevie recognized as Tāne - based on the curly hair and chubby cheeks - mumbled, his eyes watery and his lip quivering as he stood at the edge of the room, blinking at the harsh florescent lights.
Calum, who had been about to continue shading, didn’t hesitate to place his machine on the small tray and pull off his gloves. “Can you wrap her up for a second?” he asked, glancing over his shoulder Ashton as he crossed the room to pick up Tāne. “I’ll be right back,” he called, this time glancing at Stevie, before he headed down the hall to help Tāne brush his teeth and change into a shirt that wasn’t soaked with sweat. 
It only took about five minutes to clean up and get Tāne comfortable, the normal length of a quick break, but he refused to be out of Calum’s line of sight after he’d gotten changed. He was fully awake, crankier than he had been, and wanted nothing more than to sit in the chair at his dad’s side and watch as he finished up Stevie’s tattoo. On a normal day, Calum wouldn’t hesitate to ask. Tāne loved watching his dad work and was always good whenever he sat in. However, he didn’t want to make her uncomfortable as he knew that not everyone was fond of children and, even if they were, he didn’t want her to be afraid that she’d get sick. To his surprise, though, she overheard Tāne’s tearful request and ambled over to where Calum stood.
“Calum, please feel free to do whatever you need to to make sure he’s okay,” she told him, directing her words toward him before she glanced at Tāne and offered him a small smile. “I don’t mind, I promise.”
Calum knew that he needed to finish up her tattoo as soon as he could in order to get Tāne back home so he didn’t argue. With a nod, he gestured for her to head back to his station and followed suit. Ashton, who had been ready to jump in whenever he was needed, pulled a chair closer to Calum’s station and had Tāne’s blanket ready for him whenever Calum sat him down. The small boy hid his face half beneath the blanket and watched Stevie curiously as Calum removed the wrap from her arm and settled back into his position.
“I like your hair,” Tāne said after a beat of silence, his eyes glued to the green strands framing Stevie’s face. “Green’s my favorite color.”
“Really?” Stevie asked, a smile on her face as she turned her head to glance at Tāne. “It’s mine, too. Is that why your blanket’s green?” When Tāne nodded, his fingers brushing the soft blanket, Stevie smiled. “I had a blanket like that when I was little but mine was purple.”
“Why not green?” Calum asked, interjecting with a small smile as he watched the exchange between Stevie and Tāne. His son, while sweet and pleasant, was not known for his interactions with strangers and he was mildly pleased to watch him so fascinated by another person.
“My mom wouldn’t let me have a green one. She said green wasn’t a good favorite color for little girls,” Stevie explained with a shrug, “but she also gave me a name that sounds like it should be for a boy so… Logic wasn’t her strong suit.”
“Green should be everyone’s favorite color,” Tāne pointed out, his voice muffled by the fabric of his blanket. He paused for a moment, considering what else she’d said, before he asked, “What’s your name?”
“It’s Stevie. What’s your’s?” Calum was happy that she’d asked, even though he knew that she knew, and continued working on her tattoo as he listened to the exchange.
Tāne told her his name before he paused, frowning at her answer, and said, “Stevie is a boy’s name.”
“It can be,” Stevie nodded as she struggled not to shrug. “But I was named after a girl. Has your dad ever played you any Fleetwood Mac?”
When Stevie asked, Tāne turned to glance at Calum. Calum knew that Tāne wouldn’t know the band off the top of his head - the only music he knew without fail was that of Queen - but he had indeed played Fleetwood Mac for him. Tāne had fallen in love with Landslide the first time he’d heard it and Calum sang a few lines, quietly, to jog his memory.
Stevie stared at Calum for a moment, the surprise at his voice clear on her face, before she winced as he hit a particularly tender spot on her arm. “Is she the one that sings that?” Tāne asked curiously, watching Stevie’s face as she frowned at the feeling. “I like that song.”
“She is, yeah. Her name is Stevie Nicks. My mom really liked her music so she named me after her. And I like being named after her. She was a really cool role model to have growing up,” Stevie explained with a slight nod as she smiled at T��ne.
Stevie and Tāne continued talking for the majority of her session. Much of their conversation was about Scooby Doo and The Avengers, two things that Tāne loved more than almost anything else, and Calum was blown away as he listened to them interact. Most people treated Tāne like the child he was, talking down to him and waiting for him to catch up, but Stevie didn’t. She was patient, helpful if she said something he didn’t understand, but she didn’t talk to him like he was a baby. She carried on a conversation like she would have with Calum and he really appreciated it. It was something he tried to do himself, something he encouraged the others to do, and found it endearing that she tried so hard to connect with him as Calum finished up her tattoo.
He was grateful for her presence, glad that she was the client he’d been tattooing, as she successfully distracted Tāne from the discomfort he’d been feeling. Calum didn’t know if it was a conscious decision on her part or if she was just good with children but, whatever the case, he’d never seen Tāne take so readily to a stranger. He almost hated that this was the last time they were guaranteed to interact and, though he hated to admit it, he was stating to understand where Ashton was coming from. 
However, he didn’t dwell on the thought as he wrapped Stevie’s arm and turned to Tāne. “Can you stay with Uncle Ash for a second while I finish up with Stevie?” When Tāne nodded, a pout on his lips as he bid Stevie goodbye and allowed Ashton to pick him up, Calum gestured for Stevie to follow him to the counter. “Thank you,” he said, glancing at her as he wrote up her receipt.
“What for?” She looked genuinely confused, unsure of what she’d done to garner thanks, and shook his head as he slid the paper across the counter.
“People can be assholes. Thank you for not being one,” he said simply, shrugging his shoulder as he watched her sign the bottom. “And thank you for talking with Tāne. He liked you. He’s never that talkative with people he doesn’t know.”
At that, Stevie grinned brightly and glanced toward the back, where Ashton sat with Tāne. “I liked him, too. He’s a really sweet kid. You and your wife or partner or whoever are doing a great job,” she complimented and when Calum frowned she grimaced. “Um, sorry. I just… assumed?”
“It’s okay,” he assured her, shaking his head as he did. “It’s just me, just us, but thank you. I appreciate it.”
The pair of them stood there for a moment, awkwardly, watching the other. Calum wanted to ask her for her number, or maybe if she’d like to have coffee with him, and he opened his mouth to do so but was interrupted by the sound of a coughing fit from the back. “I’ll let you go so you can get him home. Thank you for the tattoo, Calum. It’s beautiful. Tell Tāne I hope he feels better. And, um, I’ll see you around, maybe?”
“Yeah,” Calum said, his voice reflecting his disappointment as she turned to walk toward the door, “I’ll see you around.”
And just like that, Stevie stepped out of the shop and disappeared into the crowd of people walking down the sidewalk.
Calum stood there for a moment, staring after her, before he breathed a heavy sigh and turned off the ‘open’ sign.  He headed to the back of the shop and took Tāne from Ashton’s arms. “Come on, bub, let’s get you home,” he sighed as he headed to the small back room to begin gathering his son’s things.
Calum placed Tāne on the couch and let him sit as he cleaned up the small area. Ashton followed him and handed him the DVD and plushie as he said, “Please tell me you got her number.”
“If I did, I’d be lying,” Calum sighed as he lifted his hand to rub the back of his neck. “I was about to and then Tāne started coughing and she left. It’s probably for the best. El’s gonna use everything she can against me and a new girlfriend would only give her more fuel.”
“That’s bullshit and you know it,” Ashton huffed, his voice quiet as he tried to keep Tāne from overhearing them. “I know you’re worried but that’s no reason for you to make yourself miserable. What’s going on?”
Calum hesitated as he thought about his answer. A lot of his hesitation did stem from his desire to focus on his son. His first priority was ensuring he kept custody, tied with ensuring that his son had everything he needed. But a smaller bit of his hesitation stemmed from the fact that Calum hadn’t been on a date in three years. He hadn’t been with anyone other than El in almost five. His heart had been broken, destroyed, and he didn’t want to risk that again. He had been in a bad place the last time, depressed and alone, and he didn’t want to return to that state. He didn’t want to be vulnerable, to put his heart in anyone’s hands, and that’s what he told Ashton as he slipped on his coat.
“I don’t have feelings for El anymore but I don’t know if I’m ready. I just want to focus on being a dad. I appreciate the encouragement, I really do, but I’m okay. I promise.”
Ashton watched as Calum and Tāne left the shop, Tāne with his face nestled in the crook of Calum’s neck and Calum with a slight slump in his shoulders. Ashton knew Calum better than he knew himself. And he knew that Calum was lying about not caring if he didn’t get a chance to try something with Stevie.
Calum wanted to pursue something with Stevie, even if it was just meeting for coffee, and this was the first time in three years that he’d shown any interest whatsoever. Ashton didn’t like meddling in his life, not when he knew that Calum was so steadfast in his decisions and generally made the correct choice, however, he felt compelled to meddle and decided that if Calum wouldn’t make the first move on his own, Ashton would give him a nudge in the right direction.
________________________________________________________
Author’s Note: So, thoughts? Feelings? How are you liking it so far? I love Stevie and Calum and Tāne. It’s a little slow burn but! We’re getting to good stuff next week, I promise. I’m trying to upload at least once a week. Chapter 3 will likely be out around the 8th or so (maybe a few days before that) so keep your eyes peeled! If you want to be tagged, just let me know! :) Also! I know this is unrelated but if you sent me Luke and Lottie blurbs, I promise I’ve gotten them and will be answering them. I’m just trying not to get frustrated with MF and think too much about it. I just needed to step away for a second and Rose Tattoo has proven to be a great place for me to do that!
Tag List (like this post or message me if you want to be added!): @toolazymyguy , @irwinkitten , @jamieebabiee , @glittersluke , @spicycal , @lusbaby , @everyscarisahealingplace, @brokenvirtualheartcollector , @if-it-rains-it-pours, @blisshemmings , @calumscalm , @lovemenowseemenever , @ijutreallylovezebras , @rhiannonmichelle , @p0laroidpictures​ , @tomscuddles , @loverofmineluke​ , @harrytreatspeoplewithkindnesss​ , @blueviiolence​ , @loveroflrh​ , @empathycth​ , @luckyduckydoo​ , @tobefalling​ , @bandsandbooksaremykink​ , @watch-how-she-burns , @megz1985​ , @wokeupinaustralia​ , @lucidlrh​ , @canterburyfiction​ , @cal-is-not-on-branding​ , @t-i-n-y-d-i-n-o​ , @jaacknaano​ , @findingliam-o​ , @old-zeppelin-shirt​ , @idk-who-i-am-anymore1​ , @sammyrenae68​ , @flowerthug​ , @calumsphile​ , @caitdaniels​, @drummerboy794​ , @writingfortoomanyfandoms​
167 notes · View notes
queenmylovely · 5 years
Text
The Law of Attraction i
Summary: John deacon x fem!reader. Your first week of classes with Professor Deacon.
Word Count: 2.9k
Warnings: little bit of awkwardness, cussing (probably)
A/N: This is the first part of a probably miniseries or two-parter to fill the request I got. I just am incapable of not writing some backstory I guess. Side note: this takes place in the present but John is in his late 30′s. For you, anon, don’t worry, spicy things are coming soon! I hope you all enjoy, and any feedback including likes, replies, reblogs and asks are greatly appreciated! Requests are open!
Request: idk if you write for prof!deaky but like… i’d be so down for that. 
Part ii, Part iii*, Masterlist 
Tumblr media
(look at this picture, what the fuck)
💥💥💥
In your junior year of university, you had finally decided on your major after switching between math and physics. You had definitively chosen electrical engineering. While you had enjoyed math and physics, they were much too focused on theoretical equations than on real-world objects, which is where you found most of your interest.
The problem solving and designing aspects of electrical engineering were what had appealed to you the most. You could plug input into equations and get the correct answers in your sleep, so creating was what would challenge you in the way you wanted to be.
Since you had taken all of the math and physics prerequisites already, you were able to jump straight into the engineering classes and labs right away in the fall of your junior year. When you had registered in the spring prior, you had wanted to keep two days empty so that you could have days free for your part-time job at the admin office. This had somehow ended up in you having five classes between three different professors. Two of the professors you had only one class each with, which meant you had three classes with the same professor. Your days off from classes had landed on Mondays and Fridays, which you thought would be good bookends to your pretty heavy Tuesdays, Wednesdays, and Thursdays. Plus, the admin job would be good for starting and/or finishing homework when it was slow.
_____
The first Monday of the semester was spent getting a quick brief on your duties as administrative assistant. It seemed like it would be pretty simple; answering phones, putting appointments into the computer’s calendar, scheduling tours, and directing people to the correct offices around campus. They also said that you were free to do homework in your down time.
That Monday was pretty busy though, which was okay since you didn’t have any homework aside from printing out the syllabus. (Which you might have used the office printer to do.)
You had some pretty frantic-looking students asking questions about how to change their classes or where to find their professor’s office. Since you were a junior and had changed your major twice, you were pretty fluent with all of the forms and were able to answer their questions easily. You went home around 5:00, which, with the hour lunch, made for an eight hour day. Since you were taking 16 engineering credits, you felt pretty good with working 16 hour weeks.
Tuesday you started with a System Modeling and Control class that was 75 minutes long, and started at 9:00. The professor seemed nice, which was good, but you were more worried about the professor you had later that day since he was the one you had three classes with. Two of which were labs of no more than 25 students. First, though, you had an Electromagnetic Theory lecture with him on Tuesday and Thursdays.
The class was at 10:30, which meant you had fifteen minutes to walk down the hall from your first class. You figured you would at least get a good seat.
Walking from room 215, you counted the numbers on either side of the hall until you reached 220. The door was cracked open with a rubber door stop and you looked through the crack to see that it was empty. There must not have been a class in there yet. You pushed the door open and walked in, seeing there were actually a couple people there on the edges. The room was lecture style, but pretty small with only four rows with 10 seats each going up from the floor. There was a lectern in the middle of three blackboards that had been wiped completely clean. You nodded at the other students as they looked up at you, but chose to sit in the middle of the front row. Since you were probably getting a later start to electrical engineering than most, you wanted to be front and center to absorb as much information as possible. And perhaps you were a bit of a teacher’s pet at times.
You pulled out the fresh, three subject, college ruled, spiral notebook you had gotten for this course and a mechanical pencil. Labeling the first page “Electromagnetic Theory,” you then flipped the page and wrote the date. You also took out the syllabus for the class and skimmed over it again while you waited for the professor and the rest of the class to get there.
Students slowly trickled in, most opting for the edges of the room and a couple joining you in the front row, but still near the sides. Once it hit 20 past, the professor walked in. He was on the taller side, a man in his late thirties from what you could tell, with brown hair that was shorter on the sides and longer and kind of curly on top. He was pretty handsome, in kind of a dorky way. He was wearing a plaid button down shirt tucked into jeans with a black belt and dad sneakers. You giggled at that last part and found your eyes drifting to his left hand to see if there was a ring there. There wasn’t. You shook your head slightly at yourself. He was your professor, and your professor with who you will be spending over five hours a week, and a crush will not make it any easier to learn, you had to remind yourself.
Just before class started, a rush of ten students came in at once, and one finally filled the spot next to yours. The two of you said hi and exchanged names (hers was Sarah), and were starting to talk about majors until you heard a loud scraping sound. The class turned their heads to the front of the room to see the professor pushing the lectern all the way against the wall. He finished and faced forward, noticing that the class had its eyes on him.
“Well, since I’ve got your attention, I might as well start,” he said with a smile and the class chuckled. “As it says in your syllabus, I am Professor Deacon, but as I know some of you know by your familiar faces, I am often referred to as ‘Deaky,’” he said, putting air quotes around the nickname, which earned another laugh.
“You can call me whichever you prefer, because I really don’t care. Alright, so obviously this is the class for Electromagnetic Theory, so if you’re in the wrong room, go ahead and leave now, we won’t judge,” he paused for a second and when no one moved, continued. “Good, we can get started.”
That first class was spent going through the syllabus mostly, and outlining the type of assignments and materials everyone would need for the course. He had a pretty dry sense of humor, and cracked jokes throughout the class, which helped to put everyone at ease. That being said, it seemed like it would be a very technical and involved class, and the assignments would require a lot of time and were process-heavy. Professor Deacon highly encouraged using his office hours for help or to answer any questions, and you made sure to highlight when they were on your syllabus.
When the class came to an end and everyone was packing up, you chatted to Sarah about it.
“Have you had Professor Deacon before?” you asked her.
“Oh, yeah, I had him for Introduction to Electric Circuits my freshman year. He’s a nice guy, and not too tough a grader. Everyone does really call him Deaky, just so you know,” she answered with a smile.
You nodded, “Good to know.”
She left for her next class and you said goodbye to each other before you walked down to the front of the class where Professor Deacon was.
He was writing something down in a little agenda and you stood waiting for him to finish when he looked up and saw you. “Hello,” he said cheerfully.
“Hi. I’m Y/N Y/L/N,” you said, extending your hand for a handshake. His hand met yours and shook it firmly, and you didn’t miss how warm it was against yours. “I just wanted to introduce myself because I’ll be in both of your labs tomorrow.”
“Oh, that’s you. I had noticed that there was a student on all three of my rosters. Did I have a really good rating on ratemyprofessor?” he joked.
You laughed lightly and responded, “I couldn’t say. I just declared as Electrical Engineering at the end of last semester, so I have some catching up to do.”
“Really? Most people would have a lot of prereqs to get through first. What was your major before?” he asked warmly.
“Well, first it was math my freshman year and then it was physics last year,” you explained a bit sheepishly.
Professor Deacon didn’t seem to think there was anything unusual about changing your major three times however, and just smiled a toothy smile and said, “Ah, that makes sense. Well, welcome to the department, and I’ll see you tomorrow then.”
“Thank you. See you tomorrow,” you smiled back before turning around and walking out the door. You were relieved that the professor you would be seeing so much of this semester was nice, although weren’t sure you would be able to bring yourself to call him Deaky.
_____
The syllabus for the labs had said to only bring a folder, pen or pencil, and to wear at least short sleeves, long pants, and closed toed shoes, all of which you had to be willing to get dirty. As you got ready in the morning, you pulled on a faded pair of jeans, a shirt you had used in the past when painting, and your old pair of tennis shoes. You grabbed a jacket to wear over your clothes as you walked through campus and headed out with just a shoulder bag instead of the backpack you normally took to class.
You drove over to campus and parked in the engineering building’s parking lot. You had bought the parking pass for that building since three of your classes were in it, but hadn’t realized that the engineering labs were in a different building on the other side of campus until the day before. You sighed as you turned your car off, knowing you had close to a twenty minute walk, but put on your headphones, turned on some good music, and started walking over.
The building was old and the cinder blocks were painted white, though you could tell from where it was peeling that it had had many coats over the years of varying colors. You had heard from someone in your Computer Science class (which was an hour after your first with Professor Deacon on Tuesdays and Thursdays) that the building used to be the main Engineering building until the university got an endowment for the new, fancy one. Looking at the building, you thought that it must have been pretty cramped since there were only three large rooms and four little ones, which had since been turned into professors’ offices and what could be called the lobby with a check-in desk and no one behind it. There were two offices for the professors whose names you didn’t recognize and they were both of the left side of the building, opposite of the labs. The last one was on the right side, in between the furthest lab and the “lobby” itself, and had a nameplate labeled “John Deacon.”
Each of the lab rooms were designated for a different type of lab. Lab A was filled with cars and engines which you assumed was for mechanical or automotive engineering, Lab B was filled with drafting materials and models which you assumed was for civil engineering, and Lab C was filled with old computers and motors, which was exactly where you were supposed to be.
There were a couple people already in the room, milling about and chatting to each other. You were glad to see Sarah and went up to her to say hi. Looking around at everyone, the two of you laughed at how you all looked more like house painters than engineering students.
“I’m not entirely sure how our clothes would get dirty, but I guess it’s better safe than sorry,” she commented to you.
“I don’t know, maybe if we accidentally blow something up or it catches on fire, the smoot won’t ruin our clothes?” you guessed and the two of you laughed.
“I for one, wasn’t planning on any explosions, but I guess I know to keep a close eye on you now, Y/N,” said a voice from behind you on your right. Sarah and you whipped around to see Professor Deacon standing right there with a smirk on his face. You felt your cheeks heat up in embarrassment and Sarah had to hide her giggles behind her hand.
“I-I’m- that was just a joke,” you stammered out.
“Hmmm, I guess we’ll see,” Professor Deacon said, walking to where there was a chalkboard at the front of the lab. Before he turned completely away, though, he shot you a wink that eased your nerves about the joke you made, but for some reason sent a shock of adrenaline (or something else) through your body at the same time.
The rest of the lab went better. Professor Deacon started with introductions of everyone since it was a smaller class and people should definitely know each other by the end of the semester. He then went over the lab and safety procedures, congratulating everyone for their proper attire. He himself was wearing these old carpenter pants that looked straight out of a 90’s catalogue and an oversized t-shirt that seemed like it was a souvenir from Bali but had grease stains all over it. And he was wearing the same sneakers as the day before. You couldn’t help but think it was kinda cute that he wore the same sneakers all the time.
He also took everyone on a little tour of the lab building, starting with Lab A and B briefly and then a more indepth look at a room only accessible through the rear of the building. It was a storage/equipment room that housed a bunch of scrap metal, lumber, spare parts, abandoned student projects, and tools. Everything in there was for free use of students of all labs to work on their projects and the projects for the department. To a bunch of engineering students, it was a treasure trove.
Finally, he took everyone back to Lab C and pointed out all of the stations and larger equipment in the big room. After the tour, he had everyone do a little exercise with some of the tools to get acquainted with them. By the time everyone had completed the exercise, the two hours and forty-five had pretty much elapsed and Professor Deacon let everyone head out a little early.
Of course, since you were in his next lab that took place in 15 minutes, you stayed. And, it seemed that you were the only one in both of these labs, so you stood around awkwardly as everyone left. You were about to grab your phone from your pocket when you heard his voice.
“So you didn’t blow anything up, I’m relieved,” he teased from behind you.
You turned around to see him smirking yet again and laughed lightly before replying, “I mean, it’s only been the first part of the first day so I wouldn’t take your eyes off me just yet.”
There was a beat when both of you realized what that sounded like and you saw Professor Deacon’s ears get pink as you felt your neck heat up. Your eyes widened and you determinedly did not make eye contact.
Trying to relieve the tension, he cleared his throat and said, “Anyway, I’m sorry, but you’re about to have the same exact lab in 15 minutes. I would say you could leave but then you wouldn’t meet everyone else, and there are a couple different things that I talk about.”
You were glad that he changed the subject, and further tried to get things back to normal, “That’s okay. I’ll have a leg up on everyone when we try out the equipment.”
The two of you laughed, and you couldn’t help noticing what a nice laugh he had, “That’s the spirit. They’ll be baffled at your ability to use the air compressor slightly better than they can.”
“Hey, I was the best and fastest in the class just now. It might not have been a competition, but you know it’s true,” you said, still smiling, but pointing an accusatory finger at him.
“You’re very passionate. I like that in a… student,” he said, matching your intense gaze. Neither of you had time to think about his hesitation before saying “student” because a group of your classmates walked in at that moment.
Looking down at his watch, he noticed that it was only five minutes before class started, and he walked away, giving you a nod, to go grab the lab rules handouts.
You watched him walk away and sighed to yourself. It seemed the crush you were trying to fend off wasn’t going anywhere, and with all this time spent with him, was only continuing to grow.
💥💥💥
Taglist: @somekindof-cheese @gwilyoubemine @deacytits @supersonicfreddie @siriuslovesmarlene @bowiequeen @acdeaky @deakysgirl @sunflower-borhap-boys @deakyfordays @queensilveryrog @happy-at-home @ceruleanrainblues @briarrose26 @bensrhapsody @painkiller80 
I just kinda created this taglist so if you would like to be taken off or added, just send me a message or ask!
Reminder that my requests are open! If you would like something in a sort of one shot format/length or blurb, etc. send it in! I’ll write for any of the Borhap or Queen boys (Freddie only platonically), Lucy, Patrick Murray, Gardner Langway and adult!Tim Murphy or possibly any of the other characters these people have played if I know enough about them!
110 notes · View notes
unexploredcast · 5 years
Text
BEHIND THE SCREEN: GM Prep for Deliverance, OH (Mystery 1)
Thank you so much to everyone who left a review of our show in February! I’m so excited to be able to share my GM notes and a little bit about how I prep for our sessions with all of you, which are contained in quite a long post beow, and I’m more than happy to answer any questions that come up, so send them my way and I’ll get to them as soon as I can!
Fair warning: this post contains spoilers for... the entire first eight episodes of Deliverance, OH, quite literally, so if you haven’t finished listening to the first arc, it’d serve you best to listen to episodes 00-08 before reading my notes. I don’t think there will be any other spoilers for future episodes, but if there are I’ll be sure to mark them with plenty of space for you to stop or skip reading them.
Thanks again for your support, and enjoy this little walk through my brain on Monster of the Week! 
-Christine
ORGANIZATION
I do the majority of my GM prep for this game in one big google doc I call “Session Outlines” which I store in a folder that has all of my worldbuilding notes, monster ideas, intro scripts, alternate playbooks, etc. I like having everything in one place so I can cross-reference with old arc while I work and on the fly, and this is as close to organized as I get.
The “Session Outlines” document’s got a handy table of contents with links that I can follow to quickly get where I need -- the breakdown is based on the Mystery prep system that Monster of the Week gives, so each arc has it’s concept, hook, monster, minions, bystanders, locations, and countdown. I’m going to go through each of those, but this is what the outline/table of contents looks like on the first page of my doc:
Tumblr media
As you can see, I give each arc a catchy, stupid name that no one else ever sees, just to entertain myself. 
Also in this doc, right at the end, I have the countdowns for various long-term arcs so that I can reference them when those intersect with things happening in smaller mysteries:
Tumblr media
I’ll get a little deeper into countdowns further on in the post for anyone who hasn’t run Monster of the Week before, because they’re my absolute favorite part of prepping for this game. 
PRE-MYSTERY PREP
Now, the first mystery in Deliverance was the first time I’d ever run Monster of the Week, so there are some aspects of prep that I’ve altered a little as I’ve learned more, but let’s just go through each page of my original notes from that arc.
Tumblr media
The first page of my notes is always where I put the high-level thematic stuff that I want going on. The Concept for the arc -- in this case, a complicated question of morality, responsibility, and control that comes up when you find out that the monster that’s killing people is just a kid that doesn’t really know any better. I knew that with this arc I wanted to immediately set up the season with the question of: can we say that a monster is intrinsically evil, and if they are not, how does that effect our moral responsibility in re: trying to stop/hunt them? 
Some of that came from my own agenda coming into the game, and some of that came from our episode 0, with Andrew flagging an interest in this strict anti-monster sect with rigid morals and absolute obedience, and also with Roman flagging an interesting in the nature and morality of monstrosity by choosing the Monstrous playbook. I figured a question like this would instantly give them both a strong agenda, and build an interesting tension between two of the four main characters if I could get them to butt heads about it.
The hook is pretty straightforward: what direct action or effect of the monster’s presence are they going to notice first, what’s our “opening shot” so to speak. I’ve been reading the essay collection Dead Girls by Alice Bolin lately and feeling guilty about having killed Delaney off before she was ever even on screen, but at the time I chose what felt like a trope-y establishing shot for the season so that it would become very quickly apparent where I was attempting to turn certain other tropes on their head. Anyway, someday we’ll be returning to Deliverance again and all I can say is that we may or may not have seen the last of Delaney Chapman... but that’s all stuff for later. 
I also always put Chase’s start of mystery move on the first page of each mystery’s notes for a few reasons -- mostly so I don’t forget to ask him to roll it, but also because his result will, in part, develop the tone that mystery’s going to have. If he rolls a 10, this is going to be a mystery where the Kindred is working closely to solve the same problem, but if he rolls a 9 or below, the group is going to be more splintered, he’ll have fewer resources on hand, and on a 6 or below, they’re going to be actively obstructing him in some way. In play, I bold the result he rolls on this page so that I don’t forget, weeks and weeks later when we’re recording the third session in the mystery, what it was that he rolled, and so I can look back later and remember the progression of his relationship with the sect. 
Anyway, after all of that’s set in place, I move on to firming up the details of the monster -- powers, attacks, weaknesses, all of that good stuff. Most important is the MONSTER TYPE, which is one of my favorite things about Monster of the Week.
For anyone who hasn’t taken a look at the Keeper preparation sheets for Monster of the Week ( HERE! ) I’ll put in a screenshot of what I’m talking about so that it makes sense.
Tumblr media
The first thing I do in creating each monster is pick its type/motivation. Some of them are really obvious, but sometimes having the opportunity to pick an unexpected or non-traditional motivation for a traditional monsters is even better. I’ll elaborate more on that some day when I do one of these posts for a later mystery, because Clara is pretty straightforward in terms of monster type. Here are her full stats:
Tumblr media
Now-- I’ll admit, at the end of the day Clara maybe wasn’t the monster in this arc. I went back and forth a lot on how to frame this arc in terms of monsters and minions, because the crew was never actually meant to fight or kill this kid. But, again, I was so interested in setting them up immediately against someone that made them question their internal concept of “monster” that I went with it. She was for me, ultimately, the central focus of the arc: the cause of the conflict, the motivation for the other involved characters, etc., even if she didn’t end up being the climactic conflict of the whole arc. 
Clara didn’t appear on screen nearly as much as I expected her to: I’m not sure I ever got as far as her physical description as written here. I picked her type as BEAST because, in her uncontrollable werewolf form, that was what she would do -- so if they hurt her, and she transformed in response to that injury, that was what she’d do.
I also write this neat custom move for werewolf bites, but then none of the PCs got bitten by anyone. Still, I stand by the possibility of time-pressure and tension inherent in that 7-9 option.
As for weaknesses, my understanding of the werewolf healing process changed a little bit in play as I started to describe it happening to Evelyn, so between sessions I crossed out the original idea. I honestly have no idea, in retrospect, where I was going with the second bullet point, but thus is the fun of digital ephemera, it still lives in this google doc even though I have clearly ignored it for the rest of forever.
That link about mercury, for the record, goes to an instructables page I found for “how to kill a werewolf” -- Andrew still gets mad at me that “quick silver” not being literal is the reason he has to clarify whether anything I say is a metaphor or literal, but I thought it was way more interesting than Chase’s already having the perfect weapon (his silver knife) on hand. 
Minions are up next:
Tumblr media Tumblr media
As you can see, most of the heavy lifting here was in picking their Bystander Types since all three of them were werewolves with basically the same ability. I even copy and pasted from Clara to the point where I forgot to change the pronouns in Henry’s “supernatural powers” section. You can also see the little copy-and-paste checkboxes I use to represent harm on Henry’s stats -- there was so much happening at the end of that battle that I never fully caught up with filling those checkboxes in, and I think I also had them in my paper notes (which we’ll talk about later in this post). 
The big motivation here was to differentiate Evelyn and Henry as two sides of the coin: both doing “bad” things to protect their sister, but going about them in different ways, with Evelyn -- who has an investment in this town, a life here she needs to protect in addition to protecting her sister -- being subtle, less destructive, really focused on protecting more than on doing whatever it takes, where Henry -- who has just moved back, and has no attachment to Deliverance itself except his family -- was going to do anything it took to get people off Clara’s scent, killing anyone who got suspicious.
You can see that I’ve face-cast Evelyn, here -- I do this for maybe 25-30% of the NPCs I make for this show, either ones I think are going to be particularly important or ones where an image of them just immediately comes to mind. In addition to Evelyn, I think I have actors in mind for Damaris, Van, Larkin, Blanche... Maybe that’s it? I also originally had one for Remedy (blonde Zoe Kravitz) but some incredible fanart has swayed me to having at least 3 different mental images of Remedy. 
I should note that my actual writing process for these notes is not in the order they appear in the doc: at this point, I usually try to at least sketch out the countdown because I’m in the mindset of thinking about the monster and what they’re going to do -- and then I fill in the bystander and location details to suit the countdown, making any adjustments to the countdown that I need to to accommodate new ideas. 
But, in my notes Bystanders and Locations are next, so: 
Tumblr media Tumblr media
First thing of note: somehow, Sheriff Commander-Jones’ wife, the medical examiner, never made an appearance. She is just chilling in the background of this show, waiting for someone to need to talk to a coroner at the morgue, happily married to a very overwhelmed Sheriff. There are a ton of details here that never came up, and one of the things I learned from this first mystery is that I’d over-prepped the hell out of it. My bystander notes these days are a lot simpler: name, pronouns, age, brief physical description, type/motivation, and a one-word trait usually is about it. 
(Melissa was going to be so good, I’m still so sad I’ve not found another way to bring her into things. Maybe someday...)
You can also see here the common symptom where I leave something (Yasumoto’s trait) blank to come back to and then instantly forget about it and it just stays blank forever. Also, I don’t know why the hell I wrote “charming” in Jason’s description. He was never truly meant to be charming. 
I keep the little Keeper list of bystander types/motivations in the doc below all of my pre-made Bystanders in case I need to come up with some on the fly, but more often or not I forget to write them into the notes. Evidence: Remedy is missing from this document after I made her up on the fly when Chase needed healing. 
Tumblr media
Locations are notoriously my least favorite part of prepping. I’m not good at coming up with interesting locations so I struggle through outlining the important places. I spent a lot more time on it with this arc than I do later on in the show, but my go-to is a few keywords describing the feeling/appearance of the place, and what information they might come across there. 
Tumblr media Tumblr media
After that, we get to my favorite part of designing a mystery: the Countdown. 
For those who haven’t read or run Monster of the Week, the Countdown basically represents the steps of what the monster would do if the hunters didn’t interfere, and it gives a sense of direction as to how things will progress. It’s broken up into 6 steps, and the story can move from step to step when the heroes take too long or fail rolls, etc. Here’s my countdown for the first mystery: 
Tumblr media
This one was super concrete compared to some of the ones I’ve written. A recent countdown ended “And then the world ends” or something like that, so this one was a nice, concentrated countdown for a first foray into the game. 
I italicize countdown lines in my notes as they happen in play: when people stall for too long early on, or when they fail and I get to make an off-screen hard move. I think the shadows line here was activated when they took the time to take Chase back to the farmhouse to get healed, which meant they wouldn’t be able to find the information I had for them in the morgue. The rest of the countdown was altered by their decision to go after Evelyn -- because Evelyn couldn’t go after Damaris, Henry did, and thus didn’t go after the police.
I hang out on the Countdown page while we play, until I need to reference something else: it gives me a broad overview of where things are going to go, so switching back and forth between that and the list of Keeper moves on the Keeper reference sheet helps me improvise my responses to failed rolls and decide what’s going to happen as the characters go to specific place. I like keeping this focused outline of what the monster is trying to accomplish in the front of my brain at all times, because it makes it easier to decide what conflicts might arise and what threats are out and about. 
The last section I prepare before we start the first session for the mystery is a broad mystery information section, which isn’t necessarily in the outline of Keeper prep that Monster of the Week provides. For some mysteries I use this a lot, for others it’s just a line or to, but it’s my catch-all space for any information I can’t fit anywhere else but think I might need. 
In this case, it was both notes about werewolf transformations and also a sort of CSI-esque explanation of what had actually happened with Delaney and Jason the night before:
Tumblr media
Again, most of this information didn’t get used -- and I’ve sense balanced out my over-prepping problem, but I almost always have something I want to remember that doesn’t fit in any of the other prep, so that’s what this section is for. 
I think the biggest thing to note here is that a lot of this information is in flux: I’m always playing with what things will work, what things won’t, what will make for interesting decisions based on what the PCs are doing, and adjusting my information and planning from there. Less kill your darlings and more let go of cool ideas when better ones come up, but it’s all about being able to adapt on my feet when things aren’t going to plan. I try really hard not to imagine the full arc of the story and how I think it might go, because when I do they inevitably go in the opposite direction. My focus is more cementing the ideas and themes and questions I’m interested in so that I can find ways for those to come up no matter what the players decide to do. 
Now, that’s all the prep that I do before the first session. But most of our mysteries for Deliverance take 3-4 recording sessions, so what do I do during and between?
DURING AND BETWEEN SESSIONS
During sessions, I tend to make notes on paper because it makes less noise while other people are talking than typing does (I am, as anyone will tell you, a notoriously loud typist), so write some brief notes from the session on a page for that session, and then another page of notes of whatever I’ve scrawled down immediately after we finish recording where I make note of where I want the next recording to begin -- what hooks there are for each character/group of characters, what needs to be addressed, what they’ve been in the middle of, etc. 
I dug through the pile of papers I brought back with me when I moved back to the US this summer to find my scratch page notes for the first mystery (recorded August-October 2017), which are below -- a few handwritten, and one pre-game section that I decided to type because, if I remember correctly, I was making these notes during a lecture because I had procrastinated until the last minute. Major apologies for my oft-indecipherable handwriting; I’d translate, but most of the time I, too, have no idea what it says. 
This one below was my post-session 1 notes, along with my general on-hand notes during the recording of the first mystery -- I’ve got harm checkboxes, Andrew’s description of the farmhouse for reference (which, admittedly, I have not looked at again until just now), and then some notes about where people are headed and what they’ve encountered and/or promised.
Looking back at those harm checkboxes, I think I nerfed Henry’s harm-count because I was pretty sure I was going to kill Chase if I didn’t. I was very much still getting the hang of how much harm monsters can do vs. how much harm hunters can do.
Tumblr media
No, I don’t know what those numbers on the top are. I want to say that was Jason’s iPhone password?
Tumblr media
This one above is pretty typical for what my pre-session notes look like in the middle of a mystery -- each character or character group and then a quick note about where they are/what they’re going to be doing. This looks the most like the notes I take these days, now that I’ve been playing the game for a lot longer. They’re fairly sparse! Basically enough to give me an opening introduction as we start recording and then ask “what do you do?” and go off of whatever their answer to that is. 
Another important note: much of this NEVER HAPPENS. “storm begins, takes them back to the station” who????? The quickest lesson I learned with this game is to not hold on to anything too tight because better things come up so quickly that you can’t afford to hesitate before abandoning ship and jumping to them.
Tumblr media
As you can see, sometimes these notes are a “here’s what happened” or “here’s a thing you need to remember” note, sometimes they’re a “this is an interesting place to start” note, and sometimes they’re a “how the fuck am I going to get them back on track” note. Usually, I’d say, it’s that last one, with this particular group of characters. QUESTIONS are huge, in these notes -- “Where are you going now that Zeke’s kicked you out of the farmhouse?” is, I would say, the ideal kind of note for me to start off a session with. 
Anyway, all that to say: for me, the real work of Monster of the Week is asking the right questions. Having a monster is important and having some idea of setting and bystanders is important, but if I had ten minutes to prep a Monster of the Week mystery, I would have: monster, countdown, and a strong hook, and I could probably improvise it all from there. 
38 notes · View notes
cloudybookash-blog · 5 years
Note
TAKE BACKS ANSWER 1-50 BITCH
Tumblr media
She was all specific until she opened her inbox and saw I dared her to answer all 50 and came back at me like this
The Basics
1.    Do you listen to music when you write?
Sometimes, but like… I don’t write now so dhfaoujfa a bitch wouldn’t know anymore.
2.    Are you a pantser or plotter?
Pantser turned plotter.
3.    Computer or pen and paper?
Both, true anarchy is having 8 drafts of the beginning done in pen and paper that you barely look at and writing the end scene in four different word docs.
4.    Have you ever been published, or do you want tobe published?
I want to be I guess? I MEAN I DON’T WRITE ANYMORE SO WHAT’S THERE TO BE PUBLISHED!?? :a manuscript of the internal warfare between my desire to write and being sucks into my ongoing maladaptive daydream about being a fully-fledged, critically acclaimed author.
5.    How much writing do you get done on an averageday?
Oh, nothing to phenomenal, about 0 words per day.
6.    Single or multiple POV?
Multiple, third person.
7.    Standalone or series?
Series, I don’t know how to end a story line… it just keeps going… on and on and on and o-…
8.    Oldest WIP
Probably some type of HP v Three Ninja’s crossover fan-fiction, it’s on a floppy disc somewhere.
9.    Current WIP
To paranoid to post ANYTHING about it online, despite the fact that no one gives a shit.
10.  Doyou set yourself deadlines?
PFFT, what do you think?
The Specifics11.  Booksand/or authors who influenced you the most
The usual suspects I guess? Stephen King, JM Barrie, Lewis Carroll, JK Rowling,  etc… But, tbh, it was movies that got me first into writing because I couldn’t fucking read back in the day.
12.  Describeyour perfect writing space
I feel like I’ve answered this before. Though now I think I’d change my answer to anywhere, as long as I felt I wasn’t going to be interrupted by people, the need to eat and/or drink, bathroom breaks, back and/or hand pains, or the ever-present creeping feeling that I should be doing something else. 
13.  Describeyour writing process from idea to polished
I watch a movie/read a book/hear a story, then I schedule it in for my next maladaptive daydream and re work it, then I start writing, realise I want to change the perspective, then I start writing that, then I realise I want to change character traits/relationship, then I start writing that, the I realise I know nothing about the world, so I start researching and brainstorming and once that happens I lose all will and motivation and go back to constantly reworking it in maladaptive daydreams that spiral so far from the original Idea I can no longer remember it and at this point I’m to scared to look at it again…
14.  Howdo you deal with self-doubts?
Not Well.
15.  Howdo you deal with writer’s block?
N O T      W E L L.
16.  Howmany drafts do you need until you’re satisfied with a project?
Siri, how do you type the infinity symbol?
17.  Whatwriting habits or rituals do you have?
Bad ones.
18.  Ifyou could collaborate with anyone, who would it be, and what would you writeabout?
I don’t read, NEXT QUESTION.
19.  Howdo you keep yourself motivated?
20.  Howmany WIPs and story ideas do you have?
S̶̡͚̲̬͇͇̮͐͐̈́́͊̌̐̏͗̕̕͘i̶͙̣̽̃̀̎̑̎̋͠ŗ̶͚͓̦̭̥̟̗̩̤̖̅̌̓̊̀̃̅̍̆͆͜ͅi̷͕̇̚,̵̧̡̗̯̝̯̭̳͎͚̠̺̓̌̈̅̀̉͌́͑̊͑͠ ̷̰̠͙̅̆͐̔ḧ̶̢̝͔̞̮͔̣̥͍̪̘̝̹́͂̆̔̐̊̄̎͋̂͋̒͝ŏ̸̼̦͔̬̜̻͊͂̒͒̈́͑͋͋̽͊̕w̴̙̞̫̅̓̎͆̔̀̑̀̀͘̚͠ͅ ̷͚̪̻̥͉̼͕͔̃͗͂̉͒̒͋̾̏̒̒͑͘͜d̶̛̛̟̈́̋̌̈́͂̄̄̍͘͝͝ö̷̖̈͆͂̂̈́̄͂͐̒͘͘ ̴̣̇̊͋̃͒̾̀̌̉͊̉͑͝y̸̺̜̤͇̔̎̅͑̏̋̕ͅŏ̵̬̬͔̥̗̎̑͋̀̒͆̓̍̌͌ử̵͎͙̱̤͊̃ ̵̠̣͙̝̠̳̻͓́̾͆̓ͅt̷͍̣̘͕̣͎̣̏̀̃̔̑̏́͆̾͐̓͜͝͝y̴̡̧̛̥̼̯͚̝̗͗̎̈́̀̊̌̎͒̔ͅp̴̏̽��͇͇̼̯̹̔͊̃́̍̑͛͂̒ě̶̹͚͔̼̰̤̦̟̇̉̒̚͘͘ͅͅ ̵̙͎́̈́̽͂̂̽͋̚ṭ̵̛̛͈͇̇̏̔̿̌̏ḩ̵̢͕̜̬̳̻͙̹̻̟̝̓̎̏e̸̡̝̫̩̣̦͉̺͎̺͈͑̀͋͗̄͊ ̵̠͖̉̎̀̿̎̽̾i̸̜̟̥͎͖͓̒̉̽̄̊͊͜n̶̲̥̦̺̤͂̐f̶͍̰̺͍̖̑̃i̴̯̯͌͒͑͛́̈́̀̄̄͛͘͝ǹ̶̢̜̙͚͖̞̟̻̙̱̲̠͛͐̾̓̑͊̐̋̇͗͘͠i̶̢̨̨̭̩͕͈̊͌̾̃̄̑̎̊̈́̋͘ť̸̝̼̹̟͇̼̖̫̙̲̖͆̎̽͒̎̇̍̐̌͗́ỳ̴̡̟̝̠̫̘ ̸̣̙̼͙͚̹̦̄̐̆̓̅͋̈͝s̴̤̤̑̓͊̽͌̐y̴̦̦̝̪͑̈́̔̓͒̄̕ͅm̶̧̫̠̗͎̱̲̝̬̼̭̘̓̏̍͒̋̀̄̄̇͠͝ͅb̶̨̛̞̭̰͉͛̿̾ō̶̖̤l̶͓̲͌̑̉̄͘͝?̶̨͕̪̿̍̒͒͘͝
The Favourites21.  Whois/are your favourite character(s) to write?
Character whose purpose I know from the get go, so there’s no dicking around about non-sensical things because you’re tryna fill the page.
22.  Whois/are your favourite pairing(s) to write?
I don’t think I’ve ever comfortably or consistently written two character in the same room.
23.  Favouriteauthor
I usually don’t consistently enjoy someone’s work enough to like the whole person, I also rarely even care?
24.  Favouritegenre to write and read
Anything with fantastical elements, love that magic shit.
25.  Favouritepart of writing
At this point actually progressing in my story would be so miraculous I’d keel over and die.
26.  Favouritewriting program
?? I use scrivener, if that’s what you mean.
27.  Favouriteline/scene
Tumblr media
28.  Favouriteside character
All my characters are MCs because I don’t know how to prioritise.
29.  Favouritevillain
Chillling, if I could get arOUND TO WRITING HER.
30.  Favouriteidea you haven’t started on yet
Bold of you to assume I don’t immediately abandon 5-10 year long projects in favour of something new and shiny.
The Dark
31.  Leastfavourite part of writing
The fact that I can’t thought-project my world into a word doc… Honestly, so not user friendly.
32.  Mostdifficult character to write
All of them.
33.  Haveyou ever killed a main character?
All of them.
34.  Whatwas the hardest scene you ever had to write?
All of them.
35.  Whatscene/story are you least looking forward to writing?
A̶̢̨̜̭͇̻̲͈͌̈́̏̿̇͊̑ͅͅl̴̡̤͈̫͈̊͐̈̽l̵̩͖͉͖͆ ̵̢̤͕̻̏̿͂̋̍̑̄́o̸̘̗͉̳̻̩͇͈̙̤͙̳̅̎̿̉f̸̛͈̯̫͇̣̜̬͍͉͈̜̅̑̾ ̷̛̲̰͒̀̏̾̀̍̚̚͜t̷̟͎̞̥͊̆̇̈́̀̋͝h̶̨̰̮̥̠̣͓̹̲̳̱̫̳̉̂ͅe̴͓̠͍̍͒̅̏̒͗̔̆͘ͅḿ̸̡̧̝̜͇̯̣͚͔̝̗̜͚͑ͅ.̸̧̫̥̪̠̟̠̭̮̞̰͈̙̂͂͌̈́̂̿ͅ
The Fun36.  Lastsentence you wrote
A̶̢̨̜̭͇̻̲͈͌̈́̏̿̇͊̑ͅͅl̴̡̤͈̫͈̊͐̈̽l̵̩͖͉͖͆ ̵̢̤͕̻̏̿͂̋̍̑̄́o̸̘̗͉̳̻̩͇͈̙̤͙̳̅̎̿̉f̸̛͈̯̫͇̣̜̬͍͉͈̜̅̑̾ ̷̛̲̰͒̀̏̾̀̍̚̚͜t̷̟͎̞̥͊̆̇̈́̀̋͝h̶̨̰̮̥̠̣͓̹̲̳̱̫̳̉̂ͅe̴͓̠͍̍͒̅̏̒͗̔̆͘ͅḿ̸̡̧̝̜͇̯̣͚͔̝̗̜͚͑ͅ.̸̧̫̥̪̠̟̠̭̮̞̰͈̙̂͂͌̈́̂̿ͅ
37.  Firstsentence or your current WIP
[insert charac name here]’s body slammed down heavily, face first
38.  Weirdeststory idea you’ve ever had
Honestly, they could all take the cake. I’m weird… have you ever seen me away from my writing resources? No. Have you ever seen any of my actual writing? No, that’s weird, I’m a weirdo.
39.  Weirdestcharacter concept you’ve ever had
Read the above answer^^
40.  Sharesome backstory for one of your characters
One character is thought of to be as old as time itself, maybe even older. He forgot his original birth name, came to a stable and asked one of the workers what their name was. Upon hearing it he went, “I like that, it’s mine.” and killed the worker and when the stable owner came to see what happened and asked the living character what their name was, living character gave the one belonging to the worker he’d just killed and walked off.
The Rest of It41.  Anyadvice for new/beginning/young writers?
I am in no position to be giving any such thing, honestly, the real question is has anyone got any advice foR ME?!?!
42.  Howdo you feel about love triangles?
Hard to do right, can’t write them myself because… (see answer to q:27)
43.  Whatdo you do if/when characters don’t follow the outline?
See where they’re going and if it’s not funky fresh: re-write the entire scene with them on a titanium leash
44.  Howmuch research do you do?
Way more now that I no longer write.
45.  Howmuch world building do you do?
Way more now that I no longer write.
46.  Doyou reread your own stories?
Way more now that I no longer write.
47.  Bestway to procrastinate
Never write.
48.  What’sthe most self-insert character/scene you’ve ever written?
All of them, I’d love to be a souped-up, immortal child running around in a magical forest with my friends.
49.  Whichcharacter would you most want to be friends with, if they were real?
Either one of the chill ones or one of the so NOT CHILL ones, depends on how much drama I want at any given time.
50.  [Otherquestion—ask me anything]
??? Never ask me or my son a question ever again.
3 notes · View notes
theherocomplex · 6 years
Note
Writer asks - 1, 6, 11, 16, 22, 25, 41, 44?
I already answered 44 here. :D
1. Favorite place to write.
It’s a bit cluttered right now, but I love sitting at my desk to write – it’s my parents’ old kitchen table, so it’s got plenty of room to spread out all my notebooks and bits of research (along with the requisite teapots/mugs/plates of toast). I have a lap desk that I use if I want to go write in my armchair, but since Orpheus has colonized that seat, I mostly write at my desk.
(But never, ever in bed.)
6. Favorite character you ever created.
Oh gosh, this choice feels so sadistic! For fic characters, it would have to be Rhyssa Hawke, simply because she’s so joyful and charming and ridiculous, and has such a rich backstory to play with. As for original fiction OCs, it depends on what I’m focusing on at any given moment, which means Sirin from TVP currently tops the list (for…many of the same reasons that Rhyssa does, heh. Small surprise there!).
Popping the rest under a cut! 
11. Describe your writing process from scratch to finish.
“Hahaha wouldn’t it be funny if I wrote this thing?”
“Hey, wait, that could actually be really cool!”
“NO, I DON’T NEED ANY MORE PROJECTS.”
This continues for anywhere between two to four days before I give in.
I buy a notebook “just in case”; it’s half full within two weeks, but I’m still “not starting anything new”.
I have a sudden explosion of creative energy on ALL my projects, along with wild optimism about how and when I’m going to finish everything.
I buy a second notebook; I know it’s over.
A Scrivener file is created; I create an outline that I will throw out within two chapters.
I start crying over one of the pairings in my story – this is also around the time things start getting sad/scary/both, no matter what my original plans for the piece were.
At this point, I start feeling overwhelmed by how much I have to write, so I’ll start reprioritizing – right now, my goal is to finish off lingering fic projects, while also building up a solid stable of short fiction that I can send out, so while I’ll work on original fiction as inspiration strikes, it’s not getting the full push fic is at the moment.
This process will repeat itself innumerable times over the rest of my life.
As for the actual writing, it goes like this:
If it’s the weekend, I get up, I make breakfast and a pot of tea, and I do my morning pages. If it’s a week night, I have a light supper and make a pot of tea.
I listen to the playlist I made for whatever I’ll be working on that night to get into the mindset/mood I want.
I do a few stretches and turn on Self-Control for however long I plan to write (usually ninety minutes to two hours).
Then, I do some quick sketching/“what needs to happen in this bit” planning by hand in whatever notebook I have designated for that story.
I turn on the music for whatever I plan to write (DA fics get the Jupiter Ascending soundtrack; original fiction gets GB!YE or a long playlist I put together of epic instrumentals.
And then, I start looking for the hole in the paper, to use Stephen King’s phrase.
16. Where do you take your motivation from?
If we’re talking about the urge to write, I can only describe it as a restless, impatient demand – it’s something I must do, or I feel off-balance and resentful. And it’s something like responsibility, too: these stories won’t get told if I don’t write them, and if I want to read them, well, better get to work!
If it’s inspiration we’re talking about: music, mainly – I tend to develop setpieces for my stories based on something I’ve heard, so I’m always writing with the goal of putting the emotions the music inspired into words.
22. How many drafts do you need until you’re satisfied and a project is ultimately done for you?
It really depends on the project. I tend to write very clean first drafts if I can get into the flow of the story, which has made me a little complacent (I assume I can go easy on the heavy-duty line editing, which I’m trying to be better about). I would say, for fic, I vary between three and four drafts (I count each major editing session as a draft), usually ending up at three.
If we’re talking about original fiction, I’ve rewritten the first chapter of TLS about twenty times and the entire book twice (I think the next draft will be it, as far as “start from scratch” goes). I want to extend that kind of editing-energy to my fic, as well, but it’s already so daunting!
25. Linear or non-linear, and why?
Linear, all the way. I’ve found that if I write a scene out of order and then try to plug it into the story when I reach that point in the plot, I end up tossing it out. It’s never a clean graft. I write scenes as they come to me, and they’re either useful as a basis for the finished version of the scene, or they inform the writing of another scene that works much better.
With the way I intuit my way through my writing, going in a linear direction is the only thing some days that keeps me from pulling out my hair.
41. How many stories do you work on at one time?
I have a lot of stories in-progress right now, but I’ve learned that I work best when I focus on one piece for a long period of time. I take breaks to work on shorter pieces or other works if I get inspired, or really stuck on my current project, but I love the depth and richness I get from immersing myself in one work for a long period of time.
13 notes · View notes
oisugasuga · 6 years
Text
Author About Me
Tagged by the lovely @mystictrashheap, thank you so much ♥(ˆ⌣ˆԅ)
1. How did you come up with your username and what does it mean?
I think oisugasuga is pretty self explanatory XD
2. Which fanfic of yours has the most feedback? (bookmarks/subscriptions/hits/kudos).
Definitely “these stars here on earth”
3. What is your AO3 profile icon, and why did you choose it?
Suga because I absolutely adore him
4. Do you have any regular/favourite commenters?
I love all of my commenters, but I do have regular ones that are incredibly sweet and that I send virtual hugs to in thanks
5. Is there a fanfic that you keep going back to read again and again?
Ummm, I don’t usually go back and read fanfic (bc I’m always finding so many new great ones), but I do have a lot of favorites... maybe I’ll make a fic rec list soon
6. How many stories are you subscribed to? How many do you have bookmarked?
I’m bad at subscribing to or bookmarking stories, I usually just go back in my browsing history;;
7. Which AU do you find yourself writing the most?
Um, I guess just slice of life ones? “these stars here on earth” is sci-fi, and I have a space AU, a witch AU, a soulmate AU, and an ongoing merman AU, but the rest are pretty much slice of life... 
8. How many people are subscribed and bookmarked to you in total? (you can view this on the stats page)
Meh, I’d rather not answer this one...
9. Is there something you’d like to write about but are afraid of people judging you for it? (Feeling brave? If so, share it!)
Hmmm, not really? I do want to do a horror piece sometime soon, but I’m not really afraid of being judged for it
10. Is there anything you would like to be better at? Writing certain scenes or genres, replying to comments, updating better, etc.
Definitely outlining my plots bc I kind of just wing my stories and with longer ones I wish I had thought it through first because there are different tangents that I feel would’ve worked better... and I guess writing more often, but between working a full-time job that I sometimes have to bring home with me and maintaining some level of social interaction and working on strengthening my knee so I can actually start running again, there’s not enough hours in the day to always do everything I want 
11. Do you write rarepairs or popular ships more often?
Definitely rarepairs... and by that I mean I mostly only write OiSuga (oops)
12. How many stories have you posted on AO3 to this day (finished and unfinished)?
14... you can check them out here ⚈ ̫ ⚈ (I have to slip that self-promo in here somewhere)
13. How many stories do you have saved in/with your writing program?
47
14. Do you write down story ideas, or just keep them in your head?
I jot them down, there’s no way I would remember all of my ideas and I usually write the first little bit of the piece right when I think of it
15. Have you ever co-authored a story?
No, but I’m hoping to do a few with @fairylights101writes soon (there might also be one already in progress which I’m super excited about because their writing is hands-down some of the best I’ve ever read)
16. How did you discover AO3?
Through reading Haikyuu!! fanfic
17. Do you consider yourself to be a popular or famous author in your fandom(s) on AO3?
No, not really, but I’m more than grateful for the people who do read my work because it means more than I could ever say
18. Do you have a nickname or fandom name for your readers?
XD No, but I might just come up with one now... if anyone has ideas, feel free to drop a message in my inbox
19. Was there an author who inspired or encouraged you to write?
Writing is one of the most important things in my life, so I feel like I would be writing regardless of others... but J.K. Rowling, R.L. Stine, Lauren Oliver, and so many others (including the countless, amazing people I’ve found through writing fanfic who have created gorgeous worlds and plots that honestly deserve to be published and just as recognized as the work of the people above) are all definitely inspirational
20. What writing advice would you give to a beginning author?
Don’t compare yourself to others unless you’re willing to be open and look for the improvements you can make instead of tearing yourself down (I struggle with this a lot personally) Don’t forget that everyone has their own unique style of writing (so yours might be completely different from the rest, but that’s what makes it yours)... above all else, never forget to keep looking for ways and opportunities to make yourself better, but don’t be afraid to give yourself breaks to just take a breath and regroup
21. Do you plot out your stories, or do you just figure it out as you go?
I wing them;;
22. Have you ever gotten a bad comment on a story? If so, what did you do?
I never have, but honestly, getting one would be insignificant to me... people who are only looking to tear down others (and I’m talking about people who are only there to break someone apart, not provide constructive criticism) don’t really have an opinion as far as I’m concerned, or at least don’t have one that deserves a second of my time
23. Is there a certain type of scene that you have a hard time writing? (action, smut, etc..)
I’m working on my smut tbh
24. What story(s) are you working on now?
“The Knockout Series”, some OiSuga kitchen smut that was supposed to be done for the last OiSuga week, and a Jumanji AU starring the Seijoh four (I got inspired by the new movie trailer, don’t judge me) 
25. Do you plan your next project(s) before you finish your current ongoing story(s)?
Yeah... unfortunately
26. Do you have a daily writing goal set for yourself?
Nope, I just try to fit it in whenever I can
27. Do you think you’ve improved as a writer since you first started?
Definitely
28. What is your favorite story that you’ve written?
Probably tshoe, although I love all of my stories
29. What is your least favorite story that you’ve written?
See question above
30. Where do you see yourself (as a writer) in 5 years?
Well I’m trying to get published currently, so we’ll see✌️
31. What is the easiest thing about writing?
Coming up with way too many ideas that I can’t keep up with
32. What is the hardest thing about writing?
Being too hard on myself I guess
33. Why do you write?
Short and simple, because it makes me unbelievably happy
tagging: @fairylights101writes, @amajikies, @rykrae, @quietlyobscure, @josai, @mckendie, @itsalwaysmiyukikazuya, @wakatooshi-kun, @humandisasterbuckybarnes, @cheatos, @frenchibi, @anavoli, @sapphirablue-writing, @kaiyouchan, @tetsuskitten and anyone else who would like to do this<33
8 notes · View notes
igotopinions · 4 years
Text
Books I Read in 2019
* = Re-read Check out past years: 2012, 2013 (skipped), 2014, 2015, 2016, 2017, and 2018. Follow me on Goodreads to get these reviews as they happen. 1) The Right To Be Cold: One Woman's Story of Protecting Her Culture, the Arctic and the Whole Planet by Sheila Watt-Cloutier 2) Nollywood: The Making of a Film Empire by Emily Witt 3) The Consuming Fire by John Scalzi 4) My Year of Rest and Relaxation by Ottessa Moshfegh Reads like a more mature Chuck Palahniuk. 5) Of Dice and Men by ME I won't be a dink and give myself a star rating or glowing review, but I gotta get that credit for my annual reading challenge! I'll also say it's a richly rewarding experience to, after all the work of writing & editing & publishing & promoting, to re-read something you wrote and still feel all the strong, positive feelings it gave as you figured out the first draft. 6) Lagos Noir, edited by Chris Abani 7) The Secret Lives of Colour by Kassia St. Clair 8) The Buddha of Suburbia by Hanif Kureishi A really fun, cleverly written coming-of-age story with just the right period touches to it. I gobbled this thing down in a couple of days, having no problem seeing why Zadie Smith spoke highly of it in her latest book of essays. 9) Moon of the Crusted Snow by Waubgeshig Rice 10) America: The Farewell Tour  by Chris Hedges   TL:DR This book is not toilet paper, but it sure is shit-adjacent. It gave me strong feelings, which you can read on Goodreads. 11) The Anatomical Venus: Wax, God, Death & the Ecstatic by Joanna Ebenstein Great introduction to the subject with fantastic photos & illustrations. My only frustration was the layout, which frequently breaks up the main text mid-sentence for two or even four pages of images with details captions to read or full page quotes, so it takes a bit more effort to read linearly. 12) The King of Elfland's Daughter by Lord Dunsany I found this through the ol' Appendix N reading list and it's not hard to see how this influenced D&D in many ways, but it has value well beyond that novelty. This is a wonderful fantasy tale in the vein of classic fairy tales, a welcome break from the kind of epics we mostly associate with the genre these days. By the final run up to the ending I was really immersed in what I was reading and I know I'll be looking up more of his books. 13) The Worst Is Yet to Come: A Post-Capitalist Survival Guide by Peter Fleming *14) A Canticle For Leibowitz by Walter M. Miller Jr.   The first third remains perfect. The middle third is better than I remember, which is to say very good indeed, despite the feeling of inevitability running through it. The final third remains a pretty obvious punchline stretched out over too many pages, something basically predicted by the ending of the middle story. But! Ah! That first third! 15) The Gods of Pegana by Edward John Moreton Dunsany In theory this was an influence on Lovecraft's Dreamlands cycle books. 16) Era of Ignition: Coming of Age in a Time of Rage and Revolution by Amber Tamblyn 17) Looking for Transwonderland: Travels in Nigeria by Noo Saro-Wiwa 18) 1985 by Anthony Burgess 19) Infinite Detail by Tim Maughan 20) Seasonal Associate by Heike Geissler,  Kevin Vennemann (Afterword), Katy Derbyshire (Translation) 21) Digital Minimalism: Choosing a Focused Life in a Noisy World by Cal Newport 22) How To Write Adventure Modules That Don't Suck Edited by Jobe Bittman 23) The Immortal of World's End by Lin Carter 24) This Is Water: Some Thoughts, Delivered on a Significant Occasion, about Living a Compassionate Life by David Foster Wallace 25) My Sister, the Serial Killer by Oyinkan Braithwaite *26) Idoru by Oliver Brackenbury 27) Conan by Robert E. Howard,  L. Sprague de Camp, Lin Carter 28) Heroes in the Wind: From Kull to Conan by Robert E. Howard 29) The Postman by David Brin Yes, this is that “The Postman”, the one which was adapted into a universally reviled Kevin Costner film in the mid-to-late nineties. It is, however, significantly different and far more enjoyable. It is an extremely White Straight Guy book with some curious ideas about gender in the back end, a "Rah rah, America!" through-line, and an obsession with describing horses as "steaming". It is also a well-crafted, clear, concise, quickly-moving story that avoids several obvious turns most authors would have plowed right into, and overall serves as a great exploration of the power of lies & myths. Plus, yeah, it is kind of heartwarming to imagine the concept of snail mail & the people who deliver it serving to re-unite us in the post-apocalypse. Unlike the movie, I'd honestly recommend this. Heck, I'm thinking I'll start exploring the rest of his catalog. 30) Beastie Boys Book by Michael Diamond  & Adam Horowitz If you're a fan, then you'll like this. If not? I dunno man! The whole thing feels like hearing stories from your favourite old high school buddies when they're at their most honest and interesting. Great stuff. 31) Best. Movie. Year. Ever.: How 1999 Blew Up the Big Screen by Brian Raftery 32) Return of the Lazy Dungeon Master by Michael Shea 33) Conan of Cimmeria by Robert E. Howard,  L. Sprague De Camp, and Lin Carter. As tends to be the case, the pure Howard stories are best. Carter and De Camp are mostly interested in arranging Howard's work into a larger, more coherent universe...which is fine, I guess, but it has a way of making Conan feel less a legend striding in and out of fantastic situations, more a man - a strong, interesting man, sure, yet still just a man. *34) The Hunter by Richard Stark *35) Beast by Paul Kingsnorth 36) The Marrow Thieves by Cherie Dimaline 37) It Came from Something Awful: How a Toxic Troll Army Accidentally Memed Donald Trump into Office by Dale Beran 38) Planetes, Vol. 1-4 by Makoto Yukimura 39) The Bookshop on the Corner by Jenny Colgan 40) Reawakening Our Ancestors' Lines: Revitalizing Inuit Traditional Tattooing by Angela Hovak Johnston 41) Split Tooth by Tanya Tagaq 42) Bird by Bird: Some Instructions on Writing and Life by Anne Lamott Part life-as-a-writer therapy, part craft, this leans more toward the latter than Stephen King's ON WRITING and that's plenty fine.  A nice, light read that holds value for writers at all stages of their career, I reckon. 43) Conan The Freebooter by Robert E. Howard, L. Sprague de Camp As tends to be the case with these collections, the pure Howard stories are best. That said, Lin Carter carries himself much better here than in some of the earlier volumes. There are no magical abstractions of good and evil arm-wrestling each other while Conan just stares at them... 44) The Heroes by Joe Abercrombie 45) The Case of Charles Dexter Ward by H.P. Lovecraft Pretty good stuff but, as was pointed out on the excellent Appendix N Podcast, this story would have been really something had it been edited down a bit. RACISM METER: Honestly, pretty okay, which is saying something for Lovecraft! No cats with awful names or race theory or any of that. Just a good wholesome story of madness and history. 46) Difficult Men: Behind the Scenes of a Creative Revolution: From The Sopranos and The Wire to Mad Men and Breaking Bad by Brett Martin 47) Swords and Deviltry by Fritz Leiber 48) The Enchantress of World's End by Lin Carter 49) The Barbarian of World's End by Lin Carter These are not terribly good books....but I keep reading them for the goofy ideas and setting. Averaging 180 pages, they're not a big investment so hey why not? 50) The Giant of World’s End by Lin Carter The first is the best. I think because it was written as a complete story, not the literary equivalent of another episode of a Saturday morning cartoon, as the other World's End books read. As with the rest of the series it is enjoyed more on the merits of the wacky ideas than the quality of prose, including a part near the end who may well have been a source of inspiration for the Emperor of Mankind in the Warhammer 40K universe. Its main drawback is the classic scifi/fantasy failing of providing multiple asides to historical background meant to add depth to the world but which is ultimately meaningless to the reader as it has little if anything to do with the story - nevermind the characters! Heck, it's only 140 pages. It's fun. The ending actually got to me a little. It's a good place to pluck out ideas for tabletop roleplaying, if you're into that. Yup! 51) Wonder Tales: The Book of Wonder and Tales of Wonder by Lord Dunsany 52) Outcast of Redwall by Brian Jacques It's a fun little story, clearly intended for younger audiences, and I've no regrets having bought it second hand. BUT You could have clipped off nearly a hundred pages if the author didn't feel compelled to give you a highly detailed account of every single meal - including many feasts - had by characters big and small. Holy mother of God do you come out of this knowing a lot about the diets of the various woodland creatures, with their meadowberry pies and etc. 53) Björk's Homogenic by Emily MacKay 54) DCC RPG Annual Vol 1 by Steve Bean, Julian Bernick, Daniel Bishop, Jobe Bittman, Tim Callahan, Colin Chapman, Michael Curtis, Edgar Johnson, Brendan LaSalle, Stephen Newton, Terry Olson, and Harley Stroh 55) Conan the Avenger by Robert Howrd & L Sprague De Camp This is one of the better collections. Only the third story is a reconstruction from one of Howard's outlines, the rest are undiluted and glorious.That said, the back two stories are a bit cringey re: race, *especially* the reconstruction I mentioned. I'd say I don't know who looks at a Howard story and thinks "Ah, this needs more complex racial hierarchy nonsense!" but I do and that man's name is L. Sprague De Camp, apparently!The important thing is now I'm all caught up for the next episode of The Appendix N podcast, which I heartily recommend. 56) Medallion Status: True Stories from Secret Rooms by John Hodgman 57) Grand Union: Stories by Zadie Smith 58) The Singing Citadel by Michael Moorcock 59) White Fragility: Why It’s So Hard for White People to Talk About Racism by Robin DiAngelo 60) The Psychopath Test by Jon Ronson *61) Virtual Light by William Gibson 62) The Dragon Masters by Jack Vance *63) Roadside Picnic by Arkady Strugatsky, Boris Strugatsky, Ursula K. Le Guin (Foreword), Olena Bormashenko (Translator) *64) Bill, the Galactic Hero by Harry Harrison A fun little dunk on Heinlein and his ilk. Very slapstick. 65) Gonzo by Hunter S. Thompson *66) McGlue by Ottessa Moshfegh
STATS Non-Fiction: 23 Fiction: 42 Poetry Collections:0 Comic Trades: 0 Wrote Myself: 1
0 notes
authorkylehartman · 7 years
Text
New ask game for writers
1. Favorite place to write.
In a room alone on my laptop, however I’ve been poor lately and my laptop is broken, so I’ve been writing on my phone. I come to enjoy writing on my lunch break at work in my car.
2. Favorite part of writing.
It would probably have to be the world building as far as the villain is concerned and showing them off to the reader.
3. Least favorite part of writing.
Being distracted
4. Do you have writing habits or rituals?
Not really. I just do it. I used to have to take a bath and getting my mind working before sitting down are writing.
5. Books or authors that influenced your style the most.
There are things always being added to this list. First off, I’d be amiss to not mention that me having any sort of style is thanks to Micheal Creighton. I was always very creative and good at writing, but in 2009 I had read Next not long earlier and decided to write a story of my own that I am now embarrassed of. 
Anyway, Max Hathorne who writes Kronos Rising was a huge influence. I might not write the same kind of science fiction as him, but the way he approaches things, including the villains and Kornosaurus/ Kraken inspired me to added scence in the Zoey series that center around the villain, lord Neball. 
Neal Asher’s solid world and character building left me in awe as I read the Transformation series, this has inspired me to do a better job with those aspects. 
George R.R. Martin has inspired me in similar ways, but also to not always be afraid to have to many characters. Sometimes it fits and works best with a series.
6. Favorite character you ever created.
Oh damn, that is a loaded question. On one hand I’ve got a character named Haley who is extremely depressed, abused and also has a lot of anxiety and some addictions. I don’t think a depressed character has been written to this extreme in a novel, at least that I can remember.
Zoey, is my first love obviously. She is the title character to the first series I ever started creating. The title character to an absolutely massive series. There is reason enough in that for her to be my favorite.
Randy would have to have a place high up on this list because he is the main hero for most of the Zoey series, I can’t give away why he isn’t actually. Though I highly enjoy his personality despite his life threatening flaws.
Hollie is a character in the Zoey series that comes in much later, but I quite enjoy her as well.
I also have a soft spot of a character named Eric in a store that is very nearly ready to be written, Let it Die. He’s the main.
7. Favorite author.
Micheal Creighton
8. Favorite trope to write.
I don’t feel I have one. Though sometimes I’ll be writing a scene and one will pop into mind and I’ll have to insert it somewhere.
9. Least favorite trope to write.
Again, I don’t have one. I don’t go out of my way, they just pop into mind.
10. Pick a writer to co-write a book with and tell us what you’d write about.
Neal Asher would probably be my number one, especially since Creighton couldn’t happen. Obviously it would have to be a book that takes place in space. I think I might show him the small outline I have for a novel I have currently named Collapsing Universe.
11. Describe your writing process from scratch to finish.
It depends. The Zoey series is a terrible example. For them, I really only do the plot of the novel, write down a description by chapter, sometimes it has to be tweaked during the writing process. It also isn’t very long. For a series that is typically 200 to 300 thousand words a book, the outline might stretch twenty pages. In comparison Cruel World has over ten pages for it’s outline and I don’t think it will hit sixty thousand words. Let It Die, a novel I haven’t put much pen to paper for, so to speak, I started with writing down a description for it. Then I detailed it out more with a chapter by chapter outline. Then I went and read through it many, many times and added on. The outline is over twenty pages for what will be a typical sized novel, 90 to 100 thousand words. Next is to do character details, though I will probably read through the outline before and after this step. Then I will start fleshing out the manuscript. After I finish that, I will read it and edit, read it and edit, read it and edit. (I’m a perfectionist.) Then I’ll have others read it and edit it from there. Then I’ll read it and edit it. Hopefully get a publisher behind it at this point.
12. How do you deal with self-doubts?
I honestly try to ignore them. If I can’t I will actually read chapters that are about Lord Neball from the Zoey series. It’s still my favorite writing that I’ve ever done.
13. How do you deal with writers block?
Sometimes I will actually step back for a few days or a week or two and just read other peoples work. If nothing else it might inspire me to continue or give me a new idea.
14. What’s the most research you ever put into a book?
Zoey. I have probably put in three days worth of research just with the first novel which has gone through peer revision and now overhaul inspired by Martin and Asher. I’ve probably put in another twelve plus for the second book which sits at a thrid of the way done.
15. Where does your inspiration come from?
The desire to write. The desire to have someone read my work. To have someone say they got lost in the book and couldn’t put it down. I don’t care about fame or fortune. Right now I make roughly 2,000 dollars a month, if writing started doing that steadily, I’d quite my job and be happy with that for the rest of my life.
16. Where do you take your motivation from?
Reading. Either what others have published or what I have written.
17. On avarage, how much writing do you get done in a day?
I typically write about a thousand words. In a week it could be about ten thousand.
18. What’s your revision or rewriting process like?
Hell. I’ll want so desperately to be done, but I go through my manuscripts over and over until I feel like it flows well enough and moves at the right pace, and everything else enough to share with others.
19. First line of a WIP you’re working on.
Haley lays under her covers in her room which is somewhere around seventy nine degrees. The only thing that is good in her opinion. She however is not sleeping peacefully. Laying on her side, her body is struggling with something that is not just in her head. 
That is the first paragraph for Cruel world. The first line isn’t the most exciting, but I think the paragraph sets it up well.
   20. Post a snippet of a WIP you’re working on.
This one I must preface. Lord Neball has finally turned on those that thought of her as a slave and this scene has her with the leader, the one who had been keeping her as a slave until her evil side awoken. I love this because leading up to this you have seen how, sick, vile, twisted, and depraved Neball can be.
"This time, I'll let you finish," she whispers into his ear. True to her words she squeezes him as tightly as she can and feels him begin to finish inside her. Aliessense lifts herself back up to a sitting position on top of him. "I am no longer, Aliessense," she breaths fire through her hate filled words and Dalient opens his eyes. The most fearful expression crosses his face that she has ever seen, as he looks up at her. "I am Lord Neball," she bellows at him. I am Death, Dalient thinks. A blinding light fills the room and the last word is stuck on repeat. Death is what the word Neball means in their language. After a moment, the light disappears, along with his head. That is one wound Dalient will not suffer through.
21. Post the last sentence you wrote in one of your WIP’s.
This is from Zoey: The Intergalactic Fighting Tournament (Second book). She is having a real tough time of things as of late and is about to figure out why, but that is actually in the next paragraph. It’s a very huge why.
"I know you are. I am far from angry with you. I'm worried. Admittedly I am afraid. Zoey, please, don't be afraid to tell me what is going on, if you have anything at all that you are hiding." Randy tells her, wrapping his arms around her. Not so oddly Zoey now feels safer and more relieved.
22. How many drafts do you need until you’re satisfied and a project is ultimately done for you?
It depends. I can see Cruel World getting one or two drafts. Zoey, as longer books, I can see as many as five or six... or seven.
23. Single or multi POV, and why?
Cruel World is for the most part single, until the end of the second to last chapter and the final chapter. Zoey will end up having had ten plus. Let it Die, two or three. Departure is the first book in my Argoes series of four books. It will have one predominate one and maybe two or three others throughout.
24. Poetry or prose, and why?
I’m going to say neither, but I do do poetry, mostly from a dark place.
25. Linear or non-linear, and why?
I prefer linear, but sometime there might be so story lines slightly further along, thinking from Zoey. I don’t really use non-linear though.
26. Standalone or series, and why?
Both. Though I have more love for the stories that are a series.
27. Do you share rough drafts or do you wait until it’s all polished? 
I don’t like to share until I’ve gutted my work with a chef’s knife.
28. And who do you share them with?
People who like to read. I don’t really know to many other authors.
29. Who do you write for?
Me
30. Favorite line you’ve ever written. I like the lines that shatter either the readers mind or a character, though I can’t exactly think of a favorite line.
31. Hardest character to write.
Haley
32. Easiest character to write.
Zoey. She flows so well.
33. Do you listen to music when you’re writing?
Yes. Mostly Black Metal, but sometimes if something fits well, I’l switch it up for the scene.
34. Handwritten notes or typed notes?
Typed
35. Tell some backstory details about one of your characters in your story ________.
I can’t give away much about Zoey without revealing the entire mystery of the series.
Randy is not human. He is a species called Avant. He isn’t the most powerful Avant to ever exist. He actually isn’t even one of the most powerful warriors in the universe currently, but he is the most powerful protaginist in the series.
36. A spoiler for Zoey.
Zoey is a key to a lot of things. Much more than just say Randy’s hidden power. Far more significant things. Let’s just say that a certain creature that is bored and spans the multiverse more than knows of her.
37. Most inspirational quote you’ve ever read or heard that’s still important to you.
”If you don’t have time to read, you don’t have the time (or the tools) to write. Simple as that.” - Stephen King
38. Have you shared your outline of your story Depature (book one of Argoes) with someone? If so, what did they think of it?
My girlfriend. She liked it, but I had to overhaul half of the opening part of the book. She doesn’t really like love stories and it had a small one. Though I never wanted that to be much of the book. So it works better without it.
39. Do you base your characters of real people or not? If so, tell us about one.
I have done so with one, but that was it. The character Grant Stewart in the Zoey series is based off a friend of mine.
40. Original Fiction or Fanfiction, and why?
Original Fiction. It’s more satisfying to create your own characters and world.
41. How many stories do you work on at one time?
I have been writing both Cruel World and Zoey this year, but more so Zoey for the last month.
42. How do you figure out your characters looks, personality, etc.
A lot of thinking and looking around. I have started trying to use the profile sheets that pop up on here to see how that works.
43. Are you an avid reader?
Yes, but I haven’t read a book in the last few weeks. Not since I finished Infinity Engine by Neal Asher.
44. Best piece of feedback you’ve ever gotten.
Probably that my characters in Zoey are so exciting and relatable. I was told by a beta that they were excited for what was coming next while they read my original “final” draft of Zoey The Avant Rises.
45. Worst piece of feedback you’ve ever gotten.
Hmm. not sure I remember. Anything that isn’t helpful I tend to forget about.
46. What would your story Zoey look like as a tv show or movie? 
Probably similar to The Expanse or Defiance, but with more fighting and more time spent on Earth than there is with the Expanse. Also a lot more school settings at least at first. After the first few seasons, because a movie would be impossible. It wouldn’t have much for school scenes.
47. Do you start with characters or plot when working on a new story?
Plot. The main character comes with that usually and I flesh out a outline with them and add characters from there and expand on the outline. Somewhere in there I usually get a story name.
48. Favorite genre to write in.
Science Fiction. Zoey, Argoes, Collapsing Universe are stories, the first two being series that I am working on or planning out that are Science Fiction.
49. What do you find the hardest to write in a story, the beginning, the middle or the end?
The beginning. except for Zoey, most everything comes pretty easy with the series, at least so far.
50. Weirdest story idea you’ve ever had.
I once seriously considered one from a dream I had. There was a staircase that went all the way down to “hell” and there were wicked creatures at the bottom of the mile upon mile long staircase. (sounds like a Stephen King book)
51. Describe the aesthetic of your story Cruel World in 5 sentences or words.
Oppressively depressing and dark.
52. How did writing change you?
I have an obsession now. I also imagine far more then I should in my daily life. It gets me in trouble sometimes.
53. What does writing mean to you?
Everything. I can’t live without it now. Nowhere to jot down my ideas and stories would be devastating. 
54. Any writing advice you want to share?
If you can handle going through the worst hell to get your story written then do it. If you can’t torture yourself, then writing isn’t for you. After that we can go from there.
1 note · View note
Text
Perhaps most of you’ve gotten heard over the course of the program, modular modules and programming, and understand the logic and use it. Nicely, when you're the one who's obtained this text, what's higher, but don’t worry in the event you're not. Here we are going to speak about module programming in javascript. For those who used this technique in other languages, you must know that because the JavaScript in common could be very totally different from the rest of the languages, that is totally different for the same program. Modular Writing may have a common story! In any case, let's take the headline.
Why modular programming
I feel that the answer to this query is just not very troublesome, any programming want to re-write the code that they could use several occasions, and just name it in totally different places. By sorting the program and using the code once more, Hamoon The program also has an incredible structure and extra handy programming. It additionally makes it easier to keep the code and the code is modified later. You would not have to vary every little thing in this system and alter the code. Then again, whenever you write in modular JavaScript, each module will get its personal particular scope, and it's nice that you do not fill the whole area of your program with variables in each module (or you will not be so soiled) that you simply'll end up with later. So let's go to the primary point Now it's time to see how we will write in modular javascript. There are a number of methods to do this, the primary query which may get in your mind is that we’ve got the module discussion in the ES6 and that's the case. However no, it's true that the module discussion has been launched to the eS, but nonetheless no modular programming browser helps JS. What’s our task now? We have now to use the libraries to do this, or use the Module Bundlers more accurately, to try this for us.
So, we need to do precisely what we do in the Nodus JS to the aspect of Clither, in order that we will require our file on the aspect of Clayt. Aha, we’ve not remembered. With no library, we will additionally write modulars and there are some methods to do that. Properly, I don’t advise, and it's actually a little bit of a multitude. When the libraries with a lot functionality do this, we come to ourselves. Let's face it.
So let's see how these libraries are divided. And which one is best to choose? With a view to write modular packages in your shopper aspect, you even have three CommonJS and AMD and ES6, each of which we explain (all of which are based mostly on certainly one of these three)
The two widespread ones, CommonJs and AMD, are generally referred to as Scriptloader. Notice that these aren’t a library and not just a normal or a way to standardize the code that writes the remaining.
Commonjs
The Comenius JS module is a javascript code that comes out of every module in the form of a code, and we will use it. The NodeGS itself additionally makes use of the Comenius GS, so when you work with Node, you possibly can easily study Widespread. Let's see the code from Widespread:
perform myModule ()   this.hey = perform ()     return 'hey!';   
  this.goodbye = perform ()     return 'goodbye!';   
module.exports = myModule;
perform myModule ()
this.hey = perform ()
return 'hey!';
this.goodbye = perform ()
return 'goodbye!';
module.exports = myModule;
Nicely, now, if you wish to use this code, we'll have to use another one:
can myModule = require ('myModule');
can myModuleInstance = new myModule (); myModuleInstance.howdy (); // 'howdy!' myModuleInstance.goodbye (); // 'goodbye!'
can myModule = require ('myModule');
can myModuleInstance = new myModule ();
myModuleInstance.good day (); // 'howdy!'
myModuleInstance.goodbye (); // 'goodbye!'
Properly, that's the code for writing in javascript, as I stated, the scope of all the program might be stored clear, and it's a good suggestion that we will use our code in all places and never repeat it. Within the meantime, you see the code is straightforward.
The necessary factor about CommonJs is that it masses the modules simultaneously. That is, when you have three information, they may load in the order they have been written (one after the opposite)
AMD
Properly, now if you want to obtain the information on the similar time, what?
Will probably be your selection of AMD. Let's check out the code right here:
outline ([‘myModule’, ‘myOtherModule’], perform (myModule, myOtherModule)   console.log (myModule.hey ()); );
outline ([‘myModule’, ‘myOtherModule’], perform (myModule, myOtherModule)
console.log (myModule.howdy ());
);
Properly, let's additionally say that many people don’t like this technique (in contrast to time) to load javascript information; as well as the CommonJs and es6 syntax is simpler to know.
Nicely, is it going to end right here and we shouldn’t have another selection?
UMD
For once you want each of you.
ES6
Properly, the final choice is es6. In fact, it's simply JavaScript. Which you in all probability heard too. For extra info on modules on es6, see this hyperlink.
Instance code syntax es6:
import sum from “./sum”;
var values ​​= [ 1, 2, 4, 5, 6, 7, 8, 9 ]; can reply = sum (values);
doc.getElementById (“answer”). innerHTML = reply;
import sum from “./sum”;
var values ​​= [ 1, 2, 4, 5, 6, 7, 8, 9 ];
can answer = sum (values);
document.getElementById (“answer”). innerHTML = answer;
Nicely, earlier than the relevant libraries referring to each of the four strategies I've outlined above, there are a variety of issues to keep in thoughts.
Let's know the books we need to know in the subsequent few strains, as I stated, generally known as the Module Bundler (or Module Bundler). Properly, first, let's see what the bundle module actually means, and what we need to do is add modules to ourselves.
Bundling the modules is actually placing together the modules beneath their proper association and ultimately pushing the output right into a file.
Nicely, might you say what's the appropriate order? Suppose we have now a module that’s affiliated with Jquery. If we need to put modules collectively just in a file, we have to ensure that the Jquery itself is loaded first after which it’s the module we wrote and is affiliated with Jquery. If not, my code won’t work.
Why should we mix our modules and get an output file?
Why should there be an output file, why do not load any of the modules that we’d like in the browser. The reason being apparent as a result of each time you could have a tag You add to your page. In truth, you’re slowly decreasing your load. Now imagine that you’ve 15 javascript information and modules that ought to be loaded for a single web page. And as you combine it, you'll additionally reduce your file and truly have a zipper file on the output.
Let's introduce the library of the methods we outlined above.
For commonjs
For the bundle or combination or whatever you want, it uses the CommonJs to be probably the most recognized Browserify technique. Perhaps you've already heard his identify.
To work with Browserify, assume that you’ve a file named fundamental.js that insert a module and use it:
can myDependency = require ('myDependency');
can myGrades = [93, 95, 88, 0, 91];
can myAverageGrade = myDependency.average (myGrades);
can myDependency = require ('myDependency');
can myGrades = [93, 95, 88, 0, 91];
can myAverageGrade = myDependency.average (myGrades);
Nicely, here we’ve got just one dependency for Kodemon, and that's truly myDependency. If we need to bundle this file and its affiliation into a file, command:
browserify essential.js -in bundle.js
browserify foremost.js -in bundle.js
I execute this command and truly put the command most important.js file and all its dependencies in the right order inside a file named bundle.js.
The dangerous information is that Browserfy is long been unstoppable and truly lifeless. However many still use it. Anyway, this combiner like the remainder of the Bundlers has plugins that you need to use.
For AMD
To work with AMD can also be probably the most well-known RequireJs. Until I remembered, I might say one thing to AMD, as I mentioned at first, AMD masses the modules in a non-synchronous manner. Whatever three information we’ve got, it does not make much difference for us, as a result of they all begin downloading from the server, so in such a state of affairs, it does not imply that the so-called information ought to be bundled. That's why they’re not referred to AMD Bundler libraries and are often known as Module Loader.
In fact, in reality, we have now three information or could also be affected by our loading velocity, so RequireJS additionally has some ways to bundle the modules.
Till I keep in mind, I say that for ADM, there’s one other library referred to as almond, which is, in fact, lighter.
For ES6
Nicely, yes, what's our JavaScript technique for? One of many largest bundlers is rollup. Which is to say that it claims that the file you’re lastly delivering is smaller in measurement than the other Bundler modules. We've also launched a function referred to as tree-shaking, which we're talking about at the bottom. Roll-up works on a config file, an example of it right here. In case you take a look at the code one factor you are able to do is get issues executed:
“use strict”;
let babel = require (“rollup-plugin-babel”),     commonjs = require (“rollup-plugin-commonjs”),     npm = require (“rollup-plugin-npm”),     uglify = require (“rollup-plugin-uglify”);
module.exports =     entry: “./examples/index.js”,     format: 'umd',     dest: 'bundle.js'     plugins: [ babel( exclude: “node_modules/**” ), npm( jsnext: true, foremost: true ), commonjs( embrace: ‘node_modules/**’ ), uglify() ] ;
1
2
three
four
5
6
7
eight
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
24
25
“use strict”;
let babel = require (“rollup-plugin-babel”),
commonjs = require (“rollup-plugin-commonjs”),
npm = require (“rollup-plugin-npm”),
uglify = require (“rollup-plugin-uglify”);
module.exports =
entry: “./examples/index.js”,
format: 'umd',
dest: 'bundle.js'
plugins:[[[[
babel (
exclude: “node_modules / **”
)
npm (
jsnext: true
primary: true
)
commonjs (
embrace: 'node_modules / **'
)
uglify ()
]
;
We come to the hardest of them, from the online pack you need to use to combine CommonJs, AMD, and Es information. Webpack, like rollup, has its personal options, for example, introduces a very good code-splitting function, which we're talking about under. The idea of the web-based job is a config file that performs every part inside it. For instance, you’ll be able to see a web-based config file:
module.exports =   context: __dirname + “/ src”,   entry: “./entry”   output:     path: __dirname     filename: “bundle.js”   ,   module:     loaders: [ check: /.js$/, loader: ‘babel-loader’, query: presets: [‘es2015’]
    ,       check: /.espresso$/,       loader: 'coffee-loader'     ,       check: /.ts$/,       loader: 'ts-loader'     ]
1
2
three
4
5
6
7
eight
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
module.exports =
context: __dirname + “/ src”,
entry: “./entry”
output:
path: __dirname
filename: “bundle.js”
,
module:
loaders:[[[[
check: /.js$/
loader: 'babel-loader'
query:
presets: [‘es2015’]
,
check: /.coffee$/,
loader: 'coffee-loader'
,
check: /.ts$/,
loader: 'ts-loader'
]
Properly, let's check out a few of the options we talked about however did not clarify.
Tree-shaking
See what this function is and what it's like. Suppose you’ve got a module referred to as util.js whose content is as follows:
export perform every (collection, iterator)   if (Array.isArray (assortment))     for (var i = zero; i <assortment.length; i ++)       iterator (collection[i], i, collection);         else     for (var key in collection)       iterator (collection[key], key, assortment);          
export perform filter (assortment, check)   can filtered = [];   every (collection, perform (item)     if (check (merchandise))       filtered.push (item);        );   return filtered;
export perform map (assortment, iterator)   can mapped = [];   every (collection, perform (value, key, collection)     mapped.push (iterator (worth));   );   return mapped;
1
2
3
four
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
24
25
26
27
28
29
export perform every (collection, iterator)
if (Array.isArray (collection))
for (var i = zero; i <collection.size; i ++)
iterator (assortment[i], i, collection);
else
for (var key in collection)
iterator (assortment[key], key, assortment);
export perform filter (assortment, check)
can filtered = [];
every (assortment, perform (merchandise)
if (check (item))
filtered.push (item);
);
return filtered;
export perform map (collection, iterator)
can mapped = [];
each (assortment, perform (value, key, assortment)
mapped.push (iterator (value));
);
return mapped;
And now suppose you need to use this module from your app. So you employ it first to learn it and then use it:
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
But in reality, if we get the code above, we'll see that we solely use one part of our file and that it's just the perform of each one. So whether we need to get all the contents of the util.js file, We used a small part? The tree-shaking function provides us the power to routinely add the code we used (in reality). In truth, the shake model of the code we wrote above is as follows:
perform each (assortment, iterator)   if (Array.isArray (collection))     for (var i = 0; i <assortment.length; i ++)       iterator (assortment[i], i, assortment);         else     for (var key in assortment)       iterator (collection[key], key, assortment);          ;
every ([1, 2, 3], perform (x) console.log (x));
perform each (assortment, iterator)
if (Array.isArray (assortment))
for (var i = 0; i <collection.size; i ++)
iterator (assortment[i], i, collection);
else
for (var key in collection)
iterator (collection[key], key, assortment);
;
each ([1, 2, 3], perform (x) console.log (x));
Not that we get the complete contents of the util.js file.
Code-splitting
So that you noticed in the previous part that it was automated detection. Actually, here we do the work manually. For example, think about the instance above that we simply need to use solely an util half. So suppose we also wrote the code we read, that is:
import * as utils from './utils.js';
Utils.each ([1, 2, 3], perform (x) console.log (x));
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
As soon as again, as soon as we solely wanted this code on a page, we just name that code. That’s, every.bundle.js does not characterize your complete bundle.js. Now suppose we’ve got a web page that solely needs this file, so there's no have to name the whole utilities in that page. Properly, then we think about this file as a bundle. Then compile this file, for example, every file's identify is output, each.bundle.js and the compiled file, which is definitely the identical file, its content with its dependencies on this Face:
perform each (collection, iterator)   if (Array.isArray (assortment))     for (var i = zero; i <collection.size; i ++)       iterator (assortment[i], i, assortment);         else     for (var key in collection)       iterator (collection[key], key, collection);          ;
each ([1, 2, 3], perform (x) console.log (x));
perform every (collection, iterator)
if (Array.isArray (assortment))
for (var i = zero; i <collection.length; i ++)
iterator (assortment[i], i, assortment);
else
for (var key in collection)
iterator (assortment[key], key, collection);
;
each ([1, 2, 3], perform (x) console.log (x));
One point: As I came upon, the online packer will later help tree-shaking, however if you want to use it now, you need to manually run a collection of configurations. For more info, you possibly can discuss with this hyperlink.
Properly, let's get the least loaded Module loader
With the GPS system, you can too write Commonjs, AMD, and Es6 syntax. The GIS system constructed on this repository is definitely a polyfill for the es6 modules, which we've just talked about above doesn’t help any browser right now. Examples embrace the GIS code:
System.import ('./ src / codeFile.js'). Then (perform (m)
// do one thing with 'm'
);
System.import ('./ src / codeFile.js'). Then (perform (m)
// do one thing with 'm'
);
Jspm
Nicely see what jspm is. The truth is, jspm is a bundle for systemjs, and in reality, from npm and github, the packages may be found. jspm isn’t just a package deal, and in reality, other issues can do for you. The truth is, you obtain packages for npm for the shopper aspect and offer you some additional features like bundling information.
The necessary thing about jspm is that it's made with regard to http2.
To read a superb article that compares the webpack with jspm, you possibly can discuss with this hyperlink.
So is that this all the best way to code modular code in javascript?
In fact, no, firstly, in fact, aside from what we launched, there are definitely different banners, however definitely not many and not very well known. Second, there’s another approach to write modules, and that's using transpilers in javascript. For more info, see Transspeeders here.
We’re working here with Typescript and Coffescript.
To work with Typescript, an example code:
import * as _ from 'lodash';
const double = (value: quantity) => value * 2
const addFive = (worth: quantity) => _.sum ([value, 5])
export =
double
addFive
1
2
three
four
5
6
7
8
9
10
11
12
13
14
15
16
17
import * as _ from 'lodash';
const double = (value: number) => value * 2
const addFive = (worth: quantity) => _.sum ([value, 5])
export =
double
addFive
The code for the Typescript module is similar to the es6 itself, and this is excellent.
The subsequent transshiper is Coffescript, the place you possibly can see the sample code for its module half:
sum = require 'lodash / sum'
double = (number) -> number * 2 addFive = (quantity) -> sum ([number, 5])
module.exports =   double: double   addFive: addFive
sum = require 'lodash / sum'
double = (quantity) -> quantity * 2
addFive = (number) -> sum ([number, 5])
module.exports =
double: double
addFive: addFive
Notice that once you use transpilers, you can’t do something like bundling. And most significantly, these bundles I've introduced have instruments that you should use with them inside (like Webpack) from Typescript.
Properly, hopefully this article has been edited for you. In the long run, I additionally supply some useful hyperlinks that you will discover out for more.
Lasso: An fascinating Bundler module!
Spittable: This one also helps the es6 and commonjs syntax in addition to code-splitting.
Steal.js: A loader module that additionally supports both widespread and AMD.
Hyperlink comparison file measurement of the output of the Bundler module collectively
A hyperlink to match the dimensions of the output file
Examine module code with totally different bundles
Persian tutorial webpack
The post Understanding Modular Programming in Javascript appeared first on Android Smart Gears.
0 notes
queer-gnome · 5 years
Text
Perhaps most of you’ve gotten heard over the course of the program, modular modules and programming, and understand the logic and use it. Nicely, when you're the one who's obtained this text, what's higher, but don’t worry in the event you're not. Here we are going to speak about module programming in javascript. For those who used this technique in other languages, you must know that because the JavaScript in common could be very totally different from the rest of the languages, that is totally different for the same program. Modular Writing may have a common story! In any case, let's take the headline.
Why modular programming
I feel that the answer to this query is just not very troublesome, any programming want to re-write the code that they could use several occasions, and just name it in totally different places. By sorting the program and using the code once more, Hamoon The program also has an incredible structure and extra handy programming. It additionally makes it easier to keep the code and the code is modified later. You would not have to vary every little thing in this system and alter the code. Then again, whenever you write in modular JavaScript, each module will get its personal particular scope, and it's nice that you do not fill the whole area of your program with variables in each module (or you will not be so soiled) that you simply'll end up with later. So let's go to the primary point Now it's time to see how we will write in modular javascript. There are a number of methods to do this, the primary query which may get in your mind is that we’ve got the module discussion in the ES6 and that's the case. However no, it's true that the module discussion has been launched to the eS, but nonetheless no modular programming browser helps JS. What’s our task now? We have now to use the libraries to do this, or use the Module Bundlers more accurately, to try this for us.
So, we need to do precisely what we do in the Nodus JS to the aspect of Clither, in order that we will require our file on the aspect of Clayt. Aha, we’ve not remembered. With no library, we will additionally write modulars and there are some methods to do that. Properly, I don’t advise, and it's actually a little bit of a multitude. When the libraries with a lot functionality do this, we come to ourselves. Let's face it.
So let's see how these libraries are divided. And which one is best to choose? With a view to write modular packages in your shopper aspect, you even have three CommonJS and AMD and ES6, each of which we explain (all of which are based mostly on certainly one of these three)
The two widespread ones, CommonJs and AMD, are generally referred to as Scriptloader. Notice that these aren’t a library and not just a normal or a way to standardize the code that writes the remaining.
Commonjs
The Comenius JS module is a javascript code that comes out of every module in the form of a code, and we will use it. The NodeGS itself additionally makes use of the Comenius GS, so when you work with Node, you possibly can easily study Widespread. Let's see the code from Widespread:
perform myModule ()   this.hey = perform ()     return 'hey!';   
  this.goodbye = perform ()     return 'goodbye!';   
module.exports = myModule;
perform myModule ()
this.hey = perform ()
return 'hey!';
this.goodbye = perform ()
return 'goodbye!';
module.exports = myModule;
Nicely, now, if you wish to use this code, we'll have to use another one:
can myModule = require ('myModule');
can myModuleInstance = new myModule (); myModuleInstance.howdy (); // 'howdy!' myModuleInstance.goodbye (); // 'goodbye!'
can myModule = require ('myModule');
can myModuleInstance = new myModule ();
myModuleInstance.good day (); // 'howdy!'
myModuleInstance.goodbye (); // 'goodbye!'
Properly, that's the code for writing in javascript, as I stated, the scope of all the program might be stored clear, and it's a good suggestion that we will use our code in all places and never repeat it. Within the meantime, you see the code is straightforward.
The necessary factor about CommonJs is that it masses the modules simultaneously. That is, when you have three information, they may load in the order they have been written (one after the opposite)
AMD
Properly, now if you want to obtain the information on the similar time, what?
Will probably be your selection of AMD. Let's check out the code right here:
outline ([‘myModule’, ‘myOtherModule’], perform (myModule, myOtherModule)   console.log (myModule.hey ()); );
outline ([‘myModule’, ‘myOtherModule’], perform (myModule, myOtherModule)
console.log (myModule.howdy ());
);
Properly, let's additionally say that many people don’t like this technique (in contrast to time) to load javascript information; as well as the CommonJs and es6 syntax is simpler to know.
Nicely, is it going to end right here and we shouldn’t have another selection?
UMD
For once you want each of you.
ES6
Properly, the final choice is es6. In fact, it's simply JavaScript. Which you in all probability heard too. For extra info on modules on es6, see this hyperlink.
Instance code syntax es6:
import sum from “./sum”;
var values ​​= [ 1, 2, 4, 5, 6, 7, 8, 9 ]; can reply = sum (values);
doc.getElementById (“answer”). innerHTML = reply;
import sum from “./sum”;
var values ​​= [ 1, 2, 4, 5, 6, 7, 8, 9 ];
can answer = sum (values);
document.getElementById (“answer”). innerHTML = answer;
Nicely, earlier than the relevant libraries referring to each of the four strategies I've outlined above, there are a variety of issues to keep in thoughts.
Let's know the books we need to know in the subsequent few strains, as I stated, generally known as the Module Bundler (or Module Bundler). Properly, first, let's see what the bundle module actually means, and what we need to do is add modules to ourselves.
Bundling the modules is actually placing together the modules beneath their proper association and ultimately pushing the output right into a file.
Nicely, might you say what's the appropriate order? Suppose we have now a module that’s affiliated with Jquery. If we need to put modules collectively just in a file, we have to ensure that the Jquery itself is loaded first after which it’s the module we wrote and is affiliated with Jquery. If not, my code won’t work.
Why should we mix our modules and get an output file?
Why should there be an output file, why do not load any of the modules that we’d like in the browser. The reason being apparent as a result of each time you could have a tag You add to your page. In truth, you’re slowly decreasing your load. Now imagine that you’ve 15 javascript information and modules that ought to be loaded for a single web page. And as you combine it, you'll additionally reduce your file and truly have a zipper file on the output.
Let's introduce the library of the methods we outlined above.
For commonjs
For the bundle or combination or whatever you want, it uses the CommonJs to be probably the most recognized Browserify technique. Perhaps you've already heard his identify.
To work with Browserify, assume that you’ve a file named fundamental.js that insert a module and use it:
can myDependency = require ('myDependency');
can myGrades = [93, 95, 88, 0, 91];
can myAverageGrade = myDependency.average (myGrades);
can myDependency = require ('myDependency');
can myGrades = [93, 95, 88, 0, 91];
can myAverageGrade = myDependency.average (myGrades);
Nicely, here we’ve got just one dependency for Kodemon, and that's truly myDependency. If we need to bundle this file and its affiliation into a file, command:
browserify essential.js -in bundle.js
browserify foremost.js -in bundle.js
I execute this command and truly put the command most important.js file and all its dependencies in the right order inside a file named bundle.js.
The dangerous information is that Browserfy is long been unstoppable and truly lifeless. However many still use it. Anyway, this combiner like the remainder of the Bundlers has plugins that you need to use.
For AMD
To work with AMD can also be probably the most well-known RequireJs. Until I remembered, I might say one thing to AMD, as I mentioned at first, AMD masses the modules in a non-synchronous manner. Whatever three information we’ve got, it does not make much difference for us, as a result of they all begin downloading from the server, so in such a state of affairs, it does not imply that the so-called information ought to be bundled. That's why they’re not referred to AMD Bundler libraries and are often known as Module Loader.
In fact, in reality, we have now three information or could also be affected by our loading velocity, so RequireJS additionally has some ways to bundle the modules.
Till I keep in mind, I say that for ADM, there’s one other library referred to as almond, which is, in fact, lighter.
For ES6
Nicely, yes, what's our JavaScript technique for? One of many largest bundlers is rollup. Which is to say that it claims that the file you’re lastly delivering is smaller in measurement than the other Bundler modules. We've also launched a function referred to as tree-shaking, which we're talking about at the bottom. Roll-up works on a config file, an example of it right here. In case you take a look at the code one factor you are able to do is get issues executed:
“use strict”;
let babel = require (“rollup-plugin-babel”),     commonjs = require (“rollup-plugin-commonjs”),     npm = require (“rollup-plugin-npm”),     uglify = require (“rollup-plugin-uglify”);
module.exports =     entry: “./examples/index.js”,     format: 'umd',     dest: 'bundle.js'     plugins: [ babel( exclude: “node_modules/**” ), npm( jsnext: true, foremost: true ), commonjs( embrace: ‘node_modules/**’ ), uglify() ] ;
1
2
three
four
5
6
7
eight
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
24
25
“use strict”;
let babel = require (“rollup-plugin-babel”),
commonjs = require (“rollup-plugin-commonjs”),
npm = require (“rollup-plugin-npm”),
uglify = require (“rollup-plugin-uglify”);
module.exports =
entry: “./examples/index.js”,
format: 'umd',
dest: 'bundle.js'
plugins:[[[[
babel (
exclude: “node_modules / **”
)
npm (
jsnext: true
primary: true
)
commonjs (
embrace: 'node_modules / **'
)
uglify ()
]
;
We come to the hardest of them, from the online pack you need to use to combine CommonJs, AMD, and Es information. Webpack, like rollup, has its personal options, for example, introduces a very good code-splitting function, which we're talking about under. The idea of the web-based job is a config file that performs every part inside it. For instance, you’ll be able to see a web-based config file:
module.exports =   context: __dirname + “/ src”,   entry: “./entry”   output:     path: __dirname     filename: “bundle.js”   ,   module:     loaders: [ check: /.js$/, loader: ‘babel-loader’, query: presets: [‘es2015’]
    ,       check: /.espresso$/,       loader: 'coffee-loader'     ,       check: /.ts$/,       loader: 'ts-loader'     ]
1
2
three
4
5
6
7
eight
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
module.exports =
context: __dirname + “/ src”,
entry: “./entry”
output:
path: __dirname
filename: “bundle.js”
,
module:
loaders:[[[[
check: /.js$/
loader: 'babel-loader'
query:
presets: [‘es2015’]
,
check: /.coffee$/,
loader: 'coffee-loader'
,
check: /.ts$/,
loader: 'ts-loader'
]
Properly, let's check out a few of the options we talked about however did not clarify.
Tree-shaking
See what this function is and what it's like. Suppose you’ve got a module referred to as util.js whose content is as follows:
export perform every (collection, iterator)   if (Array.isArray (assortment))     for (var i = zero; i <assortment.length; i ++)       iterator (collection[i], i, collection);         else     for (var key in collection)       iterator (collection[key], key, assortment);          
export perform filter (assortment, check)   can filtered = [];   every (collection, perform (item)     if (check (merchandise))       filtered.push (item);        );   return filtered;
export perform map (assortment, iterator)   can mapped = [];   every (collection, perform (value, key, collection)     mapped.push (iterator (worth));   );   return mapped;
1
2
3
four
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
24
25
26
27
28
29
export perform every (collection, iterator)
if (Array.isArray (collection))
for (var i = zero; i <collection.size; i ++)
iterator (assortment[i], i, collection);
else
for (var key in collection)
iterator (assortment[key], key, assortment);
export perform filter (assortment, check)
can filtered = [];
every (assortment, perform (merchandise)
if (check (item))
filtered.push (item);
);
return filtered;
export perform map (collection, iterator)
can mapped = [];
each (assortment, perform (value, key, assortment)
mapped.push (iterator (value));
);
return mapped;
And now suppose you need to use this module from your app. So you employ it first to learn it and then use it:
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
But in reality, if we get the code above, we'll see that we solely use one part of our file and that it's just the perform of each one. So whether we need to get all the contents of the util.js file, We used a small part? The tree-shaking function provides us the power to routinely add the code we used (in reality). In truth, the shake model of the code we wrote above is as follows:
perform each (assortment, iterator)   if (Array.isArray (collection))     for (var i = 0; i <assortment.length; i ++)       iterator (assortment[i], i, assortment);         else     for (var key in assortment)       iterator (collection[key], key, assortment);          ;
every ([1, 2, 3], perform (x) console.log (x));
perform each (assortment, iterator)
if (Array.isArray (assortment))
for (var i = 0; i <collection.size; i ++)
iterator (assortment[i], i, collection);
else
for (var key in collection)
iterator (collection[key], key, assortment);
;
each ([1, 2, 3], perform (x) console.log (x));
Not that we get the complete contents of the util.js file.
Code-splitting
So that you noticed in the previous part that it was automated detection. Actually, here we do the work manually. For example, think about the instance above that we simply need to use solely an util half. So suppose we also wrote the code we read, that is:
import * as utils from './utils.js';
Utils.each ([1, 2, 3], perform (x) console.log (x));
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
As soon as again, as soon as we solely wanted this code on a page, we just name that code. That’s, every.bundle.js does not characterize your complete bundle.js. Now suppose we’ve got a web page that solely needs this file, so there's no have to name the whole utilities in that page. Properly, then we think about this file as a bundle. Then compile this file, for example, every file's identify is output, each.bundle.js and the compiled file, which is definitely the identical file, its content with its dependencies on this Face:
perform each (collection, iterator)   if (Array.isArray (assortment))     for (var i = zero; i <collection.size; i ++)       iterator (assortment[i], i, assortment);         else     for (var key in collection)       iterator (collection[key], key, collection);          ;
each ([1, 2, 3], perform (x) console.log (x));
perform every (collection, iterator)
if (Array.isArray (assortment))
for (var i = zero; i <collection.length; i ++)
iterator (assortment[i], i, assortment);
else
for (var key in collection)
iterator (assortment[key], key, collection);
;
each ([1, 2, 3], perform (x) console.log (x));
One point: As I came upon, the online packer will later help tree-shaking, however if you want to use it now, you need to manually run a collection of configurations. For more info, you possibly can discuss with this hyperlink.
Properly, let's get the least loaded Module loader
With the GPS system, you can too write Commonjs, AMD, and Es6 syntax. The GIS system constructed on this repository is definitely a polyfill for the es6 modules, which we've just talked about above doesn’t help any browser right now. Examples embrace the GIS code:
System.import ('./ src / codeFile.js'). Then (perform (m)
// do one thing with 'm'
);
System.import ('./ src / codeFile.js'). Then (perform (m)
// do one thing with 'm'
);
Jspm
Nicely see what jspm is. The truth is, jspm is a bundle for systemjs, and in reality, from npm and github, the packages may be found. jspm isn’t just a package deal, and in reality, other issues can do for you. The truth is, you obtain packages for npm for the shopper aspect and offer you some additional features like bundling information.
The necessary thing about jspm is that it's made with regard to http2.
To read a superb article that compares the webpack with jspm, you possibly can discuss with this hyperlink.
So is that this all the best way to code modular code in javascript?
In fact, no, firstly, in fact, aside from what we launched, there are definitely different banners, however definitely not many and not very well known. Second, there’s another approach to write modules, and that's using transpilers in javascript. For more info, see Transspeeders here.
We’re working here with Typescript and Coffescript.
To work with Typescript, an example code:
import * as _ from 'lodash';
const double = (value: quantity) => value * 2
const addFive = (worth: quantity) => _.sum ([value, 5])
export =
double
addFive
1
2
three
four
5
6
7
8
9
10
11
12
13
14
15
16
17
import * as _ from 'lodash';
const double = (value: number) => value * 2
const addFive = (worth: quantity) => _.sum ([value, 5])
export =
double
addFive
The code for the Typescript module is similar to the es6 itself, and this is excellent.
The subsequent transshiper is Coffescript, the place you possibly can see the sample code for its module half:
sum = require 'lodash / sum'
double = (number) -> number * 2 addFive = (quantity) -> sum ([number, 5])
module.exports =   double: double   addFive: addFive
sum = require 'lodash / sum'
double = (quantity) -> quantity * 2
addFive = (number) -> sum ([number, 5])
module.exports =
double: double
addFive: addFive
Notice that once you use transpilers, you can’t do something like bundling. And most significantly, these bundles I've introduced have instruments that you should use with them inside (like Webpack) from Typescript.
Properly, hopefully this article has been edited for you. In the long run, I additionally supply some useful hyperlinks that you will discover out for more.
Lasso: An fascinating Bundler module!
Spittable: This one also helps the es6 and commonjs syntax in addition to code-splitting.
Steal.js: A loader module that additionally supports both widespread and AMD.
Hyperlink comparison file measurement of the output of the Bundler module collectively
A hyperlink to match the dimensions of the output file
Examine module code with totally different bundles
Persian tutorial webpack
The post Understanding Modular Programming in Javascript appeared first on Android Smart Gears.
0 notes
punkestboy-blog · 5 years
Text
Perhaps most of you’ve gotten heard over the course of the program, modular modules and programming, and understand the logic and use it. Nicely, when you're the one who's obtained this text, what's higher, but don’t worry in the event you're not. Here we are going to speak about module programming in javascript. For those who used this technique in other languages, you must know that because the JavaScript in common could be very totally different from the rest of the languages, that is totally different for the same program. Modular Writing may have a common story! In any case, let's take the headline.
Why modular programming
I feel that the answer to this query is just not very troublesome, any programming want to re-write the code that they could use several occasions, and just name it in totally different places. By sorting the program and using the code once more, Hamoon The program also has an incredible structure and extra handy programming. It additionally makes it easier to keep the code and the code is modified later. You would not have to vary every little thing in this system and alter the code. Then again, whenever you write in modular JavaScript, each module will get its personal particular scope, and it's nice that you do not fill the whole area of your program with variables in each module (or you will not be so soiled) that you simply'll end up with later. So let's go to the primary point Now it's time to see how we will write in modular javascript. There are a number of methods to do this, the primary query which may get in your mind is that we’ve got the module discussion in the ES6 and that's the case. However no, it's true that the module discussion has been launched to the eS, but nonetheless no modular programming browser helps JS. What’s our task now? We have now to use the libraries to do this, or use the Module Bundlers more accurately, to try this for us.
So, we need to do precisely what we do in the Nodus JS to the aspect of Clither, in order that we will require our file on the aspect of Clayt. Aha, we’ve not remembered. With no library, we will additionally write modulars and there are some methods to do that. Properly, I don’t advise, and it's actually a little bit of a multitude. When the libraries with a lot functionality do this, we come to ourselves. Let's face it.
So let's see how these libraries are divided. And which one is best to choose? With a view to write modular packages in your shopper aspect, you even have three CommonJS and AMD and ES6, each of which we explain (all of which are based mostly on certainly one of these three)
The two widespread ones, CommonJs and AMD, are generally referred to as Scriptloader. Notice that these aren’t a library and not just a normal or a way to standardize the code that writes the remaining.
Commonjs
The Comenius JS module is a javascript code that comes out of every module in the form of a code, and we will use it. The NodeGS itself additionally makes use of the Comenius GS, so when you work with Node, you possibly can easily study Widespread. Let's see the code from Widespread:
perform myModule ()   this.hey = perform ()     return 'hey!';   
  this.goodbye = perform ()     return 'goodbye!';   
module.exports = myModule;
perform myModule ()
this.hey = perform ()
return 'hey!';
this.goodbye = perform ()
return 'goodbye!';
module.exports = myModule;
Nicely, now, if you wish to use this code, we'll have to use another one:
can myModule = require ('myModule');
can myModuleInstance = new myModule (); myModuleInstance.howdy (); // 'howdy!' myModuleInstance.goodbye (); // 'goodbye!'
can myModule = require ('myModule');
can myModuleInstance = new myModule ();
myModuleInstance.good day (); // 'howdy!'
myModuleInstance.goodbye (); // 'goodbye!'
Properly, that's the code for writing in javascript, as I stated, the scope of all the program might be stored clear, and it's a good suggestion that we will use our code in all places and never repeat it. Within the meantime, you see the code is straightforward.
The necessary factor about CommonJs is that it masses the modules simultaneously. That is, when you have three information, they may load in the order they have been written (one after the opposite)
AMD
Properly, now if you want to obtain the information on the similar time, what?
Will probably be your selection of AMD. Let's check out the code right here:
outline ([‘myModule’, ‘myOtherModule’], perform (myModule, myOtherModule)   console.log (myModule.hey ()); );
outline ([‘myModule’, ‘myOtherModule’], perform (myModule, myOtherModule)
console.log (myModule.howdy ());
);
Properly, let's additionally say that many people don’t like this technique (in contrast to time) to load javascript information; as well as the CommonJs and es6 syntax is simpler to know.
Nicely, is it going to end right here and we shouldn’t have another selection?
UMD
For once you want each of you.
ES6
Properly, the final choice is es6. In fact, it's simply JavaScript. Which you in all probability heard too. For extra info on modules on es6, see this hyperlink.
Instance code syntax es6:
import sum from “./sum”;
var values ​​= [ 1, 2, 4, 5, 6, 7, 8, 9 ]; can reply = sum (values);
doc.getElementById (“answer”). innerHTML = reply;
import sum from “./sum”;
var values ​​= [ 1, 2, 4, 5, 6, 7, 8, 9 ];
can answer = sum (values);
document.getElementById (“answer”). innerHTML = answer;
Nicely, earlier than the relevant libraries referring to each of the four strategies I've outlined above, there are a variety of issues to keep in thoughts.
Let's know the books we need to know in the subsequent few strains, as I stated, generally known as the Module Bundler (or Module Bundler). Properly, first, let's see what the bundle module actually means, and what we need to do is add modules to ourselves.
Bundling the modules is actually placing together the modules beneath their proper association and ultimately pushing the output right into a file.
Nicely, might you say what's the appropriate order? Suppose we have now a module that’s affiliated with Jquery. If we need to put modules collectively just in a file, we have to ensure that the Jquery itself is loaded first after which it’s the module we wrote and is affiliated with Jquery. If not, my code won’t work.
Why should we mix our modules and get an output file?
Why should there be an output file, why do not load any of the modules that we’d like in the browser. The reason being apparent as a result of each time you could have a tag You add to your page. In truth, you’re slowly decreasing your load. Now imagine that you’ve 15 javascript information and modules that ought to be loaded for a single web page. And as you combine it, you'll additionally reduce your file and truly have a zipper file on the output.
Let's introduce the library of the methods we outlined above.
For commonjs
For the bundle or combination or whatever you want, it uses the CommonJs to be probably the most recognized Browserify technique. Perhaps you've already heard his identify.
To work with Browserify, assume that you’ve a file named fundamental.js that insert a module and use it:
can myDependency = require ('myDependency');
can myGrades = [93, 95, 88, 0, 91];
can myAverageGrade = myDependency.average (myGrades);
can myDependency = require ('myDependency');
can myGrades = [93, 95, 88, 0, 91];
can myAverageGrade = myDependency.average (myGrades);
Nicely, here we’ve got just one dependency for Kodemon, and that's truly myDependency. If we need to bundle this file and its affiliation into a file, command:
browserify essential.js -in bundle.js
browserify foremost.js -in bundle.js
I execute this command and truly put the command most important.js file and all its dependencies in the right order inside a file named bundle.js.
The dangerous information is that Browserfy is long been unstoppable and truly lifeless. However many still use it. Anyway, this combiner like the remainder of the Bundlers has plugins that you need to use.
For AMD
To work with AMD can also be probably the most well-known RequireJs. Until I remembered, I might say one thing to AMD, as I mentioned at first, AMD masses the modules in a non-synchronous manner. Whatever three information we’ve got, it does not make much difference for us, as a result of they all begin downloading from the server, so in such a state of affairs, it does not imply that the so-called information ought to be bundled. That's why they’re not referred to AMD Bundler libraries and are often known as Module Loader.
In fact, in reality, we have now three information or could also be affected by our loading velocity, so RequireJS additionally has some ways to bundle the modules.
Till I keep in mind, I say that for ADM, there’s one other library referred to as almond, which is, in fact, lighter.
For ES6
Nicely, yes, what's our JavaScript technique for? One of many largest bundlers is rollup. Which is to say that it claims that the file you’re lastly delivering is smaller in measurement than the other Bundler modules. We've also launched a function referred to as tree-shaking, which we're talking about at the bottom. Roll-up works on a config file, an example of it right here. In case you take a look at the code one factor you are able to do is get issues executed:
“use strict”;
let babel = require (“rollup-plugin-babel”),     commonjs = require (“rollup-plugin-commonjs”),     npm = require (“rollup-plugin-npm”),     uglify = require (“rollup-plugin-uglify”);
module.exports =     entry: “./examples/index.js”,     format: 'umd',     dest: 'bundle.js'     plugins: [ babel( exclude: “node_modules/**” ), npm( jsnext: true, foremost: true ), commonjs( embrace: ‘node_modules/**’ ), uglify() ] ;
1
2
three
four
5
6
7
eight
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
24
25
“use strict”;
let babel = require (“rollup-plugin-babel”),
commonjs = require (“rollup-plugin-commonjs”),
npm = require (“rollup-plugin-npm”),
uglify = require (“rollup-plugin-uglify”);
module.exports =
entry: “./examples/index.js”,
format: 'umd',
dest: 'bundle.js'
plugins:[[[[
babel (
exclude: “node_modules / **”
)
npm (
jsnext: true
primary: true
)
commonjs (
embrace: 'node_modules / **'
)
uglify ()
]
;
We come to the hardest of them, from the online pack you need to use to combine CommonJs, AMD, and Es information. Webpack, like rollup, has its personal options, for example, introduces a very good code-splitting function, which we're talking about under. The idea of the web-based job is a config file that performs every part inside it. For instance, you’ll be able to see a web-based config file:
module.exports =   context: __dirname + “/ src”,   entry: “./entry”   output:     path: __dirname     filename: “bundle.js”   ,   module:     loaders: [ check: /.js$/, loader: ‘babel-loader’, query: presets: [‘es2015’]
    ,       check: /.espresso$/,       loader: 'coffee-loader'     ,       check: /.ts$/,       loader: 'ts-loader'     ]
1
2
three
4
5
6
7
eight
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
module.exports =
context: __dirname + “/ src”,
entry: “./entry”
output:
path: __dirname
filename: “bundle.js”
,
module:
loaders:[[[[
check: /.js$/
loader: 'babel-loader'
query:
presets: [‘es2015’]
,
check: /.coffee$/,
loader: 'coffee-loader'
,
check: /.ts$/,
loader: 'ts-loader'
]
Properly, let's check out a few of the options we talked about however did not clarify.
Tree-shaking
See what this function is and what it's like. Suppose you’ve got a module referred to as util.js whose content is as follows:
export perform every (collection, iterator)   if (Array.isArray (assortment))     for (var i = zero; i <assortment.length; i ++)       iterator (collection[i], i, collection);         else     for (var key in collection)       iterator (collection[key], key, assortment);          
export perform filter (assortment, check)   can filtered = [];   every (collection, perform (item)     if (check (merchandise))       filtered.push (item);        );   return filtered;
export perform map (assortment, iterator)   can mapped = [];   every (collection, perform (value, key, collection)     mapped.push (iterator (worth));   );   return mapped;
1
2
3
four
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
24
25
26
27
28
29
export perform every (collection, iterator)
if (Array.isArray (collection))
for (var i = zero; i <collection.size; i ++)
iterator (assortment[i], i, collection);
else
for (var key in collection)
iterator (assortment[key], key, assortment);
export perform filter (assortment, check)
can filtered = [];
every (assortment, perform (merchandise)
if (check (item))
filtered.push (item);
);
return filtered;
export perform map (collection, iterator)
can mapped = [];
each (assortment, perform (value, key, assortment)
mapped.push (iterator (value));
);
return mapped;
And now suppose you need to use this module from your app. So you employ it first to learn it and then use it:
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
But in reality, if we get the code above, we'll see that we solely use one part of our file and that it's just the perform of each one. So whether we need to get all the contents of the util.js file, We used a small part? The tree-shaking function provides us the power to routinely add the code we used (in reality). In truth, the shake model of the code we wrote above is as follows:
perform each (assortment, iterator)   if (Array.isArray (collection))     for (var i = 0; i <assortment.length; i ++)       iterator (assortment[i], i, assortment);         else     for (var key in assortment)       iterator (collection[key], key, assortment);          ;
every ([1, 2, 3], perform (x) console.log (x));
perform each (assortment, iterator)
if (Array.isArray (assortment))
for (var i = 0; i <collection.size; i ++)
iterator (assortment[i], i, collection);
else
for (var key in collection)
iterator (collection[key], key, assortment);
;
each ([1, 2, 3], perform (x) console.log (x));
Not that we get the complete contents of the util.js file.
Code-splitting
So that you noticed in the previous part that it was automated detection. Actually, here we do the work manually. For example, think about the instance above that we simply need to use solely an util half. So suppose we also wrote the code we read, that is:
import * as utils from './utils.js';
Utils.each ([1, 2, 3], perform (x) console.log (x));
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
As soon as again, as soon as we solely wanted this code on a page, we just name that code. That’s, every.bundle.js does not characterize your complete bundle.js. Now suppose we’ve got a web page that solely needs this file, so there's no have to name the whole utilities in that page. Properly, then we think about this file as a bundle. Then compile this file, for example, every file's identify is output, each.bundle.js and the compiled file, which is definitely the identical file, its content with its dependencies on this Face:
perform each (collection, iterator)   if (Array.isArray (assortment))     for (var i = zero; i <collection.size; i ++)       iterator (assortment[i], i, assortment);         else     for (var key in collection)       iterator (collection[key], key, collection);          ;
each ([1, 2, 3], perform (x) console.log (x));
perform every (collection, iterator)
if (Array.isArray (assortment))
for (var i = zero; i <collection.length; i ++)
iterator (assortment[i], i, assortment);
else
for (var key in collection)
iterator (assortment[key], key, collection);
;
each ([1, 2, 3], perform (x) console.log (x));
One point: As I came upon, the online packer will later help tree-shaking, however if you want to use it now, you need to manually run a collection of configurations. For more info, you possibly can discuss with this hyperlink.
Properly, let's get the least loaded Module loader
With the GPS system, you can too write Commonjs, AMD, and Es6 syntax. The GIS system constructed on this repository is definitely a polyfill for the es6 modules, which we've just talked about above doesn’t help any browser right now. Examples embrace the GIS code:
System.import ('./ src / codeFile.js'). Then (perform (m)
// do one thing with 'm'
);
System.import ('./ src / codeFile.js'). Then (perform (m)
// do one thing with 'm'
);
Jspm
Nicely see what jspm is. The truth is, jspm is a bundle for systemjs, and in reality, from npm and github, the packages may be found. jspm isn’t just a package deal, and in reality, other issues can do for you. The truth is, you obtain packages for npm for the shopper aspect and offer you some additional features like bundling information.
The necessary thing about jspm is that it's made with regard to http2.
To read a superb article that compares the webpack with jspm, you possibly can discuss with this hyperlink.
So is that this all the best way to code modular code in javascript?
In fact, no, firstly, in fact, aside from what we launched, there are definitely different banners, however definitely not many and not very well known. Second, there’s another approach to write modules, and that's using transpilers in javascript. For more info, see Transspeeders here.
We’re working here with Typescript and Coffescript.
To work with Typescript, an example code:
import * as _ from 'lodash';
const double = (value: quantity) => value * 2
const addFive = (worth: quantity) => _.sum ([value, 5])
export =
double
addFive
1
2
three
four
5
6
7
8
9
10
11
12
13
14
15
16
17
import * as _ from 'lodash';
const double = (value: number) => value * 2
const addFive = (worth: quantity) => _.sum ([value, 5])
export =
double
addFive
The code for the Typescript module is similar to the es6 itself, and this is excellent.
The subsequent transshiper is Coffescript, the place you possibly can see the sample code for its module half:
sum = require 'lodash / sum'
double = (number) -> number * 2 addFive = (quantity) -> sum ([number, 5])
module.exports =   double: double   addFive: addFive
sum = require 'lodash / sum'
double = (quantity) -> quantity * 2
addFive = (number) -> sum ([number, 5])
module.exports =
double: double
addFive: addFive
Notice that once you use transpilers, you can’t do something like bundling. And most significantly, these bundles I've introduced have instruments that you should use with them inside (like Webpack) from Typescript.
Properly, hopefully this article has been edited for you. In the long run, I additionally supply some useful hyperlinks that you will discover out for more.
Lasso: An fascinating Bundler module!
Spittable: This one also helps the es6 and commonjs syntax in addition to code-splitting.
Steal.js: A loader module that additionally supports both widespread and AMD.
Hyperlink comparison file measurement of the output of the Bundler module collectively
A hyperlink to match the dimensions of the output file
Examine module code with totally different bundles
Persian tutorial webpack
The post Understanding Modular Programming in Javascript appeared first on Android Smart Gears.
0 notes
Text
Perhaps most of you’ve gotten heard over the course of the program, modular modules and programming, and understand the logic and use it. Nicely, when you're the one who's obtained this text, what's higher, but don’t worry in the event you're not. Here we are going to speak about module programming in javascript. For those who used this technique in other languages, you must know that because the JavaScript in common could be very totally different from the rest of the languages, that is totally different for the same program. Modular Writing may have a common story! In any case, let's take the headline.
Why modular programming
I feel that the answer to this query is just not very troublesome, any programming want to re-write the code that they could use several occasions, and just name it in totally different places. By sorting the program and using the code once more, Hamoon The program also has an incredible structure and extra handy programming. It additionally makes it easier to keep the code and the code is modified later. You would not have to vary every little thing in this system and alter the code. Then again, whenever you write in modular JavaScript, each module will get its personal particular scope, and it's nice that you do not fill the whole area of your program with variables in each module (or you will not be so soiled) that you simply'll end up with later. So let's go to the primary point Now it's time to see how we will write in modular javascript. There are a number of methods to do this, the primary query which may get in your mind is that we’ve got the module discussion in the ES6 and that's the case. However no, it's true that the module discussion has been launched to the eS, but nonetheless no modular programming browser helps JS. What’s our task now? We have now to use the libraries to do this, or use the Module Bundlers more accurately, to try this for us.
So, we need to do precisely what we do in the Nodus JS to the aspect of Clither, in order that we will require our file on the aspect of Clayt. Aha, we’ve not remembered. With no library, we will additionally write modulars and there are some methods to do that. Properly, I don’t advise, and it's actually a little bit of a multitude. When the libraries with a lot functionality do this, we come to ourselves. Let's face it.
So let's see how these libraries are divided. And which one is best to choose? With a view to write modular packages in your shopper aspect, you even have three CommonJS and AMD and ES6, each of which we explain (all of which are based mostly on certainly one of these three)
The two widespread ones, CommonJs and AMD, are generally referred to as Scriptloader. Notice that these aren’t a library and not just a normal or a way to standardize the code that writes the remaining.
Commonjs
The Comenius JS module is a javascript code that comes out of every module in the form of a code, and we will use it. The NodeGS itself additionally makes use of the Comenius GS, so when you work with Node, you possibly can easily study Widespread. Let's see the code from Widespread:
perform myModule ()   this.hey = perform ()     return 'hey!';   
  this.goodbye = perform ()     return 'goodbye!';   
module.exports = myModule;
perform myModule ()
this.hey = perform ()
return 'hey!';
this.goodbye = perform ()
return 'goodbye!';
module.exports = myModule;
Nicely, now, if you wish to use this code, we'll have to use another one:
can myModule = require ('myModule');
can myModuleInstance = new myModule (); myModuleInstance.howdy (); // 'howdy!' myModuleInstance.goodbye (); // 'goodbye!'
can myModule = require ('myModule');
can myModuleInstance = new myModule ();
myModuleInstance.good day (); // 'howdy!'
myModuleInstance.goodbye (); // 'goodbye!'
Properly, that's the code for writing in javascript, as I stated, the scope of all the program might be stored clear, and it's a good suggestion that we will use our code in all places and never repeat it. Within the meantime, you see the code is straightforward.
The necessary factor about CommonJs is that it masses the modules simultaneously. That is, when you have three information, they may load in the order they have been written (one after the opposite)
AMD
Properly, now if you want to obtain the information on the similar time, what?
Will probably be your selection of AMD. Let's check out the code right here:
outline ([‘myModule’, ‘myOtherModule’], perform (myModule, myOtherModule)   console.log (myModule.hey ()); );
outline ([‘myModule’, ‘myOtherModule’], perform (myModule, myOtherModule)
console.log (myModule.howdy ());
);
Properly, let's additionally say that many people don’t like this technique (in contrast to time) to load javascript information; as well as the CommonJs and es6 syntax is simpler to know.
Nicely, is it going to end right here and we shouldn’t have another selection?
UMD
For once you want each of you.
ES6
Properly, the final choice is es6. In fact, it's simply JavaScript. Which you in all probability heard too. For extra info on modules on es6, see this hyperlink.
Instance code syntax es6:
import sum from “./sum”;
var values ​​= [ 1, 2, 4, 5, 6, 7, 8, 9 ]; can reply = sum (values);
doc.getElementById (“answer”). innerHTML = reply;
import sum from “./sum”;
var values ​​= [ 1, 2, 4, 5, 6, 7, 8, 9 ];
can answer = sum (values);
document.getElementById (“answer”). innerHTML = answer;
Nicely, earlier than the relevant libraries referring to each of the four strategies I've outlined above, there are a variety of issues to keep in thoughts.
Let's know the books we need to know in the subsequent few strains, as I stated, generally known as the Module Bundler (or Module Bundler). Properly, first, let's see what the bundle module actually means, and what we need to do is add modules to ourselves.
Bundling the modules is actually placing together the modules beneath their proper association and ultimately pushing the output right into a file.
Nicely, might you say what's the appropriate order? Suppose we have now a module that’s affiliated with Jquery. If we need to put modules collectively just in a file, we have to ensure that the Jquery itself is loaded first after which it’s the module we wrote and is affiliated with Jquery. If not, my code won’t work.
Why should we mix our modules and get an output file?
Why should there be an output file, why do not load any of the modules that we’d like in the browser. The reason being apparent as a result of each time you could have a tag You add to your page. In truth, you’re slowly decreasing your load. Now imagine that you’ve 15 javascript information and modules that ought to be loaded for a single web page. And as you combine it, you'll additionally reduce your file and truly have a zipper file on the output.
Let's introduce the library of the methods we outlined above.
For commonjs
For the bundle or combination or whatever you want, it uses the CommonJs to be probably the most recognized Browserify technique. Perhaps you've already heard his identify.
To work with Browserify, assume that you’ve a file named fundamental.js that insert a module and use it:
can myDependency = require ('myDependency');
can myGrades = [93, 95, 88, 0, 91];
can myAverageGrade = myDependency.average (myGrades);
can myDependency = require ('myDependency');
can myGrades = [93, 95, 88, 0, 91];
can myAverageGrade = myDependency.average (myGrades);
Nicely, here we’ve got just one dependency for Kodemon, and that's truly myDependency. If we need to bundle this file and its affiliation into a file, command:
browserify essential.js -in bundle.js
browserify foremost.js -in bundle.js
I execute this command and truly put the command most important.js file and all its dependencies in the right order inside a file named bundle.js.
The dangerous information is that Browserfy is long been unstoppable and truly lifeless. However many still use it. Anyway, this combiner like the remainder of the Bundlers has plugins that you need to use.
For AMD
To work with AMD can also be probably the most well-known RequireJs. Until I remembered, I might say one thing to AMD, as I mentioned at first, AMD masses the modules in a non-synchronous manner. Whatever three information we’ve got, it does not make much difference for us, as a result of they all begin downloading from the server, so in such a state of affairs, it does not imply that the so-called information ought to be bundled. That's why they’re not referred to AMD Bundler libraries and are often known as Module Loader.
In fact, in reality, we have now three information or could also be affected by our loading velocity, so RequireJS additionally has some ways to bundle the modules.
Till I keep in mind, I say that for ADM, there’s one other library referred to as almond, which is, in fact, lighter.
For ES6
Nicely, yes, what's our JavaScript technique for? One of many largest bundlers is rollup. Which is to say that it claims that the file you’re lastly delivering is smaller in measurement than the other Bundler modules. We've also launched a function referred to as tree-shaking, which we're talking about at the bottom. Roll-up works on a config file, an example of it right here. In case you take a look at the code one factor you are able to do is get issues executed:
“use strict”;
let babel = require (“rollup-plugin-babel”),     commonjs = require (“rollup-plugin-commonjs”),     npm = require (“rollup-plugin-npm”),     uglify = require (“rollup-plugin-uglify”);
module.exports =     entry: “./examples/index.js”,     format: 'umd',     dest: 'bundle.js'     plugins: [ babel( exclude: “node_modules/**” ), npm( jsnext: true, foremost: true ), commonjs( embrace: ‘node_modules/**’ ), uglify() ] ;
1
2
three
four
5
6
7
eight
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
24
25
“use strict”;
let babel = require (“rollup-plugin-babel”),
commonjs = require (“rollup-plugin-commonjs”),
npm = require (“rollup-plugin-npm”),
uglify = require (“rollup-plugin-uglify”);
module.exports =
entry: “./examples/index.js”,
format: 'umd',
dest: 'bundle.js'
plugins:[[[[
babel (
exclude: “node_modules / **”
)
npm (
jsnext: true
primary: true
)
commonjs (
embrace: 'node_modules / **'
)
uglify ()
]
;
We come to the hardest of them, from the online pack you need to use to combine CommonJs, AMD, and Es information. Webpack, like rollup, has its personal options, for example, introduces a very good code-splitting function, which we're talking about under. The idea of the web-based job is a config file that performs every part inside it. For instance, you’ll be able to see a web-based config file:
module.exports =   context: __dirname + “/ src”,   entry: “./entry”   output:     path: __dirname     filename: “bundle.js”   ,   module:     loaders: [ check: /.js$/, loader: ‘babel-loader’, query: presets: [‘es2015’]
    ,       check: /.espresso$/,       loader: 'coffee-loader'     ,       check: /.ts$/,       loader: 'ts-loader'     ]
1
2
three
4
5
6
7
eight
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
module.exports =
context: __dirname + “/ src”,
entry: “./entry”
output:
path: __dirname
filename: “bundle.js”
,
module:
loaders:[[[[
check: /.js$/
loader: 'babel-loader'
query:
presets: [‘es2015’]
,
check: /.coffee$/,
loader: 'coffee-loader'
,
check: /.ts$/,
loader: 'ts-loader'
]
Properly, let's check out a few of the options we talked about however did not clarify.
Tree-shaking
See what this function is and what it's like. Suppose you’ve got a module referred to as util.js whose content is as follows:
export perform every (collection, iterator)   if (Array.isArray (assortment))     for (var i = zero; i <assortment.length; i ++)       iterator (collection[i], i, collection);         else     for (var key in collection)       iterator (collection[key], key, assortment);          
export perform filter (assortment, check)   can filtered = [];   every (collection, perform (item)     if (check (merchandise))       filtered.push (item);        );   return filtered;
export perform map (assortment, iterator)   can mapped = [];   every (collection, perform (value, key, collection)     mapped.push (iterator (worth));   );   return mapped;
1
2
3
four
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
24
25
26
27
28
29
export perform every (collection, iterator)
if (Array.isArray (collection))
for (var i = zero; i <collection.size; i ++)
iterator (assortment[i], i, collection);
else
for (var key in collection)
iterator (assortment[key], key, assortment);
export perform filter (assortment, check)
can filtered = [];
every (assortment, perform (merchandise)
if (check (item))
filtered.push (item);
);
return filtered;
export perform map (collection, iterator)
can mapped = [];
each (assortment, perform (value, key, assortment)
mapped.push (iterator (value));
);
return mapped;
And now suppose you need to use this module from your app. So you employ it first to learn it and then use it:
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
But in reality, if we get the code above, we'll see that we solely use one part of our file and that it's just the perform of each one. So whether we need to get all the contents of the util.js file, We used a small part? The tree-shaking function provides us the power to routinely add the code we used (in reality). In truth, the shake model of the code we wrote above is as follows:
perform each (assortment, iterator)   if (Array.isArray (collection))     for (var i = 0; i <assortment.length; i ++)       iterator (assortment[i], i, assortment);         else     for (var key in assortment)       iterator (collection[key], key, assortment);          ;
every ([1, 2, 3], perform (x) console.log (x));
perform each (assortment, iterator)
if (Array.isArray (assortment))
for (var i = 0; i <collection.size; i ++)
iterator (assortment[i], i, collection);
else
for (var key in collection)
iterator (collection[key], key, assortment);
;
each ([1, 2, 3], perform (x) console.log (x));
Not that we get the complete contents of the util.js file.
Code-splitting
So that you noticed in the previous part that it was automated detection. Actually, here we do the work manually. For example, think about the instance above that we simply need to use solely an util half. So suppose we also wrote the code we read, that is:
import * as utils from './utils.js';
Utils.each ([1, 2, 3], perform (x) console.log (x));
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
As soon as again, as soon as we solely wanted this code on a page, we just name that code. That’s, every.bundle.js does not characterize your complete bundle.js. Now suppose we’ve got a web page that solely needs this file, so there's no have to name the whole utilities in that page. Properly, then we think about this file as a bundle. Then compile this file, for example, every file's identify is output, each.bundle.js and the compiled file, which is definitely the identical file, its content with its dependencies on this Face:
perform each (collection, iterator)   if (Array.isArray (assortment))     for (var i = zero; i <collection.size; i ++)       iterator (assortment[i], i, assortment);         else     for (var key in collection)       iterator (collection[key], key, collection);          ;
each ([1, 2, 3], perform (x) console.log (x));
perform every (collection, iterator)
if (Array.isArray (assortment))
for (var i = zero; i <collection.length; i ++)
iterator (assortment[i], i, assortment);
else
for (var key in collection)
iterator (assortment[key], key, collection);
;
each ([1, 2, 3], perform (x) console.log (x));
One point: As I came upon, the online packer will later help tree-shaking, however if you want to use it now, you need to manually run a collection of configurations. For more info, you possibly can discuss with this hyperlink.
Properly, let's get the least loaded Module loader
With the GPS system, you can too write Commonjs, AMD, and Es6 syntax. The GIS system constructed on this repository is definitely a polyfill for the es6 modules, which we've just talked about above doesn’t help any browser right now. Examples embrace the GIS code:
System.import ('./ src / codeFile.js'). Then (perform (m)
// do one thing with 'm'
);
System.import ('./ src / codeFile.js'). Then (perform (m)
// do one thing with 'm'
);
Jspm
Nicely see what jspm is. The truth is, jspm is a bundle for systemjs, and in reality, from npm and github, the packages may be found. jspm isn’t just a package deal, and in reality, other issues can do for you. The truth is, you obtain packages for npm for the shopper aspect and offer you some additional features like bundling information.
The necessary thing about jspm is that it's made with regard to http2.
To read a superb article that compares the webpack with jspm, you possibly can discuss with this hyperlink.
So is that this all the best way to code modular code in javascript?
In fact, no, firstly, in fact, aside from what we launched, there are definitely different banners, however definitely not many and not very well known. Second, there’s another approach to write modules, and that's using transpilers in javascript. For more info, see Transspeeders here.
We’re working here with Typescript and Coffescript.
To work with Typescript, an example code:
import * as _ from 'lodash';
const double = (value: quantity) => value * 2
const addFive = (worth: quantity) => _.sum ([value, 5])
export =
double
addFive
1
2
three
four
5
6
7
8
9
10
11
12
13
14
15
16
17
import * as _ from 'lodash';
const double = (value: number) => value * 2
const addFive = (worth: quantity) => _.sum ([value, 5])
export =
double
addFive
The code for the Typescript module is similar to the es6 itself, and this is excellent.
The subsequent transshiper is Coffescript, the place you possibly can see the sample code for its module half:
sum = require 'lodash / sum'
double = (number) -> number * 2 addFive = (quantity) -> sum ([number, 5])
module.exports =   double: double   addFive: addFive
sum = require 'lodash / sum'
double = (quantity) -> quantity * 2
addFive = (number) -> sum ([number, 5])
module.exports =
double: double
addFive: addFive
Notice that once you use transpilers, you can’t do something like bundling. And most significantly, these bundles I've introduced have instruments that you should use with them inside (like Webpack) from Typescript.
Properly, hopefully this article has been edited for you. In the long run, I additionally supply some useful hyperlinks that you will discover out for more.
Lasso: An fascinating Bundler module!
Spittable: This one also helps the es6 and commonjs syntax in addition to code-splitting.
Steal.js: A loader module that additionally supports both widespread and AMD.
Hyperlink comparison file measurement of the output of the Bundler module collectively
A hyperlink to match the dimensions of the output file
Examine module code with totally different bundles
Persian tutorial webpack
The post Understanding Modular Programming in Javascript appeared first on Android Smart Gears.
0 notes
batallanr123-blog · 5 years
Text
Perhaps most of you’ve gotten heard over the course of the program, modular modules and programming, and understand the logic and use it. Nicely, when you're the one who's obtained this text, what's higher, but don’t worry in the event you're not. Here we are going to speak about module programming in javascript. For those who used this technique in other languages, you must know that because the JavaScript in common could be very totally different from the rest of the languages, that is totally different for the same program. Modular Writing may have a common story! In any case, let's take the headline.
Why modular programming
I feel that the answer to this query is just not very troublesome, any programming want to re-write the code that they could use several occasions, and just name it in totally different places. By sorting the program and using the code once more, Hamoon The program also has an incredible structure and extra handy programming. It additionally makes it easier to keep the code and the code is modified later. You would not have to vary every little thing in this system and alter the code. Then again, whenever you write in modular JavaScript, each module will get its personal particular scope, and it's nice that you do not fill the whole area of your program with variables in each module (or you will not be so soiled) that you simply'll end up with later. So let's go to the primary point Now it's time to see how we will write in modular javascript. There are a number of methods to do this, the primary query which may get in your mind is that we’ve got the module discussion in the ES6 and that's the case. However no, it's true that the module discussion has been launched to the eS, but nonetheless no modular programming browser helps JS. What’s our task now? We have now to use the libraries to do this, or use the Module Bundlers more accurately, to try this for us.
So, we need to do precisely what we do in the Nodus JS to the aspect of Clither, in order that we will require our file on the aspect of Clayt. Aha, we’ve not remembered. With no library, we will additionally write modulars and there are some methods to do that. Properly, I don’t advise, and it's actually a little bit of a multitude. When the libraries with a lot functionality do this, we come to ourselves. Let's face it.
So let's see how these libraries are divided. And which one is best to choose? With a view to write modular packages in your shopper aspect, you even have three CommonJS and AMD and ES6, each of which we explain (all of which are based mostly on certainly one of these three)
The two widespread ones, CommonJs and AMD, are generally referred to as Scriptloader. Notice that these aren’t a library and not just a normal or a way to standardize the code that writes the remaining.
Commonjs
The Comenius JS module is a javascript code that comes out of every module in the form of a code, and we will use it. The NodeGS itself additionally makes use of the Comenius GS, so when you work with Node, you possibly can easily study Widespread. Let's see the code from Widespread:
perform myModule ()   this.hey = perform ()     return 'hey!';   
  this.goodbye = perform ()     return 'goodbye!';   
module.exports = myModule;
perform myModule ()
this.hey = perform ()
return 'hey!';
this.goodbye = perform ()
return 'goodbye!';
module.exports = myModule;
Nicely, now, if you wish to use this code, we'll have to use another one:
can myModule = require ('myModule');
can myModuleInstance = new myModule (); myModuleInstance.howdy (); // 'howdy!' myModuleInstance.goodbye (); // 'goodbye!'
can myModule = require ('myModule');
can myModuleInstance = new myModule ();
myModuleInstance.good day (); // 'howdy!'
myModuleInstance.goodbye (); // 'goodbye!'
Properly, that's the code for writing in javascript, as I stated, the scope of all the program might be stored clear, and it's a good suggestion that we will use our code in all places and never repeat it. Within the meantime, you see the code is straightforward.
The necessary factor about CommonJs is that it masses the modules simultaneously. That is, when you have three information, they may load in the order they have been written (one after the opposite)
AMD
Properly, now if you want to obtain the information on the similar time, what?
Will probably be your selection of AMD. Let's check out the code right here:
outline ([‘myModule’, ‘myOtherModule’], perform (myModule, myOtherModule)   console.log (myModule.hey ()); );
outline ([‘myModule’, ‘myOtherModule’], perform (myModule, myOtherModule)
console.log (myModule.howdy ());
);
Properly, let's additionally say that many people don’t like this technique (in contrast to time) to load javascript information; as well as the CommonJs and es6 syntax is simpler to know.
Nicely, is it going to end right here and we shouldn’t have another selection?
UMD
For once you want each of you.
ES6
Properly, the final choice is es6. In fact, it's simply JavaScript. Which you in all probability heard too. For extra info on modules on es6, see this hyperlink.
Instance code syntax es6:
import sum from “./sum”;
var values ​​= [ 1, 2, 4, 5, 6, 7, 8, 9 ]; can reply = sum (values);
doc.getElementById (“answer”). innerHTML = reply;
import sum from “./sum”;
var values ​​= [ 1, 2, 4, 5, 6, 7, 8, 9 ];
can answer = sum (values);
document.getElementById (“answer”). innerHTML = answer;
Nicely, earlier than the relevant libraries referring to each of the four strategies I've outlined above, there are a variety of issues to keep in thoughts.
Let's know the books we need to know in the subsequent few strains, as I stated, generally known as the Module Bundler (or Module Bundler). Properly, first, let's see what the bundle module actually means, and what we need to do is add modules to ourselves.
Bundling the modules is actually placing together the modules beneath their proper association and ultimately pushing the output right into a file.
Nicely, might you say what's the appropriate order? Suppose we have now a module that’s affiliated with Jquery. If we need to put modules collectively just in a file, we have to ensure that the Jquery itself is loaded first after which it’s the module we wrote and is affiliated with Jquery. If not, my code won’t work.
Why should we mix our modules and get an output file?
Why should there be an output file, why do not load any of the modules that we’d like in the browser. The reason being apparent as a result of each time you could have a tag You add to your page. In truth, you’re slowly decreasing your load. Now imagine that you’ve 15 javascript information and modules that ought to be loaded for a single web page. And as you combine it, you'll additionally reduce your file and truly have a zipper file on the output.
Let's introduce the library of the methods we outlined above.
For commonjs
For the bundle or combination or whatever you want, it uses the CommonJs to be probably the most recognized Browserify technique. Perhaps you've already heard his identify.
To work with Browserify, assume that you’ve a file named fundamental.js that insert a module and use it:
can myDependency = require ('myDependency');
can myGrades = [93, 95, 88, 0, 91];
can myAverageGrade = myDependency.average (myGrades);
can myDependency = require ('myDependency');
can myGrades = [93, 95, 88, 0, 91];
can myAverageGrade = myDependency.average (myGrades);
Nicely, here we’ve got just one dependency for Kodemon, and that's truly myDependency. If we need to bundle this file and its affiliation into a file, command:
browserify essential.js -in bundle.js
browserify foremost.js -in bundle.js
I execute this command and truly put the command most important.js file and all its dependencies in the right order inside a file named bundle.js.
The dangerous information is that Browserfy is long been unstoppable and truly lifeless. However many still use it. Anyway, this combiner like the remainder of the Bundlers has plugins that you need to use.
For AMD
To work with AMD can also be probably the most well-known RequireJs. Until I remembered, I might say one thing to AMD, as I mentioned at first, AMD masses the modules in a non-synchronous manner. Whatever three information we’ve got, it does not make much difference for us, as a result of they all begin downloading from the server, so in such a state of affairs, it does not imply that the so-called information ought to be bundled. That's why they’re not referred to AMD Bundler libraries and are often known as Module Loader.
In fact, in reality, we have now three information or could also be affected by our loading velocity, so RequireJS additionally has some ways to bundle the modules.
Till I keep in mind, I say that for ADM, there’s one other library referred to as almond, which is, in fact, lighter.
For ES6
Nicely, yes, what's our JavaScript technique for? One of many largest bundlers is rollup. Which is to say that it claims that the file you’re lastly delivering is smaller in measurement than the other Bundler modules. We've also launched a function referred to as tree-shaking, which we're talking about at the bottom. Roll-up works on a config file, an example of it right here. In case you take a look at the code one factor you are able to do is get issues executed:
“use strict”;
let babel = require (“rollup-plugin-babel”),     commonjs = require (“rollup-plugin-commonjs”),     npm = require (“rollup-plugin-npm”),     uglify = require (“rollup-plugin-uglify”);
module.exports =     entry: “./examples/index.js”,     format: 'umd',     dest: 'bundle.js'     plugins: [ babel( exclude: “node_modules/**” ), npm( jsnext: true, foremost: true ), commonjs( embrace: ‘node_modules/**’ ), uglify() ] ;
1
2
three
four
5
6
7
eight
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
24
25
“use strict”;
let babel = require (“rollup-plugin-babel”),
commonjs = require (“rollup-plugin-commonjs”),
npm = require (“rollup-plugin-npm”),
uglify = require (“rollup-plugin-uglify”);
module.exports =
entry: “./examples/index.js”,
format: 'umd',
dest: 'bundle.js'
plugins:[[[[
babel (
exclude: “node_modules / **”
)
npm (
jsnext: true
primary: true
)
commonjs (
embrace: 'node_modules / **'
)
uglify ()
]
;
We come to the hardest of them, from the online pack you need to use to combine CommonJs, AMD, and Es information. Webpack, like rollup, has its personal options, for example, introduces a very good code-splitting function, which we're talking about under. The idea of the web-based job is a config file that performs every part inside it. For instance, you’ll be able to see a web-based config file:
module.exports =   context: __dirname + “/ src”,   entry: “./entry”   output:     path: __dirname     filename: “bundle.js”   ,   module:     loaders: [ check: /.js$/, loader: ‘babel-loader’, query: presets: [‘es2015’]
    ,       check: /.espresso$/,       loader: 'coffee-loader'     ,       check: /.ts$/,       loader: 'ts-loader'     ]
1
2
three
4
5
6
7
eight
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
module.exports =
context: __dirname + “/ src”,
entry: “./entry”
output:
path: __dirname
filename: “bundle.js”
,
module:
loaders:[[[[
check: /.js$/
loader: 'babel-loader'
query:
presets: [‘es2015’]
,
check: /.coffee$/,
loader: 'coffee-loader'
,
check: /.ts$/,
loader: 'ts-loader'
]
Properly, let's check out a few of the options we talked about however did not clarify.
Tree-shaking
See what this function is and what it's like. Suppose you’ve got a module referred to as util.js whose content is as follows:
export perform every (collection, iterator)   if (Array.isArray (assortment))     for (var i = zero; i <assortment.length; i ++)       iterator (collection[i], i, collection);         else     for (var key in collection)       iterator (collection[key], key, assortment);          
export perform filter (assortment, check)   can filtered = [];   every (collection, perform (item)     if (check (merchandise))       filtered.push (item);        );   return filtered;
export perform map (assortment, iterator)   can mapped = [];   every (collection, perform (value, key, collection)     mapped.push (iterator (worth));   );   return mapped;
1
2
3
four
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
24
25
26
27
28
29
export perform every (collection, iterator)
if (Array.isArray (collection))
for (var i = zero; i <collection.size; i ++)
iterator (assortment[i], i, collection);
else
for (var key in collection)
iterator (assortment[key], key, assortment);
export perform filter (assortment, check)
can filtered = [];
every (assortment, perform (merchandise)
if (check (item))
filtered.push (item);
);
return filtered;
export perform map (collection, iterator)
can mapped = [];
each (assortment, perform (value, key, assortment)
mapped.push (iterator (value));
);
return mapped;
And now suppose you need to use this module from your app. So you employ it first to learn it and then use it:
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
But in reality, if we get the code above, we'll see that we solely use one part of our file and that it's just the perform of each one. So whether we need to get all the contents of the util.js file, We used a small part? The tree-shaking function provides us the power to routinely add the code we used (in reality). In truth, the shake model of the code we wrote above is as follows:
perform each (assortment, iterator)   if (Array.isArray (collection))     for (var i = 0; i <assortment.length; i ++)       iterator (assortment[i], i, assortment);         else     for (var key in assortment)       iterator (collection[key], key, assortment);          ;
every ([1, 2, 3], perform (x) console.log (x));
perform each (assortment, iterator)
if (Array.isArray (assortment))
for (var i = 0; i <collection.size; i ++)
iterator (assortment[i], i, collection);
else
for (var key in collection)
iterator (collection[key], key, assortment);
;
each ([1, 2, 3], perform (x) console.log (x));
Not that we get the complete contents of the util.js file.
Code-splitting
So that you noticed in the previous part that it was automated detection. Actually, here we do the work manually. For example, think about the instance above that we simply need to use solely an util half. So suppose we also wrote the code we read, that is:
import * as utils from './utils.js';
Utils.each ([1, 2, 3], perform (x) console.log (x));
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
As soon as again, as soon as we solely wanted this code on a page, we just name that code. That’s, every.bundle.js does not characterize your complete bundle.js. Now suppose we’ve got a web page that solely needs this file, so there's no have to name the whole utilities in that page. Properly, then we think about this file as a bundle. Then compile this file, for example, every file's identify is output, each.bundle.js and the compiled file, which is definitely the identical file, its content with its dependencies on this Face:
perform each (collection, iterator)   if (Array.isArray (assortment))     for (var i = zero; i <collection.size; i ++)       iterator (assortment[i], i, assortment);         else     for (var key in collection)       iterator (collection[key], key, collection);          ;
each ([1, 2, 3], perform (x) console.log (x));
perform every (collection, iterator)
if (Array.isArray (assortment))
for (var i = zero; i <collection.length; i ++)
iterator (assortment[i], i, assortment);
else
for (var key in collection)
iterator (assortment[key], key, collection);
;
each ([1, 2, 3], perform (x) console.log (x));
One point: As I came upon, the online packer will later help tree-shaking, however if you want to use it now, you need to manually run a collection of configurations. For more info, you possibly can discuss with this hyperlink.
Properly, let's get the least loaded Module loader
With the GPS system, you can too write Commonjs, AMD, and Es6 syntax. The GIS system constructed on this repository is definitely a polyfill for the es6 modules, which we've just talked about above doesn’t help any browser right now. Examples embrace the GIS code:
System.import ('./ src / codeFile.js'). Then (perform (m)
// do one thing with 'm'
);
System.import ('./ src / codeFile.js'). Then (perform (m)
// do one thing with 'm'
);
Jspm
Nicely see what jspm is. The truth is, jspm is a bundle for systemjs, and in reality, from npm and github, the packages may be found. jspm isn’t just a package deal, and in reality, other issues can do for you. The truth is, you obtain packages for npm for the shopper aspect and offer you some additional features like bundling information.
The necessary thing about jspm is that it's made with regard to http2.
To read a superb article that compares the webpack with jspm, you possibly can discuss with this hyperlink.
So is that this all the best way to code modular code in javascript?
In fact, no, firstly, in fact, aside from what we launched, there are definitely different banners, however definitely not many and not very well known. Second, there’s another approach to write modules, and that's using transpilers in javascript. For more info, see Transspeeders here.
We’re working here with Typescript and Coffescript.
To work with Typescript, an example code:
import * as _ from 'lodash';
const double = (value: quantity) => value * 2
const addFive = (worth: quantity) => _.sum ([value, 5])
export =
double
addFive
1
2
three
four
5
6
7
8
9
10
11
12
13
14
15
16
17
import * as _ from 'lodash';
const double = (value: number) => value * 2
const addFive = (worth: quantity) => _.sum ([value, 5])
export =
double
addFive
The code for the Typescript module is similar to the es6 itself, and this is excellent.
The subsequent transshiper is Coffescript, the place you possibly can see the sample code for its module half:
sum = require 'lodash / sum'
double = (number) -> number * 2 addFive = (quantity) -> sum ([number, 5])
module.exports =   double: double   addFive: addFive
sum = require 'lodash / sum'
double = (quantity) -> quantity * 2
addFive = (number) -> sum ([number, 5])
module.exports =
double: double
addFive: addFive
Notice that once you use transpilers, you can’t do something like bundling. And most significantly, these bundles I've introduced have instruments that you should use with them inside (like Webpack) from Typescript.
Properly, hopefully this article has been edited for you. In the long run, I additionally supply some useful hyperlinks that you will discover out for more.
Lasso: An fascinating Bundler module!
Spittable: This one also helps the es6 and commonjs syntax in addition to code-splitting.
Steal.js: A loader module that additionally supports both widespread and AMD.
Hyperlink comparison file measurement of the output of the Bundler module collectively
A hyperlink to match the dimensions of the output file
Examine module code with totally different bundles
Persian tutorial webpack
The post Understanding Modular Programming in Javascript appeared first on Android Smart Gears.
0 notes
Text
Perhaps most of you’ve gotten heard over the course of the program, modular modules and programming, and understand the logic and use it. Nicely, when you're the one who's obtained this text, what's higher, but don’t worry in the event you're not. Here we are going to speak about module programming in javascript. For those who used this technique in other languages, you must know that because the JavaScript in common could be very totally different from the rest of the languages, that is totally different for the same program. Modular Writing may have a common story! In any case, let's take the headline.
Why modular programming
I feel that the answer to this query is just not very troublesome, any programming want to re-write the code that they could use several occasions, and just name it in totally different places. By sorting the program and using the code once more, Hamoon The program also has an incredible structure and extra handy programming. It additionally makes it easier to keep the code and the code is modified later. You would not have to vary every little thing in this system and alter the code. Then again, whenever you write in modular JavaScript, each module will get its personal particular scope, and it's nice that you do not fill the whole area of your program with variables in each module (or you will not be so soiled) that you simply'll end up with later. So let's go to the primary point Now it's time to see how we will write in modular javascript. There are a number of methods to do this, the primary query which may get in your mind is that we’ve got the module discussion in the ES6 and that's the case. However no, it's true that the module discussion has been launched to the eS, but nonetheless no modular programming browser helps JS. What’s our task now? We have now to use the libraries to do this, or use the Module Bundlers more accurately, to try this for us.
So, we need to do precisely what we do in the Nodus JS to the aspect of Clither, in order that we will require our file on the aspect of Clayt. Aha, we’ve not remembered. With no library, we will additionally write modulars and there are some methods to do that. Properly, I don’t advise, and it's actually a little bit of a multitude. When the libraries with a lot functionality do this, we come to ourselves. Let's face it.
So let's see how these libraries are divided. And which one is best to choose? With a view to write modular packages in your shopper aspect, you even have three CommonJS and AMD and ES6, each of which we explain (all of which are based mostly on certainly one of these three)
The two widespread ones, CommonJs and AMD, are generally referred to as Scriptloader. Notice that these aren’t a library and not just a normal or a way to standardize the code that writes the remaining.
Commonjs
The Comenius JS module is a javascript code that comes out of every module in the form of a code, and we will use it. The NodeGS itself additionally makes use of the Comenius GS, so when you work with Node, you possibly can easily study Widespread. Let's see the code from Widespread:
perform myModule ()   this.hey = perform ()     return 'hey!';   
  this.goodbye = perform ()     return 'goodbye!';   
module.exports = myModule;
perform myModule ()
this.hey = perform ()
return 'hey!';
this.goodbye = perform ()
return 'goodbye!';
module.exports = myModule;
Nicely, now, if you wish to use this code, we'll have to use another one:
can myModule = require ('myModule');
can myModuleInstance = new myModule (); myModuleInstance.howdy (); // 'howdy!' myModuleInstance.goodbye (); // 'goodbye!'
can myModule = require ('myModule');
can myModuleInstance = new myModule ();
myModuleInstance.good day (); // 'howdy!'
myModuleInstance.goodbye (); // 'goodbye!'
Properly, that's the code for writing in javascript, as I stated, the scope of all the program might be stored clear, and it's a good suggestion that we will use our code in all places and never repeat it. Within the meantime, you see the code is straightforward.
The necessary factor about CommonJs is that it masses the modules simultaneously. That is, when you have three information, they may load in the order they have been written (one after the opposite)
AMD
Properly, now if you want to obtain the information on the similar time, what?
Will probably be your selection of AMD. Let's check out the code right here:
outline ([‘myModule’, ‘myOtherModule’], perform (myModule, myOtherModule)   console.log (myModule.hey ()); );
outline ([‘myModule’, ‘myOtherModule’], perform (myModule, myOtherModule)
console.log (myModule.howdy ());
);
Properly, let's additionally say that many people don’t like this technique (in contrast to time) to load javascript information; as well as the CommonJs and es6 syntax is simpler to know.
Nicely, is it going to end right here and we shouldn’t have another selection?
UMD
For once you want each of you.
ES6
Properly, the final choice is es6. In fact, it's simply JavaScript. Which you in all probability heard too. For extra info on modules on es6, see this hyperlink.
Instance code syntax es6:
import sum from “./sum”;
var values ​​= [ 1, 2, 4, 5, 6, 7, 8, 9 ]; can reply = sum (values);
doc.getElementById (“answer”). innerHTML = reply;
import sum from “./sum”;
var values ​​= [ 1, 2, 4, 5, 6, 7, 8, 9 ];
can answer = sum (values);
document.getElementById (“answer”). innerHTML = answer;
Nicely, earlier than the relevant libraries referring to each of the four strategies I've outlined above, there are a variety of issues to keep in thoughts.
Let's know the books we need to know in the subsequent few strains, as I stated, generally known as the Module Bundler (or Module Bundler). Properly, first, let's see what the bundle module actually means, and what we need to do is add modules to ourselves.
Bundling the modules is actually placing together the modules beneath their proper association and ultimately pushing the output right into a file.
Nicely, might you say what's the appropriate order? Suppose we have now a module that’s affiliated with Jquery. If we need to put modules collectively just in a file, we have to ensure that the Jquery itself is loaded first after which it’s the module we wrote and is affiliated with Jquery. If not, my code won’t work.
Why should we mix our modules and get an output file?
Why should there be an output file, why do not load any of the modules that we’d like in the browser. The reason being apparent as a result of each time you could have a tag You add to your page. In truth, you’re slowly decreasing your load. Now imagine that you’ve 15 javascript information and modules that ought to be loaded for a single web page. And as you combine it, you'll additionally reduce your file and truly have a zipper file on the output.
Let's introduce the library of the methods we outlined above.
For commonjs
For the bundle or combination or whatever you want, it uses the CommonJs to be probably the most recognized Browserify technique. Perhaps you've already heard his identify.
To work with Browserify, assume that you’ve a file named fundamental.js that insert a module and use it:
can myDependency = require ('myDependency');
can myGrades = [93, 95, 88, 0, 91];
can myAverageGrade = myDependency.average (myGrades);
can myDependency = require ('myDependency');
can myGrades = [93, 95, 88, 0, 91];
can myAverageGrade = myDependency.average (myGrades);
Nicely, here we’ve got just one dependency for Kodemon, and that's truly myDependency. If we need to bundle this file and its affiliation into a file, command:
browserify essential.js -in bundle.js
browserify foremost.js -in bundle.js
I execute this command and truly put the command most important.js file and all its dependencies in the right order inside a file named bundle.js.
The dangerous information is that Browserfy is long been unstoppable and truly lifeless. However many still use it. Anyway, this combiner like the remainder of the Bundlers has plugins that you need to use.
For AMD
To work with AMD can also be probably the most well-known RequireJs. Until I remembered, I might say one thing to AMD, as I mentioned at first, AMD masses the modules in a non-synchronous manner. Whatever three information we’ve got, it does not make much difference for us, as a result of they all begin downloading from the server, so in such a state of affairs, it does not imply that the so-called information ought to be bundled. That's why they’re not referred to AMD Bundler libraries and are often known as Module Loader.
In fact, in reality, we have now three information or could also be affected by our loading velocity, so RequireJS additionally has some ways to bundle the modules.
Till I keep in mind, I say that for ADM, there’s one other library referred to as almond, which is, in fact, lighter.
For ES6
Nicely, yes, what's our JavaScript technique for? One of many largest bundlers is rollup. Which is to say that it claims that the file you’re lastly delivering is smaller in measurement than the other Bundler modules. We've also launched a function referred to as tree-shaking, which we're talking about at the bottom. Roll-up works on a config file, an example of it right here. In case you take a look at the code one factor you are able to do is get issues executed:
“use strict”;
let babel = require (“rollup-plugin-babel”),     commonjs = require (“rollup-plugin-commonjs”),     npm = require (“rollup-plugin-npm”),     uglify = require (“rollup-plugin-uglify”);
module.exports =     entry: “./examples/index.js”,     format: 'umd',     dest: 'bundle.js'     plugins: [ babel( exclude: “node_modules/**” ), npm( jsnext: true, foremost: true ), commonjs( embrace: ‘node_modules/**’ ), uglify() ] ;
1
2
three
four
5
6
7
eight
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
24
25
“use strict”;
let babel = require (“rollup-plugin-babel”),
commonjs = require (“rollup-plugin-commonjs”),
npm = require (“rollup-plugin-npm”),
uglify = require (“rollup-plugin-uglify”);
module.exports =
entry: “./examples/index.js”,
format: 'umd',
dest: 'bundle.js'
plugins:[[[[
babel (
exclude: “node_modules / **”
)
npm (
jsnext: true
primary: true
)
commonjs (
embrace: 'node_modules / **'
)
uglify ()
]
;
We come to the hardest of them, from the online pack you need to use to combine CommonJs, AMD, and Es information. Webpack, like rollup, has its personal options, for example, introduces a very good code-splitting function, which we're talking about under. The idea of the web-based job is a config file that performs every part inside it. For instance, you’ll be able to see a web-based config file:
module.exports =   context: __dirname + “/ src”,   entry: “./entry”   output:     path: __dirname     filename: “bundle.js”   ,   module:     loaders: [ check: /.js$/, loader: ‘babel-loader’, query: presets: [‘es2015’]
    ,       check: /.espresso$/,       loader: 'coffee-loader'     ,       check: /.ts$/,       loader: 'ts-loader'     ]
1
2
three
4
5
6
7
eight
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
module.exports =
context: __dirname + “/ src”,
entry: “./entry”
output:
path: __dirname
filename: “bundle.js”
,
module:
loaders:[[[[
check: /.js$/
loader: 'babel-loader'
query:
presets: [‘es2015’]
,
check: /.coffee$/,
loader: 'coffee-loader'
,
check: /.ts$/,
loader: 'ts-loader'
]
Properly, let's check out a few of the options we talked about however did not clarify.
Tree-shaking
See what this function is and what it's like. Suppose you’ve got a module referred to as util.js whose content is as follows:
export perform every (collection, iterator)   if (Array.isArray (assortment))     for (var i = zero; i <assortment.length; i ++)       iterator (collection[i], i, collection);         else     for (var key in collection)       iterator (collection[key], key, assortment);          
export perform filter (assortment, check)   can filtered = [];   every (collection, perform (item)     if (check (merchandise))       filtered.push (item);        );   return filtered;
export perform map (assortment, iterator)   can mapped = [];   every (collection, perform (value, key, collection)     mapped.push (iterator (worth));   );   return mapped;
1
2
3
four
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19th
20
21
22
23
24
25
26
27
28
29
export perform every (collection, iterator)
if (Array.isArray (collection))
for (var i = zero; i <collection.size; i ++)
iterator (assortment[i], i, collection);
else
for (var key in collection)
iterator (assortment[key], key, assortment);
export perform filter (assortment, check)
can filtered = [];
every (assortment, perform (merchandise)
if (check (item))
filtered.push (item);
);
return filtered;
export perform map (collection, iterator)
can mapped = [];
each (assortment, perform (value, key, assortment)
mapped.push (iterator (value));
);
return mapped;
And now suppose you need to use this module from your app. So you employ it first to learn it and then use it:
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
But in reality, if we get the code above, we'll see that we solely use one part of our file and that it's just the perform of each one. So whether we need to get all the contents of the util.js file, We used a small part? The tree-shaking function provides us the power to routinely add the code we used (in reality). In truth, the shake model of the code we wrote above is as follows:
perform each (assortment, iterator)   if (Array.isArray (collection))     for (var i = 0; i <assortment.length; i ++)       iterator (assortment[i], i, assortment);         else     for (var key in assortment)       iterator (collection[key], key, assortment);          ;
every ([1, 2, 3], perform (x) console.log (x));
perform each (assortment, iterator)
if (Array.isArray (assortment))
for (var i = 0; i <collection.size; i ++)
iterator (assortment[i], i, collection);
else
for (var key in collection)
iterator (collection[key], key, assortment);
;
each ([1, 2, 3], perform (x) console.log (x));
Not that we get the complete contents of the util.js file.
Code-splitting
So that you noticed in the previous part that it was automated detection. Actually, here we do the work manually. For example, think about the instance above that we simply need to use solely an util half. So suppose we also wrote the code we read, that is:
import * as utils from './utils.js';
Utils.each ([1, 2, 3], perform (x) console.log (x));
import * as utils from './utils.js';
Utils.every ([1, 2, 3], perform (x) console.log (x));
As soon as again, as soon as we solely wanted this code on a page, we just name that code. That’s, every.bundle.js does not characterize your complete bundle.js. Now suppose we’ve got a web page that solely needs this file, so there's no have to name the whole utilities in that page. Properly, then we think about this file as a bundle. Then compile this file, for example, every file's identify is output, each.bundle.js and the compiled file, which is definitely the identical file, its content with its dependencies on this Face:
perform each (collection, iterator)   if (Array.isArray (assortment))     for (var i = zero; i <collection.size; i ++)       iterator (assortment[i], i, assortment);         else     for (var key in collection)       iterator (collection[key], key, collection);          ;
each ([1, 2, 3], perform (x) console.log (x));
perform every (collection, iterator)
if (Array.isArray (assortment))
for (var i = zero; i <collection.length; i ++)
iterator (assortment[i], i, assortment);
else
for (var key in collection)
iterator (assortment[key], key, collection);
;
each ([1, 2, 3], perform (x) console.log (x));
One point: As I came upon, the online packer will later help tree-shaking, however if you want to use it now, you need to manually run a collection of configurations. For more info, you possibly can discuss with this hyperlink.
Properly, let's get the least loaded Module loader
With the GPS system, you can too write Commonjs, AMD, and Es6 syntax. The GIS system constructed on this repository is definitely a polyfill for the es6 modules, which we've just talked about above doesn’t help any browser right now. Examples embrace the GIS code:
System.import ('./ src / codeFile.js'). Then (perform (m)
// do one thing with 'm'
);
System.import ('./ src / codeFile.js'). Then (perform (m)
// do one thing with 'm'
);
Jspm
Nicely see what jspm is. The truth is, jspm is a bundle for systemjs, and in reality, from npm and github, the packages may be found. jspm isn’t just a package deal, and in reality, other issues can do for you. The truth is, you obtain packages for npm for the shopper aspect and offer you some additional features like bundling information.
The necessary thing about jspm is that it's made with regard to http2.
To read a superb article that compares the webpack with jspm, you possibly can discuss with this hyperlink.
So is that this all the best way to code modular code in javascript?
In fact, no, firstly, in fact, aside from what we launched, there are definitely different banners, however definitely not many and not very well known. Second, there’s another approach to write modules, and that's using transpilers in javascript. For more info, see Transspeeders here.
We’re working here with Typescript and Coffescript.
To work with Typescript, an example code:
import * as _ from 'lodash';
const double = (value: quantity) => value * 2
const addFive = (worth: quantity) => _.sum ([value, 5])
export =
double
addFive
1
2
three
four
5
6
7
8
9
10
11
12
13
14
15
16
17
import * as _ from 'lodash';
const double = (value: number) => value * 2
const addFive = (worth: quantity) => _.sum ([value, 5])
export =
double
addFive
The code for the Typescript module is similar to the es6 itself, and this is excellent.
The subsequent transshiper is Coffescript, the place you possibly can see the sample code for its module half:
sum = require 'lodash / sum'
double = (number) -> number * 2 addFive = (quantity) -> sum ([number, 5])
module.exports =   double: double   addFive: addFive
sum = require 'lodash / sum'
double = (quantity) -> quantity * 2
addFive = (number) -> sum ([number, 5])
module.exports =
double: double
addFive: addFive
Notice that once you use transpilers, you can’t do something like bundling. And most significantly, these bundles I've introduced have instruments that you should use with them inside (like Webpack) from Typescript.
Properly, hopefully this article has been edited for you. In the long run, I additionally supply some useful hyperlinks that you will discover out for more.
Lasso: An fascinating Bundler module!
Spittable: This one also helps the es6 and commonjs syntax in addition to code-splitting.
Steal.js: A loader module that additionally supports both widespread and AMD.
Hyperlink comparison file measurement of the output of the Bundler module collectively
A hyperlink to match the dimensions of the output file
Examine module code with totally different bundles
Persian tutorial webpack
The post Understanding Modular Programming in Javascript appeared first on Android Smart Gears.
0 notes